Skip to content

Commit

Permalink
feat(frontend): #173 Blank Page Setup for X-Tool (#177)
Browse files Browse the repository at this point in the history
Co-authored-by: raarielgrace <[email protected]>
Co-authored-by: Fergus MacConnell <[email protected]>
  • Loading branch information
3 people authored Nov 19, 2024
1 parent c46987c commit 58afd4c
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/common/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<b-navbar-nav class="gwells-nav">
<b-nav-item id="ribbon-search" class="navbar-link lvl2-link" :to="{ name: 'wells-home'}">Well Search</b-nav-item>
<b-nav-item id="ribbon-aquifers" v-if="show.aquifers" class="navbar-link lvl2-link" :to="{ name: 'aquifers-home' }">Aquifer Search</b-nav-item>
<b-nav-item id="ribbon-crosssection" v-if="show.bulk" class="navbar-link lvl2-link" :to="{ name: 'CrossHome' }">Cross Section</b-nav-item>
<b-nav-item id="ribbon-registry" class="navbar-link lvl2-link" :to="{ name: 'SearchHome'}">Registry Search</b-nav-item>
<b-nav-item class="navbar-link lvl2-link" v-if="show.dataEntry" :to="{ name: 'SubmissionsHome'}">Submit Report</b-nav-item>
<b-nav-item id="ribbon-bulk" class="navbar-link lvl2-link" v-if="show.bulk" :to="{ name: 'bulk-home' }">Bulk Upload</b-nav-item>
Expand Down
29 changes: 29 additions & 0 deletions frontend/src/crosssection/views/CrossHome.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
<template>
<b-card class="container p-1">
<h1 class="card-title" id="CrossSectionTitle">Cross Section Home</h1>
<div>
</div>
</b-card>
</template>

<script>
export default {
name: 'CrossHome',
}
</script>

<style>
</style>
16 changes: 16 additions & 0 deletions frontend/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import WellDetail from '@/wells/views/WellDetail.vue'
import EditWellAquifers from '@/wells/views/EditWellAquifers.vue'
import GroundwaterInformation from '@/wells/views/GroundwaterInformation.vue'

// Crossection components
import CrossHome from './crosssection/views/CrossHome.vue'

// Registries components
import SearchHome from '@/registry/components/search/SearchHome.vue'
import PersonDetail from '@/registry/components/people/PersonDetail.vue'
Expand Down Expand Up @@ -135,6 +138,19 @@ const router = new Router({
}
},

// Cross section tool routes
{
path: '/crosssection',
name: 'CrossHome',
component: CrossHome,
beforeEnter: AuthGuard,
meta: {
// list of required permissions (e.g. "edit: true" means user needs edit permission)
edit: true,
app: 'registry'
}
},

// Registries routes
{
path: '/registries/people/edit/:person_guid',
Expand Down
29 changes: 29 additions & 0 deletions frontend/tests/unit/specs/crosssection/CrossToolHome.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { shallowMount, createLocalVue } from '@vue/test-utils'
import Vuex from 'vuex'
import { merge } from 'lodash'
import CrossHome from '../../../../src/crosssection/views/CrossHome.vue'
import auth from '@/common/store/auth.js'

const localVue = createLocalVue()
localVue.use(Vuex)

describe('CrossHome.vue', () => {
const getters = {
userRoles: () => ({ wells: { view: true } })
}

const component = (options, storeState = {}) => {
const store = new Vuex.Store({
getters,
modules: { auth }
})
store.replaceState(merge(store.state, storeState))

return shallowMount(CrossHome, { store, localVue })
}

it('the page renders', () => {
const wrapper = component()
expect(wrapper.find('#CrossSectionTitle').text()).toBe('Cross Section Home')
})
})

0 comments on commit 58afd4c

Please sign in to comment.