Skip to content

Commit

Permalink
fix(handler): remove unnecessary restrictions for new messages or not…
Browse files Browse the repository at this point in the history
…es (#3231)
  • Loading branch information
sirtawast authored Sep 4, 2024
1 parent 38c2b66 commit f85cb31
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,6 @@ const HandlingApplicationActions: React.FC<Props> = ({
)}
<Sidebar
isOpen={isMessagesDrawerVisible}
messagesReadOnly={
application.status &&
application.status === APPLICATION_STATUSES.CANCELLED
}
application={application}
onClose={toggleMessagesDrawerVisibility}
customItemsMessages={[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import Sidebar from 'benefit/handler/components/sidebar/Sidebar';
import {
APPLICATION_LIST_TABS,
HANDLED_STATUSES,
} from 'benefit/handler/constants';
import { APPLICATION_LIST_TABS } from 'benefit/handler/constants';
import { APPLICATION_STATUSES } from 'benefit-shared/constants';
import { Application } from 'benefit-shared/types/application';
import {
Expand Down Expand Up @@ -376,10 +373,6 @@ const HandlingApplicationActions: React.FC<Props> = ({
<Sidebar
application={application}
isOpen={isMessagesDrawerVisible}
messagesReadOnly={
isApplicationReadOnly ||
(application.status && HANDLED_STATUSES.includes(application.status))
}
onClose={toggleMessagesDrawerVisibility}
customItemsMessages={[
<EditAction application={application} key="edit" />,
Expand Down
19 changes: 7 additions & 12 deletions frontend/benefit/handler/src/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { useSidebar } from './useSidebar';
interface ComponentProps {
isOpen: boolean;
messagesReadOnly?: boolean;
notesReadOnly?: boolean;
onClose?: () => void;
customItemsMessages?: Array<React.ReactNode>;
customItemsNotes?: Array<React.ReactNode>;
Expand All @@ -24,7 +23,6 @@ interface ComponentProps {
const Sidebar: React.FC<ComponentProps> = ({
isOpen,
messagesReadOnly,
notesReadOnly,
customItemsMessages,
customItemsNotes,
onClose,
Expand Down Expand Up @@ -109,16 +107,13 @@ const Sidebar: React.FC<ComponentProps> = ({
flex-grow: 1;
`}
>
{!notesReadOnly && (
<Actions
customItems={customItemsNotes}
sendText={t('common:messenger.save')}
errorText={t('common:form.validation.string.max', { max: 1024 })}
placeholder={t('common:messenger.composeNote')}
onSend={handleCreateNote}
/>
)}

<Actions
customItems={customItemsNotes}
sendText={t('common:messenger.save')}
errorText={t('common:form.validation.string.max', { max: 1024 })}
placeholder={t('common:messenger.composeNote')}
onSend={handleCreateNote}
/>
<Messages data={notes?.reverse()} variant="note" />
</TabPanel>
<TabPanel
Expand Down

0 comments on commit f85cb31

Please sign in to comment.