-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ulam): Refactor ulam component to use new changes
- new hook for timeline - action registry and header
- Loading branch information
1 parent
b812177
commit f09b51e
Showing
12 changed files
with
283 additions
and
108 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
15 changes: 13 additions & 2 deletions
15
frontend/src/v2/features/ulam/components/element/mission-timeline-header-ulam.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 |
---|---|---|
@@ -1,13 +1,24 @@ | ||
import { FC } from 'react' | ||
import { ModuleType } from '../../../../features/common/types/module-type' | ||
import { useNavigate } from 'react-router-dom' | ||
import MissionTimelineHeaderWrapper from '../../../../features/mission-timeline/components/layout/mission-timeline-Header-wrapper' | ||
import { useUlamTimelineRegistry } from '../../hooks/use-ulam-timeline-registry' | ||
|
||
interface MissionTimelineHeaderUlamProps { | ||
missionId: number | ||
} | ||
|
||
const MissionTimelineHeaderUlam: FC<MissionTimelineHeaderUlamProps> = ({ missionId }) => { | ||
return <MissionTimelineHeaderWrapper missionId={missionId} moduleType={ModuleType.ULAM} hideStatus={true} /> | ||
const navigate = useNavigate() | ||
const { timelineDropdownItems } = useUlamTimelineRegistry() | ||
const handleOnSubmit = (id?: string) => navigate(`/v2/ulam/missions/${missionId}/${id}`) | ||
return ( | ||
<MissionTimelineHeaderWrapper | ||
hideStatus={true} | ||
missionId={missionId} | ||
onSubmit={handleOnSubmit} | ||
dropdownItems={timelineDropdownItems} | ||
/> | ||
) | ||
} | ||
|
||
export default MissionTimelineHeaderUlam |
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
10 changes: 0 additions & 10 deletions
10
frontend/src/v2/features/ulam/hooks/use-crew-for-mission-list.tsx
This file was deleted.
Oops, something went wrong.
7 changes: 4 additions & 3 deletions
7
frontend/src/v2/features/ulam/hooks/use-ulam-action-registry.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
9 changes: 9 additions & 0 deletions
9
frontend/src/v2/features/ulam/hooks/use-ulam-crew-for-mission-list.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,9 @@ | ||
import { MissionCrew } from '@common/types/crew-types.ts' | ||
|
||
export function useUlamCrewForMissionList(missionCrew?: MissionCrew[]): { text: string; style?: object } { | ||
const result = missionCrew?.length | ||
? missionCrew.map(crew => `${crew.agent?.firstName ?? ''} ${crew.agent?.lastName ?? ''}`.trim()).join(', ') | ||
: '--' | ||
|
||
return { text: result } | ||
} |
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.