-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: campaign application admin init (#1867)
* feat: campaign application admin init - issue #1842 - add a admin space for the campaign applications - only skeleton - will be fleshed out iteratively - add admin edit campaign application - it will show all the steps of the stepper (create campaign application) with addition of the admin-only editable stuff * Update EditPage.tsx * fix: linting for campaign application admin edit
- Loading branch information
Showing
8 changed files
with
98 additions
and
4 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
26 changes: 26 additions & 0 deletions
26
src/components/admin/campaign-applications/CampaignApplications.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,26 @@ | ||
import { useTranslation } from 'next-i18next' | ||
|
||
import EditOutlinedIcon from '@mui/icons-material/EditOutlined' | ||
import { IconButton } from '@mui/material' | ||
import { routes } from 'common/routes' | ||
import AdminContainer from 'components/common/navigation/AdminContainer' | ||
import AdminLayout from 'components/common/navigation/AdminLayout' | ||
import Link from 'next/link' | ||
|
||
export default function CampaignApplicationsPage() { | ||
const { t } = useTranslation('campaigns') | ||
|
||
return ( | ||
<AdminLayout> | ||
<AdminContainer title={t('Кандидат Кампании')}> | ||
<div>Campaigns will appear here</div> | ||
<Link href={routes.admin.campaignApplications.edit('mock-id')} passHref> | ||
<IconButton size="small" color="primary"> | ||
<EditOutlinedIcon /> | ||
takes you to edit page | ||
</IconButton> | ||
</Link> | ||
</AdminContainer> | ||
</AdminLayout> | ||
) | ||
} |
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,36 @@ | ||
import { CampaignApplicationFormData } from 'components/client/campaign-application/helpers/campaignApplication.types' | ||
import CampaignApplication from 'components/client/campaign-application/steps/CampaignApplication' | ||
import CampaignApplicationDetails from 'components/client/campaign-application/steps/CampaignApplicationDetails' | ||
import CampaignApplicationOrganizer from 'components/client/campaign-application/steps/CampaignApplicationOrganizer' | ||
import GenericForm from 'components/common/form/GenericForm' | ||
import AdminContainer from 'components/common/navigation/AdminContainer' | ||
import AdminLayout from 'components/common/navigation/AdminLayout' | ||
|
||
export default function EditPage() { | ||
const initialValues = { | ||
organizer: { | ||
name: '', | ||
phone: '', | ||
email: '', | ||
}, | ||
} as CampaignApplicationFormData | ||
|
||
return ( | ||
<AdminLayout> | ||
<AdminContainer title={'Кандидат Кампании'}> | ||
Will layout all the steps from the stepper plus the admin step | ||
<GenericForm<CampaignApplicationFormData> | ||
onSubmit={(v) => console.log(v)} | ||
initialValues={initialValues}> | ||
<CampaignApplicationOrganizer /> | ||
</GenericForm> | ||
<div>.</div> | ||
<CampaignApplication /> | ||
<div>.</div> | ||
<CampaignApplicationDetails /> | ||
<div>.</div> | ||
Edit the status and ticket URL here | ||
</AdminContainer> | ||
</AdminLayout> | ||
) | ||
} |
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,7 @@ | ||
import EditPage from 'components/admin/campaign-applications/EditPage' | ||
|
||
import { securedPropsWithTranslation } from 'middleware/auth/securedProps' | ||
|
||
export const getServerSideProps = securedPropsWithTranslation() | ||
|
||
export default EditPage |
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 CampaignApplications from 'components/admin/campaign-applications/CampaignApplications' | ||
import { securedPropsWithTranslation } from 'middleware/auth/securedProps' | ||
|
||
export const getServerSideProps = securedPropsWithTranslation() | ||
|
||
export default CampaignApplications |