Skip to content

Commit

Permalink
fix: Updated according to PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdigdir committed Sep 24, 2024
1 parent aa651d8 commit cbe1b9b
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/frontend/src/api/useDialogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function mapDialogDtoToInboxItem(
id: item.id,
party: item.party,
title: getPropertyByCultureCode(titleObj),
description: getPropertyByCultureCode(summaryObj),
summary: getPropertyByCultureCode(summaryObj),
sender: {
name: serviceOwner?.name ?? '',
isCompany: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/Header/SearchDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const SearchDropdown: React.FC<SearchDropdownProps> = ({ showDropdownMenu
key={item.id}
checkboxValue={item.id}
title={item.title}
description={item.description}
summary={item.summary}
sender={item.sender}
receiver={item.receiver}
metaFields={item.metaFields}
Expand Down
14 changes: 7 additions & 7 deletions packages/frontend/src/components/InboxItem/InboxItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import styles from './inboxItem.module.css';
interface InboxItemProps {
checkboxValue: string;
title: string;
description: string;
summary: string;
sender: Participant;
receiver: Participant;
isChecked?: boolean;
Expand Down Expand Up @@ -50,15 +50,15 @@ export const OptionalLinkContent = ({

/**
* Represents an individual inbox item, displaying information such as the title,
* description, sender, and receiver, along with optional tags. It includes a checkbox
* summary, sender, and receiver, along with optional tags. It includes a checkbox
* to mark the item as checked/unchecked and can visually indicate if it is unread.
* Should only be used as child of InboxItems
*
* @component
* @param {Object} props - The properties passed to the component.
* @param {string} props.checkboxValue - The value attribute for the checkbox input.
* @param {string} props.title - The title of the inbox item.
* @param {string} props.description - The description or content of the inbox item.
* @param {string} props.summary - The summary or content of the inbox item.
* @param {Participant} props.sender - The sender of the inbox item, including label and optional icon.
* @param {Participant} props.receiver - The receiver of the inbox item, including label and optional icon.
* @param {boolean} props.isChecked - Whether the inbox item is checked. This can support batch operations.
Expand All @@ -72,7 +72,7 @@ export const OptionalLinkContent = ({
* <InboxItem
* checkboxValue="item1"
* title="Meeting Reminder"
* description="Don't forget the meeting tomorrow at 10am."
* summary="Don't forget the meeting tomorrow at 10am."
* sender={{ label: "Alice", icon: <MailIcon /> }}
* receiver={{ label: "Bob", icon: <PersonIcon /> }}
* isChecked={false}
Expand All @@ -83,7 +83,7 @@ export const OptionalLinkContent = ({
*/
export const InboxItem = ({
title,
description,
summary,
sender,
receiver,
metaFields = [],
Expand Down Expand Up @@ -149,7 +149,7 @@ export const InboxItem = ({
/>
)}
</header>
<p className={styles.description}>{description}</p>
<p className={styles.summary}>{summary}</p>
</section>
</OptionalLinkContent>
</div>
Expand Down Expand Up @@ -209,7 +209,7 @@ export const InboxItem = ({
<span className={styles.participantLabel}>{`${t('word.to')} ${receiver?.name}`}</span>
</div>
</div>
<p className={styles.description}>{description}</p>
<p className={styles.summary}>{summary}</p>
<MetaDataFields metaFields={metaFields || []} viewType={viewType} />
</section>
</OptionalLinkContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ interface InboxItemDetailProps {
}

/**
* Displays detailed information about an inbox item, including title, description, sender, receiver, attachments, tags, and GUI actions.
* Displays detailed information about an inbox item, including title, summary, sender, receiver, attachments, tags, and GUI actions.
* This component is intended to be used for presenting a full view of an inbox item, with comprehensive details not shown in the summary view.
* It supports rendering both text and React node descriptions, and dynamically lists attachments with links.
* It supports rendering both text and React node summarys, and dynamically lists attachments with links.
* Dynamically rendered action buttons are implemented through the `GuiActions` component.
*
* @component
Expand Down Expand Up @@ -48,7 +48,7 @@ export const InboxItemDetail = ({ dialog }: InboxItemDetailProps): JSX.Element =
<header className={styles.header} data-id="dialog-header">
<h1 className={styles.title}>{t('error.dialog.not_found')}</h1>
</header>
<p className={styles.description}>{t('dialog.error_message')}</p>
<p className={styles.summary}>{t('dialog.error_message')}</p>
</section>
);
}
Expand Down Expand Up @@ -87,7 +87,7 @@ export const InboxItemDetail = ({ dialog }: InboxItemDetailProps): JSX.Element =
<span className={styles.participantLabel}>{receiver?.name}</span>
</div>
</div>
<div className={styles.sectionWithStatus} data-id="dialog-description">
<div className={styles.sectionWithStatus} data-id="dialog-summary">
<p className={styles.createdLabel}>{format(createdAt, 'do MMMM yyyy HH:mm')}</p>
<p className={styles.summary}>{summary}</p>
<MainContentReference args={mainContentReference} dialogToken={dialogToken} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
}
}

.description {
.summary {
color: #000;
font-size: 1rem;
font-weight: 400;
Expand All @@ -136,7 +136,7 @@
margin-bottom: 1rem;
}

.minimalistic .description {
.minimalistic .summary {
color: rgba(0, 0, 0, 0.75);
font-size: 12px;
font-style: normal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
flex-direction: column;
background: #fff;
padding: 16px;
padding: 1rem;
}

@media (max-width: 1024px) {
Expand Down Expand Up @@ -167,10 +167,11 @@
}

.attachmentIcon {
min-height: 1.25rem;
min-width: 1.25rem;
max-height: 1.25rem;
max-width: 1.25rem;
--icon-size: 1.25rem;
min-height: var(--icon-size);
min-width: var(--icon-size);
max-height: var(--icon-size);
max-width: var(--icon-size);
}

.attachmentItemIcon {
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/pages/Inbox/Inbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface InboxItemInput {
id: string;
party: string;
title: string;
description: string;
summary: string;
sender: Participant;
receiver: Participant;
metaFields: InboxItemMetaField[];
Expand Down Expand Up @@ -336,7 +336,7 @@ export const Inbox = ({ viewType }: InboxProps) => {
key={item.id}
checkboxValue={item.id}
title={item.title}
description={item.description}
summary={item.summary}
sender={item.sender}
receiver={item.receiver}
isChecked={selectedItems[item.id]}
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/pages/Inbox/InboxSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export const InboxSkeleton: React.FC<InboxSkeletonProps> = ({
<Skeleton.Text width="400px" height="24px" />
</h2>
</header>
<Skeleton.Text width="40%" height="36px" className={styles.description} />
<Skeleton.Text width="100%" className={styles.description} />
<Skeleton.Text width="40%" height="36px" className={styles.summary} />
<Skeleton.Text width="100%" className={styles.summary} />
<div className={styles.participants}>
<div className={styles.sender}>
<span>
Expand Down

0 comments on commit cbe1b9b

Please sign in to comment.