Skip to content

Commit

Permalink
Update DAJ unit name display to last item
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Jézégou authored and AdJez committed Jan 25, 2024
1 parent 6f30335 commit 419f8d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useReferralAction } from 'data';
import { Referral, Unit } from 'types';
import { AssignUnitModal } from './AssignUnitModal';
import { ReferralContext } from '../../data/providers/ReferralProvider';
import { getLastItem } from '../../utils/string';

const messages = defineMessages({
assignIt: {
Expand Down Expand Up @@ -84,7 +85,7 @@ export const ReferralUnitAssignmentButton: React.FC<ReferralUnitAssignmentButton
className="truncate"
style={{ maxWidth: 'calc(100% - 1.5rem)' }}
>
{unit.name}
{getLastItem(unit.name, '/')}
</div>
</div>
{mutation.isLoading ? null : <Tickbox isTicked={isAssigned} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ export const ReferralDetailAssignmentUnits: React.FC<ReferralDetailAssignmentUni
{referral.units.map((unit, index) => (
<React.Fragment key={unit.id}>
{index > 0 && ', '}
{unit.name}
{getLastItem(unit.name, '/')}
</React.Fragment>
))}
</span>
Expand Down
5 changes: 4 additions & 1 deletion src/frontend/js/components/modals/ValidationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { kebabCase } from 'lodash-es';
import { useVersionValidatorsAction } from '../../data/versions';
import { sortObject } from '../../utils/object';
import { commonMessages } from '../../const/translations';
import { getLastItem } from '../../utils/string';

const messages = defineMessages({
mainTitle: {
Expand Down Expand Up @@ -270,7 +271,9 @@ export const ValidationModal = ({
<CheckIcon className="fill-black" />
</div>
<div className="flex flex-col">
<p className="text-base">{unitName}</p>
<p className="text-base">
{getLastItem(unitName, '/')}
</p>
<div className="flex items-center justify-start w-full space-x-2">
{members.map((member: any) => (
<div
Expand Down

0 comments on commit 419f8d6

Please sign in to comment.