Skip to content

Commit

Permalink
feat(frontend): #333 Update drawer to only show curation menu only wh…
Browse files Browse the repository at this point in the history
…en user is authenticated
  • Loading branch information
tholulomo committed Mar 10, 2023
1 parent ef2e250 commit 275ed82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
14 changes: 10 additions & 4 deletions app/src/components/Drawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,27 @@
</router-link>
</md-list>
</md-list-item>
<md-list-item md-expand>
<md-list-item md-expand v-if="isAuth">
<md-icon class="utility-navfonticon">upload</md-icon>
<span class="md-list-item-text utility-navfont">Curate</span>
<md-list slot="md-expand">
<md-list-item class="md-inset" href="https://materialsmine.org/nm#/XMLCONV">
<!-- <md-list-item class="md-inset" href="https://materialsmine.org/nm#/XMLCONV">
Upload a Spreadsheet
</md-list-item>
</md-list-item> -->
<router-link :to="'/explorer/curate/spreadsheet'" v-slot="{navigate, href}" custom>
<md-list-item :href="href" @click="navigate" class="md-inset">Upload a Spreadsheet</md-list-item>
</router-link>
<router-link :to="''" v-slot="{navigate, href}" custom>
<md-list-item :href="href" @click="navigate" class="md-inset">Fill a Form</md-list-item>
</router-link>
<router-link :to="''" v-slot="{navigate, href}" custom>
<md-list-item :href="href" @click="navigate" class="md-inset">Submit SDD</md-list-item>
</router-link>
<router-link :to="''" v-slot="{navigate, href}" custom>
<md-list-item :href="href" @click="navigate" class="md-inset">Create new chart</md-list-item>
<md-list-item :href="href" @click="navigate" class="md-inset">Create New Chart</md-list-item>
</router-link>
<router-link :to="'/explorer/curate/validlist'" v-slot="{navigate, href}" custom>
<md-list-item :href="href" @click="navigate" class="md-inset">Add Xlsx List Entry</md-list-item>
</router-link>
</md-list>
</md-list-item>
Expand Down
5 changes: 3 additions & 2 deletions app/tests/unit/components/drawer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ describe('Drawer.vue', () => {
})

it('renders curate and its children on the drawer', () => {
expect.assertions(6)
expect.assertions(5)
expect(wrapper.html()).toContain('Home')
expect(wrapper.html()).toContain('About')
expect(wrapper.html()).toContain('Visualize')
expect(wrapper.html()).toContain('Curate')
// TODO (XX): Rewrite this test by Simulating authenticated user
// expect(wrapper.html()).toContain('Curate')
expect(wrapper.html()).toContain('Tools')
// TODO: Rewrite this test (for when auth enabled/auth disabled)
// expect(wrapper.html()).toContain('Log out')
Expand Down

0 comments on commit 275ed82

Please sign in to comment.