-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from SpeciesFileGroup/development
Development
- Loading branch information
Showing
20 changed files
with
184 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { useRouter } from 'vue-router' | ||
import { humanize } from '@/utils/strings' | ||
|
||
export default function useChildrenRoutes () { | ||
export default function useChildrenRoutes() { | ||
const router = useRouter() | ||
const { children } = router.getRoutes().find(route => route.name === 'otus-id') | ||
const { children } = router | ||
.getRoutes() | ||
.find((route) => route.name === 'otus-id') | ||
|
||
return children.map(({ path, name }) => | ||
({ | ||
label: path && humanize(path), | ||
path, | ||
name | ||
}) | ||
) | ||
} | ||
return children.map(({ path, name, meta }) => ({ | ||
label: path && humanize(path), | ||
path, | ||
name, | ||
meta | ||
})) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './overview' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export const DEFAULT_OVERVIEW_LAYOUT = { | ||
overview: { | ||
panels: [ | ||
[ | ||
[ | ||
'panel:gallery', | ||
'panel:type', | ||
'panel:type', | ||
'panel:type-specimen', | ||
'panel:nomenclature', | ||
'panel:nomenclature-references' | ||
], | ||
[ | ||
'panel:map', | ||
'panel:descendants', | ||
'panel:content', | ||
'panel:statistics' | ||
] | ||
] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,29 @@ | ||
import OtuIndex from '@/modules/otus/views/Index.vue' | ||
import OtuOverview from '@/modules/otus/views/Overview.vue' | ||
import OtuDistribution from '@/modules/otus/views/Distribution.vue' | ||
import OtuTimeline from '@/modules/otus/views/Timeline.vue' | ||
import PageLayout from '@/modules/otus/views/PageLayout.vue' | ||
import layouts from '../constants/layouts' | ||
|
||
export default [{ | ||
name: 'otus-id', | ||
path: '/otus/:id', | ||
component: OtuIndex, | ||
redirect: { | ||
name: 'otus-id-overview' | ||
}, | ||
children: [ | ||
{ | ||
path: 'overview', | ||
name: 'otus-id-overview', | ||
component: OtuOverview, | ||
}, | ||
/* { | ||
path: 'timeline', | ||
name: 'otus-id-timeline', | ||
component: OtuTimeline | ||
}, | ||
{ | ||
path: 'descendants', | ||
name: 'otus-id-descendants', | ||
component: OtuDistribution | ||
}, | ||
{ | ||
path: 'images', | ||
name: 'otus-id-images', | ||
component: OtuDistribution | ||
}, | ||
{ | ||
path: 'type_specimens', | ||
name: 'otus-id-type_specimens', | ||
component: OtuDistribution | ||
}, | ||
{ | ||
path: 'specimen_records', | ||
name: 'otus-id-specimen_records', | ||
component: OtuDistribution | ||
}, | ||
{ | ||
path: 'content', | ||
name: 'otus-id-content', | ||
component: OtuDistribution | ||
}, | ||
{ | ||
path: 'annotations', | ||
name: 'otus-id-annotations', | ||
component: OtuDistribution | ||
}, | ||
{ | ||
path: 'distribution', | ||
name: 'otus-id-distribution', | ||
component: OtuDistribution | ||
}, */ | ||
] | ||
}] | ||
function makeChildrenRoutes() { | ||
const tabKeys = Object.keys(layouts || {}) | ||
|
||
return tabKeys.map((tab) => ({ | ||
path: tab, | ||
name: `otus-id-${tab}`, | ||
component: PageLayout, | ||
meta: { | ||
tab, | ||
rankGroup: layouts[tab].rankGroup | ||
} | ||
})) | ||
} | ||
|
||
export default [ | ||
{ | ||
name: 'otus-id', | ||
path: '/otus/:id', | ||
component: OtuIndex, | ||
redirect: { | ||
name: 'otus-id-overview' | ||
}, | ||
children: makeChildrenRoutes() | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './isAvailableForRank' | ||
export * from './isRankGroup' | ||
export * from './makeGeoJSONFeature' | ||
export * from './removeDuplicateShapes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export function isAvailableForRank(available, rankString) { | ||
return ( | ||
!available.length || | ||
available.some((rankGroup) => rankString?.includes(rankGroup)) | ||
) | ||
} |
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.