Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Replaces outdated retention policy warning in favor of Bubble #33044

Merged
merged 3 commits into from
Aug 14, 2024
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
5 changes: 5 additions & 0 deletions .changeset/large-geese-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': minor
---

Replaces an outdated banner with the Bubble component in order to display retention policy warning
15 changes: 0 additions & 15 deletions apps/meteor/app/theme/client/imports/general/base_old.css
Original file line number Diff line number Diff line change
Expand Up @@ -776,21 +776,6 @@
padding: 21px 0 10px;
}

& .start {
margin-top: 44px;

text-align: center;

& .start__purge-warning {
margin-top: -33px;
margin-bottom: 0.5rem;
padding: 1rem;

border-width: 1px 0 0;
background: linear-gradient(to bottom, var(--rc-color-alert-message-warning-background) 0%, rgba(255, 255, 255, 0) 100%);
}
}

& .editing .body {
border-radius: var(--border-radius);
}
Expand Down
15 changes: 6 additions & 9 deletions apps/meteor/client/views/room/body/RetentionPolicyWarning.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IRoom } from '@rocket.chat/core-typings';
import { Icon } from '@rocket.chat/fuselage';
import { Bubble, MessageDivider } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import React from 'react';
Expand All @@ -13,14 +13,11 @@ const RetentionPolicyWarning = ({ room }: { room: IRoom }): ReactElement => {
const message = usePruneWarningMessage(room);

return (
<div
aria-label={t('Retention_policy_warning_banner')}
role='alert'
aria-live='polite'
className='start__purge-warning error-background error-border error-color'
>
<Icon name='warning' size='x20' /> {message}
</div>
<MessageDivider>
<Bubble role='alert' aria-live='polite' aria-label={t('Retention_policy_warning_banner')} small secondary>
{message}
</Bubble>
</MessageDivider>
);
};

Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/room/body/RoomBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ const RoomBody = (): ReactElement => {
{hasMorePreviousMessages ? (
<li className='load-more'>{isLoadingMoreMessages ? <LoadingMessagesIndicator /> : null}</li>
) : (
<li className='start color-info-font-color'>
{retentionPolicy?.isActive ? <RetentionPolicyWarning room={room} /> : null}
<li>
<RoomForeword user={user} room={room} />
{retentionPolicy?.isActive ? <RetentionPolicyWarning room={room} /> : null}
</li>
)}
</>
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/room/body/RoomBodyV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ const RoomBody = (): ReactElement => {
{hasMorePreviousMessages ? (
<li className='load-more'>{isLoadingMoreMessages ? <LoadingMessagesIndicator /> : null}</li>
) : (
<li className='start color-info-font-color'>
{retentionPolicy?.isActive ? <RetentionPolicyWarning room={room} /> : null}
<li>
<RoomForeword user={user} room={room} />
{retentionPolicy?.isActive ? <RetentionPolicyWarning room={room} /> : null}
</li>
)}
</>
Expand Down
Loading