-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Update breadcrumb * Admin header updates * Responsive styling * Move system/contract name function to util * Updated additional information text * Util filename update
- Loading branch information
1 parent
43944b3
commit fe5edd0
Showing
6 changed files
with
72 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import i18next from 'i18next'; | ||
|
||
import { SystemIntake_systems as System } from 'queries/types/SystemIntake'; | ||
import { RequestRelationType } from 'types/graphql-global-types'; | ||
|
||
/** Returns linked contract or system name for display */ | ||
const getSystemOrContractName = ( | ||
relationType: RequestRelationType | null, | ||
contractName: string | null, | ||
systems: System[] | ||
) => { | ||
if (relationType === RequestRelationType.EXISTING_SERVICE && contractName) { | ||
return contractName; | ||
} | ||
|
||
if (relationType === RequestRelationType.EXISTING_SYSTEM) { | ||
if (systems.length === 1) { | ||
return systems[0].name; | ||
} | ||
|
||
// If more than one system, returns `[name], +[count]` | ||
return i18next.t('governanceReviewTeam:systemNamePlural', { | ||
name: systems[0].name, | ||
count: systems.length - 1 | ||
}); | ||
} | ||
|
||
return i18next.t('governanceReviewTeam:noneSpecified'); | ||
}; | ||
|
||
export default getSystemOrContractName; |
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