Skip to content
5 changes: 5 additions & 0 deletions .changeset/real-grapes-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Tag input visibility is now consistent with the setting for requesting tags before closing conversations, allowing users to remove tags anytime.
Original file line number Diff line number Diff line change
Expand Up @@ -414,33 +414,32 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen
</FieldRow>
</Field>

{requestTagBeforeClosingChat && (
<Field>
<FieldLabel htmlFor={chatClosingTagsField} required>
{t('Conversation_closing_tags')}
</FieldLabel>
<Controller
control={control}
name='chatClosingTags'
rules={{ required: t('Required_field', 'tags') }}
render={({ field: { value, onChange } }) => (
<DepartmentTags
id={chatClosingTagsField}
value={value}
onChange={onChange}
error={errors.chatClosingTags?.message as string}
aria-describedby={`${chatClosingTagsField}-hint ${chatClosingTagsField}-error`}
/>
)}
/>
<FieldHint id={`${chatClosingTagsField}-hint`}>{t('Conversation_closing_tags_description')}</FieldHint>
{errors.chatClosingTags && (
<FieldError aria-live='assertive' id={`${chatClosingTagsField}-error`}>
{errors.chatClosingTags?.message}
</FieldError>
<Field>
<FieldLabel htmlFor={chatClosingTagsField} required={requestTagBeforeClosingChat}>
{t('Conversation_closing_tags')}
</FieldLabel>
<Controller
control={control}
name='chatClosingTags'
rules={{ required: requestTagBeforeClosingChat && t('Required_field', { field: 'tags' }) }}
render={({ field: { value, onChange } }) => (
<DepartmentTags
id={chatClosingTagsField}
value={value}
onChange={onChange}
error={errors.chatClosingTags?.message as string}
aria-describedby={`${chatClosingTagsField}-hint ${chatClosingTagsField}-error`}
disabled={!requestTagBeforeClosingChat}
/>
)}
</Field>
)}
/>
<FieldHint id={`${chatClosingTagsField}-hint`}>{t('Conversation_closing_tags_description')}</FieldHint>
{errors.chatClosingTags && (
<FieldError aria-live='assertive' id={`${chatClosingTagsField}-error`}>
{errors.chatClosingTags?.message}
</FieldError>
)}
</Field>

<Field>
<FieldRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,13 @@ test.describe('OC - Manage Departments', () => {
await expect(poOmnichannelDepartments.toggleRequestTags).toBeVisible();
});

await test.step('expect have no add tag to department', async () => {
await expect(poOmnichannelDepartments.inputTags).not.toBeVisible();
await expect(poOmnichannelDepartments.btnTagsAdd).not.toBeVisible();
await test.step('expect tag input to be visible but disabled', async () => {
await expect(poOmnichannelDepartments.inputTags).toBeVisible();
await expect(poOmnichannelDepartments.btnTagsAdd).toBeVisible();

await expect(poOmnichannelDepartments.inputTags).toBeDisabled();
await expect(poOmnichannelDepartments.btnTagsAdd).toBeDisabled();

await poOmnichannelDepartments.btnBack.click();
});
});
Expand All @@ -244,8 +248,8 @@ test.describe('OC - Manage Departments', () => {

await test.step('expect clicking on toggle button to enable tags', async () => {
await poOmnichannelDepartments.toggleRequestTags.click();
await expect(poOmnichannelDepartments.inputTags).toBeVisible();
await expect(poOmnichannelDepartments.btnTagsAdd).toBeVisible();

await expect(poOmnichannelDepartments.inputTags).toBeEnabled();
});

await test.step('expect to have add and remove one tag properly tags', async () => {
Expand Down
Loading