-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved layout of project searched items, started implementing searc…
…h header, implemented edit route (not editing yet), implemented gql mutation for deleting projects (no deleting yet)
- Loading branch information
Showing
22 changed files
with
356 additions
and
78 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
src/api/src/graphql/resolvers/mutations/delete-project/index.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,9 @@ | ||
/** | ||
* Set project and all child entities to have deletedAt = new Date()... etc. | ||
* return the project | ||
*/ | ||
|
||
// eslint-disable-next-line | ||
export default async (_, args, ctx) => { | ||
throw new Error('TODO') | ||
} |
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
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
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,114 @@ | ||
import { useQuery, gql } from '@apollo/client' | ||
import Loading from '../../components/loading' | ||
import Card from '@material-ui/core/Card' | ||
import CardContent from '@material-ui/core/CardContent' | ||
import useTheme from '@material-ui/core/styles/useTheme' | ||
|
||
export default ({ id }) => { | ||
const theme = useTheme() | ||
const { error, loading, data } = useQuery( | ||
gql` | ||
query projects($ids: [Int!]) { | ||
projects(ids: $ids) { | ||
id | ||
title | ||
description | ||
projectManager | ||
link | ||
startDate | ||
endDate | ||
validationComments | ||
fundingOrganisation | ||
fundingPartner | ||
budgetLower | ||
budgetUpper | ||
hostOrganisation | ||
hostPartner | ||
alternativeContact | ||
alternativeContactEmail | ||
leadAgent | ||
interventionType | ||
projectStatus | ||
validationStatus | ||
fundingStatus | ||
estimatedBudget | ||
hostSector | ||
hostSubSector | ||
province | ||
districtMunicipality | ||
localMunicipality | ||
mitigations { | ||
id | ||
title | ||
description | ||
carbonCredit | ||
volMethodology | ||
goldStandard | ||
vcs | ||
yx | ||
otherCarbonCreditStandard | ||
otherCarbonCreditStandardDescription | ||
cdmProjectNumber | ||
cdmStatus | ||
isResearch | ||
researchDescription | ||
energyOrEmissionsData | ||
energyData | ||
emissionsData | ||
researchType | ||
researchTargetAudience | ||
researchAuthor | ||
researchPaper | ||
mitigationType | ||
mitigationSubType | ||
interventionStatus | ||
cdmMethodology | ||
cdmExecutiveStatus | ||
hostSector | ||
hostSubSectorPrimary | ||
hostSubSectorSecondary | ||
} | ||
adaptations { | ||
id | ||
title | ||
description | ||
startDate | ||
endDate | ||
yx | ||
isResearch | ||
interventionStatus | ||
researchDescription | ||
researchType | ||
researchTargetAudience | ||
researchAuthor | ||
researchPaper | ||
adaptationSector | ||
adaptationPurpose | ||
hazardFamily | ||
hazardSubFamily | ||
hazard | ||
subHazard | ||
} | ||
} | ||
} | ||
`, | ||
{ variables: { ids: [parseInt(id, 10)] } } | ||
) | ||
|
||
if (loading) { | ||
return <Loading /> | ||
} | ||
|
||
if (error) { | ||
throw error | ||
} | ||
|
||
return ( | ||
<Card style={{ backgroundColor: theme.backgroundColor }} variant="outlined"> | ||
<CardContent> | ||
<h1>Edit page</h1> | ||
<pre>{JSON.stringify(data, null, 2)}</pre> | ||
</CardContent> | ||
</Card> | ||
) | ||
} |
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,16 @@ | ||
import DownloadIcon from 'mdi-react/DownloadIcon' | ||
import Button from '@material-ui/core/Button' | ||
|
||
export default () => { | ||
return ( | ||
<Button | ||
disableElevation | ||
size="small" | ||
variant="contained" | ||
color="primary" | ||
startIcon={<DownloadIcon size={18} />} | ||
> | ||
Download data | ||
</Button> | ||
) | ||
} |
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,19 @@ | ||
import SubmitIcon from 'mdi-react/DatabasePlusIcon' | ||
import Button from '@material-ui/core/Button' | ||
import { Link } from 'react-router-dom' | ||
|
||
export default () => { | ||
return ( | ||
<Button | ||
component={Link} | ||
to="/projects/submission" | ||
disableElevation | ||
size="small" | ||
variant="contained" | ||
color="primary" | ||
startIcon={<SubmitIcon size={18} />} | ||
> | ||
Submit project | ||
</Button> | ||
) | ||
} |
Oops, something went wrong.