-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/deseng666 Add new Engagement Details page #2574
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2209bc0
DESENG-666 Add new engagement view and preserve old one in hidden route
Baelx 899991d
Merge branch 'main' into feature/deseng666
Baelx 3d0cc69
DESENG-666 merge main and update changelog
Baelx 1d86b4b
DESENG-666 Remove unused directories, update paths
Baelx a7d5371
DESENG-666 Fix test issues
Baelx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,37 @@ | ||
import React, { Suspense } from 'react'; | ||
import { useLoaderData, Await } from 'react-router-dom'; | ||
import { Engagement } from 'models/engagement'; | ||
import { AutoBreadcrumbs } from 'components/common/Navigation/Breadcrumb'; | ||
import { EngagementStatus } from 'constants/engagementStatus'; | ||
import { Theme, useMediaQuery } from '@mui/material'; | ||
|
||
export const AdminEngagementView = () => { | ||
const { engagement } = useLoaderData() as { engagement: Promise<Engagement> }; | ||
const isMediumScreenOrLarger: boolean = useMediaQuery((theme: Theme) => theme.breakpoints.up('md')); | ||
|
||
return ( | ||
<div style={{ marginTop: '3.125rem', padding: isMediumScreenOrLarger ? '0' : '0 1rem' }}> | ||
<AutoBreadcrumbs /> | ||
<Suspense> | ||
<Await resolve={engagement}> | ||
{(engagement: Engagement) => ( | ||
<div style={{ marginTop: '2rem' }}> | ||
<span | ||
style={{ | ||
background: '#CE3E39', | ||
padding: '0.2rem 0.75rem', | ||
color: 'white', | ||
borderRadius: '3px', | ||
fontSize: '0.8rem', | ||
}} | ||
> | ||
{EngagementStatus[engagement?.status_id]} | ||
</span> | ||
<h1 style={{ marginTop: '0.5rem' }}>{engagement?.name}</h1> | ||
</div> | ||
)} | ||
</Await> | ||
</Suspense> | ||
</div> | ||
); | ||
}; |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,8 @@ import { Params, defer, Navigate, Route } from 'react-router-dom'; | |
import NotFound from './NotFound'; | ||
import EngagementForm from '../components/engagement/form'; | ||
import EngagementListing from '../components/engagement/listing'; | ||
import EngagementView from '../components/engagement/view'; | ||
import { Engagement as OldEngagementView } from '../components/engagement/old-view'; | ||
import { AdminEngagementView } from 'components/engagement/admin/view'; | ||
import SurveyListing from 'components/survey/listing'; | ||
import CreateSurvey from 'components/survey/create'; | ||
import SurveyFormBuilder from 'components/survey/building'; | ||
|
@@ -29,13 +30,14 @@ import TenantEditPage from 'components/tenantManagement/Edit'; | |
import TenantDetail from 'components/tenantManagement/Detail'; | ||
import Language from 'components/language'; | ||
import { Tenant } from 'models/tenant'; | ||
import { Engagement } from 'models/engagement'; | ||
import { getAllTenants, getTenant } from 'services/tenantService'; | ||
import { engagementLoader, engagementListLoader } from 'components/engagement/new/view'; | ||
import { engagementLoader, engagementListLoader } from 'components/engagement/public/view'; | ||
import { SurveyLoader } from 'components/survey/building/SurveyLoader'; | ||
import { languageLoader } from 'components/engagement/new/create/languageLoader'; | ||
import { languageLoader } from 'components/engagement/admin/create/languageLoader'; | ||
import { userSearchLoader } from 'components/userManagement/userSearchLoader'; | ||
import EngagementCreationWizard from 'components/engagement/new/create'; | ||
import engagementCreateAction from 'components/engagement/new/create/engagementCreateAction'; | ||
import EngagementCreationWizard from 'components/engagement/admin/create'; | ||
import engagementCreateAction from 'components/engagement/admin/create/engagementCreateAction'; | ||
|
||
const AuthenticatedRoutes = () => { | ||
return ( | ||
|
@@ -89,12 +91,27 @@ const AuthenticatedRoutes = () => { | |
<Route element={<AuthGate allowedRoles={[USER_ROLES.EDIT_ENGAGEMENT]} />}> | ||
<Route path="form" element={<EngagementForm />} /> | ||
</Route> | ||
<Route path="view" element={<EngagementView />} /> | ||
<Route path="old-view" element={<OldEngagementView />} /> | ||
<Route | ||
path="view" | ||
loader={engagementLoader} | ||
handle={{ | ||
crumb: async (data: { engagement: Promise<Engagement> }) => { | ||
return data.engagement.then((engagement) => { | ||
return { | ||
link: `/engagements/${engagement.id}/view`, | ||
name: engagement.name, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nicely done with the breadcrumb function :) |
||
}; | ||
}); | ||
}, | ||
}} | ||
element={<AdminEngagementView />} | ||
/> | ||
<Route path="comments/:dashboardType" element={<EngagementComments />} /> | ||
<Route path="dashboard/:dashboardType" element={<PublicDashboard />} /> | ||
</Route> | ||
<Route path=":slug"> | ||
<Route index element={<EngagementView />} /> | ||
<Route index element={<OldEngagementView />} /> | ||
<Route path="comments/:dashboardType" element={<EngagementComments />} /> | ||
<Route path="dashboard/:dashboardType" element={<PublicDashboard />} /> | ||
</Route> | ||
|
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for making this a11y improvement :3