-
Notifications
You must be signed in to change notification settings - Fork 0
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 #132 from SpeciesFileGroup/panels
Add panel layout customization. Add analytics
- Loading branch information
Showing
16 changed files
with
142 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 @@ | ||
| import PanelContent from './PanelContent.vue' | ||
|
|
||
| export default { | ||
| id: 'panel:content', | ||
| component: PanelContent | ||
| } |
File renamed without changes.
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 @@ | ||
| import PanelDescendants from './PanelDescendants.vue' | ||
|
|
||
| export default { | ||
| id: 'panel:descendants', | ||
| component: PanelDescendants | ||
| } |
File renamed without changes.
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,8 @@ | ||
| import { SPECIES_GROUP } from '@/modules/otus/constants' | ||
| import PanelGallery from './PanelGallery.vue' | ||
|
|
||
| export default { | ||
| id: 'panel:gallery', | ||
| component: PanelGallery, | ||
| available: [SPECIES_GROUP] | ||
| } |
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 @@ | ||
| import PanelMap from './PanelMap.vue' | ||
|
|
||
| export default { | ||
| id: 'panel:map', | ||
| component: PanelMap | ||
| } |
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 @@ | ||
| import PanelNomenclature from './PanelNomenclature.vue' | ||
|
|
||
| export default { | ||
| id: 'panel:nomenclature', | ||
| component: PanelNomenclature | ||
| } |
6 changes: 6 additions & 0 deletions
6
src/modules/otus/components/Panel/PanelNomenclatureReferences/main.js
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 @@ | ||
| import PanelNomenclatureReferences from './PanelNomenclatureReferences.vue' | ||
|
|
||
| export default { | ||
| id: 'panel:nomenclature-references', | ||
| component: PanelNomenclatureReferences | ||
| } |
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 @@ | ||
| import PanelStats from './PanelStats.vue' | ||
|
|
||
| export default { | ||
| id: 'panel:statistics', | ||
| component: PanelStats | ||
| } |
8 changes: 8 additions & 0 deletions
8
src/modules/otus/components/Panel/PanelTypeDesignation/main.js
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,8 @@ | ||
| import PanelTypeDesignation from './PanelTypeDesignation.vue' | ||
| import { FAMILY_GROUP, GENUS_GROUP } from '../../../constants' | ||
|
|
||
| export default { | ||
| id: 'panel:type', | ||
| component: PanelTypeDesignation, | ||
| available: [FAMILY_GROUP, GENUS_GROUP] | ||
| } |
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,8 @@ | ||
| import { SPECIES_GROUP } from '../../../constants' | ||
| import PanelTypeSpecimen from './PanelTypeSpecimen.vue' | ||
|
|
||
| export default { | ||
| id: 'panel:type-specimen', | ||
| component: PanelTypeSpecimen, | ||
| available: [SPECIES_GROUP] | ||
| } |
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,33 +1,43 @@ | ||
| import { FAMILY_GROUP, GENUS_GROUP, SPECIES_GROUP } from './rankGroups.js' | ||
| import PanelGallery from '../components/Panel/PanelGallery/Gallery.vue' | ||
| import PanelTypeSpecimen from '../components/Panel/PanelTypeSpecimen/PanelTypeSpecimen.vue' | ||
| import PanelTypeDesignation from '../components/Panel/PanelTypeDesignation/PanelTypeDesignation.vue' | ||
| import PanelNomenclature from '../components/Panel/PanelNomenclature/PanelNomenclature.vue' | ||
| import PanelNomenclatureReference from '../components/Panel/PanelNomenclatureReferences/PanelNomenclatureReferences.vue' | ||
| import PanelMap from '../components/Panel/PanelMap/PanelMap.vue' | ||
| import PanelDescendants from '../components/Panel/PanelDescendants/Descendants.vue' | ||
| import PanelContent from '../components/Panel/PanelContent/PanelContent.vue' | ||
| import PanelStats from '../components/Panel/PanelStats/PanelStats.vue' | ||
| const panelEntries = Object.values( | ||
| import.meta.glob('../components/Panel/*/main.js', { | ||
| eager: true, | ||
| import: 'default' | ||
| }) | ||
| ) | ||
|
|
||
| export const overviewLayout = { | ||
| left: [ | ||
| { component: PanelGallery }, | ||
| { | ||
| component: PanelTypeSpecimen, | ||
| available: [SPECIES_GROUP] | ||
| }, | ||
| { | ||
| component: PanelTypeDesignation, | ||
| available: [FAMILY_GROUP, GENUS_GROUP] | ||
| }, | ||
| { component: PanelNomenclature }, | ||
| { component: PanelNomenclatureReference } | ||
| ], | ||
| const { taxa_page_overview } = __APP_ENV__ | ||
|
|
||
| right: [ | ||
| { component: PanelMap }, | ||
| { component: PanelDescendants }, | ||
| { component: PanelContent }, | ||
| { component: PanelStats } | ||
| const DEFAULT_LAYOUT = [ | ||
| [ | ||
| [ | ||
| 'panel:gallery', | ||
| 'panel:type', | ||
| 'panel:type', | ||
| 'panel:type-specimen', | ||
| 'panel:nomenclature', | ||
| 'panel:nomenclature-references' | ||
| ], | ||
| ['panel:map', 'panel:descendants', 'panel:content', 'panel:statistics'] | ||
| ] | ||
| ] | ||
|
|
||
| function parsePanelConfiguraion(panelLayout) { | ||
| return panelLayout.map((row) => | ||
| row.map((col) => | ||
| col.map((panel) => { | ||
| const isPanelKey = typeof panel === 'string' | ||
| const panelObj = isPanelKey ? { id: panel } : { ...panel } | ||
| const entry = panelEntries.find((item) => item.id === panelObj.id) | ||
|
|
||
| return { | ||
| ...entry, | ||
| ...panelObj | ||
| } | ||
| }) | ||
| ) | ||
| ) | ||
| } | ||
|
|
||
| export const overviewLayout = parsePanelConfiguraion( | ||
| taxa_page_overview.panels || DEFAULT_LAYOUT | ||
| ) |
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