Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions src/components/Pages/Components/NavigationPanel.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<v-expansion-panels v-bind:value="$vuetify.breakpoint.mdAndUp ? 0 : null" v-if="links">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice clean vuetify2 way to handle the responsiveness. I love it.

I did have to go hunting to confirm value is the name for prop that controls if the panel is open or closed but that's not on you; for me that's not a super clear prop name :D

<v-expansion-panel>
<v-expansion-panel-header>{{ title }}</v-expansion-panel-header>

<v-expansion-panel-content>
<v-list class="wrap">
<v-list-item v-for="(link) in links" :key="link.routeName">
<v-list-item-content>
<v-list-item-title v-if="! isCurrentPage(link.routeName)">
<router-link :to="{ name: link.routeName }" class="text-decoration-none">
<v-list-item-title>{{ link.title }}</v-list-item-title>
</router-link>
</v-list-item-title>

<v-list-item-title v-else>{{ link.title }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
</template>

<script>
export default {
name: 'NavigationPanel',
props: {
title: String,
links: Array,
},
methods: {
isCurrentPage (routeName) {
return this.$route.name === routeName

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd rather we also pass in the current link as a prop to this component rather than have it magically determined it by the route name.

While we just have two hardcoded routes this works but once we are getting the policy list over the wire I don't think we'll be able to rely on the route name. We'll need to look at the params of the route and I think at that point it's probably cleaner for the caller of this component to specify which is the current page.

To try and give an example I think we will need to handle:

  • current
  • upcoming
  • 2029-01-01
  • 2022-01-01

},
},
}

</script>

<style scoped></style>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea to leave this there (clearly marked as scoped) as a service to the future editors of this component

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<v-main>
<v-container class="fill-height" fluid>
<v-row justify="center">
<v-col cols="8">
<v-col cols="11" md="4" order-md="last">
<TermsOfUseNavigationPanel />
</v-col>

<v-col cols="11" md="8">
<h1>Terms Of Use</h1>
<p>
PLEASE READ THESE TERMS OF USE CAREFULLY BEFORE USING THE SERVICES.
Expand Down Expand Up @@ -1288,9 +1292,13 @@
</template>

<script>
import TermsOfUseNavigationPanel from './NavigationPanel.vue'

export default {
name: 'TermsOfUse',
computed: {},
components: {
TermsOfUseNavigationPanel,
},
}
</script>

Expand Down
6 changes: 6 additions & 0 deletions src/components/Pages/TermsOfUse/NavigationLinks.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this was added as an attempt to remove the list from the NavigationPanel but not currently used?

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const termsOfUseLinks = [
{ title: 'Upcoming Version', route: 'TermsOfUseUpcoming' },
{ title: 'April 11th 2022 (current)', route: 'TermsOfUse' },
]

export default termsOfUseLinks
23 changes: 23 additions & 0 deletions src/components/Pages/TermsOfUse/NavigationPanel.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<NavigationPanel title="All Versions" :links="termsOfUseLinks" />
</template>

<script>
import NavigationPanel from '../Components/NavigationPanel.vue'

export default {
name: 'TermsOfUseNavigationPanel',
components: {
NavigationPanel,
},
data: () => ({
termsOfUseLinks: [
{ title: 'Upcoming Version', routeName: 'TermsOfUseUpcoming' },
{ title: 'April 11th 2022 (current)', routeName: 'TermsOfUse' },
],
}),
}

</script>

<style scoped></style>
Loading
Loading