Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/features/amUI/common/InstanceList/InstanceList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,22 @@ const noDialogLookup: InstanceDelegation = {
permissions: [],
};

const longServiceTitle: InstanceDelegation = {
resource: {
...digdirResource,
identifier: 'digdir-informasjonsmelding-modernisering',
title: 'Informasjonsmelding i forbindelse med modernisering av tilgangsstyring i Altinn',
},
instance: { refId: 'urn:altinn:instance-id:pqr6789012', type: null },
permissions: [],
dialogLookup: {
status: 'Success',
dialogId: 'df333e75-0000-0000-0000-000000000002',
instanceRef: 'urn:altinn:instance-id:pqr6789012',
title: [{ languageCode: 'nb', value: 'Gi fullmakt til tilgangspakker i nye Altinn' }],
},
};

const Wrapper = ({ children }: { children: ReactNode }) => (
<Provider store={store}>
<RootProvider>{children}</RootProvider>
Expand Down Expand Up @@ -106,10 +122,16 @@ export const AllTitleCases: Story = {
dialogNotFoundCorrespondence,
dialogForbidden,
noDialogLookup,
longServiceTitle,
],
},
};

export const Mobile: Story = {
args: { instances: [longServiceTitle, dialogSuccess] },
globals: { viewport: { value: 'mobile1', isRotated: false } },
};

export const Loading: Story = {
args: { instances: [], isLoading: true },
};
Expand Down
12 changes: 6 additions & 6 deletions src/features/amUI/common/InstanceList/InstanceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,17 @@ export const InstanceList = ({
const item: DialogListItemProps = {
id: instanceRowId(instanceDelegation),
title,
description: `${instance.refId} ${title}`,
sender: {
name: resource.resourceOwnerName ?? '',
type: 'company',
imageUrl: providerLogoUrl ?? resource.resourceOwnerLogoUrl ?? undefined,
imageUrlAlt: resource.resourceOwnerName ?? '',
},
updatedAt: instance.refId,
updatedAtLabel: `${t('instance.instance_id_label')}: ${getInstanceShortId(instance.refId)}`,
extendedStatusLabel: serviceTitle
? `${t('instance.service_title_label')}: ${serviceTitle}`
: undefined,
summary:
serviceTitle && serviceTitle !== title
? `${t('instance.service_title_label')}: ${serviceTitle}`
: undefined,
extendedStatusLabel: `${t('instance.instance_id_label')}: ${getInstanceShortId(instance.refId)}`,
};
const Component = getItemAs?.(instanceDelegation);
const className =
Expand All @@ -131,6 +130,7 @@ export const InstanceList = ({
<InstanceListItemRow
key={item.id}
size='md'
color='neutral'
as={Component ?? (onSelect ? 'button' : undefined)}
interactive={interactive || !!onSelect}
onClick={onSelect ? () => onSelect(instanceDelegation) : undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export const InstanceListSkeleton = () => {
const item: DialogListItemProps = {
id: `instance-loading-${index}`,
title: 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
description: 'xxxxxxxxx',
sender: {
name: 'xxxxxxxxx',
type: 'company',
},
summary: 'xxxxxxxxxxxxxxxxxxx',
Comment thread
coderabbitai[bot] marked this conversation as resolved.
updatedAt: 'xxxxxxxxxx',
updatedAtLabel: 'xxxxxxxxxx',
};
Expand All @@ -20,6 +20,7 @@ export const InstanceListSkeleton = () => {
<DialogListItem
key={item.id}
size='md'
color='neutral'
loading={true}
{...item}
/>
Expand Down
Loading