-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up species manager page and links to it (#1113)
- Added a mostly blank page for species management at /species-selector/manage-species - Added an element for navigating to and away from that page - Added a variation of the close button, which combines the close icon and a short, single-line label into a single button
- Loading branch information
Showing
19 changed files
with
404 additions
and
53 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
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
11 changes: 0 additions & 11 deletions
11
...nts/species-selector-search-results-app-bar/SpeciesSelectorSearchResultsAppBar.module.css
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
5 changes: 5 additions & 0 deletions
5
src/content/app/species-selector/views/species-manager/SpeciesManager.module.css
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,5 @@ | ||
.container { | ||
display: grid; | ||
grid-template-rows: auto 1fr; | ||
padding-left: var(--double-standard-gutter); | ||
} |
45 changes: 45 additions & 0 deletions
45
src/content/app/species-selector/views/species-manager/SpeciesManager.tsx
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,45 @@ | ||
/** | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* 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. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import ModalView from 'src/shared/components/modal-view/ModalView'; | ||
|
||
import SelectedGenomesTable from './selected-genomes-table/SelectedGenomesTable'; | ||
|
||
import styles from './SpeciesManager.module.css'; | ||
|
||
const SpeciesManager = () => { | ||
const navigate = useNavigate(); | ||
|
||
const onClose = () => { | ||
navigate(-1); | ||
}; | ||
|
||
return ( | ||
<ModalView onClose={onClose}> | ||
<div className={styles.container}> | ||
<div style={{ height: '60px' }}>Here will be the dropdown</div> | ||
<div> | ||
<SelectedGenomesTable /> | ||
</div> | ||
</div> | ||
</ModalView> | ||
); | ||
}; | ||
|
||
export default SpeciesManager; |
23 changes: 23 additions & 0 deletions
23
...pp/species-selector/views/species-manager/selected-genomes-table/SelectedGenomesTable.tsx
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,23 @@ | ||
/** | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* 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. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
const SelectedGenomesTable = () => { | ||
return <div>This is the table of selected genomes</div>; | ||
}; | ||
|
||
export default SelectedGenomesTable; |
69 changes: 69 additions & 0 deletions
69
...p/species-selector/views/species-manager/species-manager-app-bar/SpeciesManagerAppBar.tsx
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,69 @@ | ||
/** | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* 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. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { useAppSelector } from 'src/store'; | ||
|
||
import { getCommittedSpecies } from 'src/content/app/species-selector/state/species-selector-general-slice/speciesSelectorGeneralSelectors'; | ||
|
||
import AppBar, { AppName } from 'src/shared/components/app-bar/AppBar'; | ||
import SpeciesManagerIndicator from 'src/shared/components/species-manager-indicator/SpeciesManagerIndicator'; | ||
import { HelpPopupButton } from 'src/shared/components/help-popup'; | ||
import SpeciesLozenge from 'src/shared/components/selected-species/SpeciesLozenge'; | ||
import SpeciesTabsSlider from 'src/shared/components/species-tabs-slider/SpeciesTabsSlider'; | ||
|
||
import type { CommittedItem } from 'src/content/app/species-selector/types/committedItem'; | ||
|
||
export const SpeciesManagerAppBar = () => { | ||
const selectedSpecies = useAppSelector(getCommittedSpecies); | ||
const navigate = useNavigate(); | ||
|
||
const onClose = () => navigate(-1); | ||
|
||
const mainContent = <AppBarMainContent selectedSpecies={selectedSpecies} />; | ||
|
||
const appName = <AppName>Species Selector</AppName>; | ||
|
||
return ( | ||
<AppBar | ||
topLeft={appName} | ||
topRight={<SpeciesManagerIndicator mode="close" onClose={onClose} />} | ||
mainContent={mainContent} | ||
aside={<HelpPopupButton slug="species-selector-intro" />} | ||
/> | ||
); | ||
}; | ||
|
||
const AppBarMainContent = (props: { selectedSpecies: CommittedItem[] }) => { | ||
const selectedSpecies = props.selectedSpecies.map((species) => ( | ||
<SpeciesLozenge | ||
key={species.genome_id} | ||
species={species} | ||
theme="grey" | ||
disabled={true} | ||
/> | ||
)); | ||
|
||
return ( | ||
<div> | ||
<SpeciesTabsSlider>{selectedSpecies}</SpeciesTabsSlider> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SpeciesManagerAppBar; |
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
Oops, something went wrong.