From ae705bc2458808fe1b842e14eb188702ee07a72e Mon Sep 17 00:00:00 2001 From: Ali <83188384+testA113@users.noreply.github.com> Date: Tue, 7 May 2024 16:16:52 +1200 Subject: [PATCH] fix(be-overlay): consistency overlay with variants [EE-6742] (#11775) Co-authored-by: testa113 --- .../activity-logs-view.html | 86 ++++++++++--------- .../auth-logs-view/auth-logs-view.html | 9 +- .../BEFeatureIndicator/BEOverlay.tsx | 44 +++++++++- .../BackupSettingsView/BackupS3Form.tsx | 5 +- .../BackupSettingsPanel.tsx | 2 + .../settings/SettingsView/HelmCertPanel.tsx | 2 +- 6 files changed, 98 insertions(+), 50 deletions(-) diff --git a/app/portainer/user-activity/activity-logs-view/activity-logs-view.html b/app/portainer/user-activity/activity-logs-view/activity-logs-view.html index 6fa46014a..9fdeab384 100644 --- a/app/portainer/user-activity/activity-logs-view/activity-logs-view.html +++ b/app/portainer/user-activity/activity-logs-view/activity-logs-view.html @@ -1,46 +1,52 @@ -
-
- -
- - -
-
- -
- +
+
+ +
+
+
+ + +
+
+ +
+ +
+
-
-
-

- - Portainer user activity logs have a maximum retention of 7 days. -

-
- -
- - -
- +

+ + Portainer user activity logs have a maximum retention of 7 days. +

+
+ +
+ + +
+
+
+
+ +
diff --git a/app/portainer/user-activity/auth-logs-view/auth-logs-view.html b/app/portainer/user-activity/auth-logs-view/auth-logs-view.html index 6d8081b4c..6daf72066 100644 --- a/app/portainer/user-activity/auth-logs-view/auth-logs-view.html +++ b/app/portainer/user-activity/auth-logs-view/auth-logs-view.html @@ -1,8 +1,9 @@ -
-
- +
+
+ +
@@ -10,7 +11,7 @@
- +
diff --git a/app/react/components/BEFeatureIndicator/BEOverlay.tsx b/app/react/components/BEFeatureIndicator/BEOverlay.tsx index 41765930c..fcdddd980 100644 --- a/app/react/components/BEFeatureIndicator/BEOverlay.tsx +++ b/app/react/components/BEFeatureIndicator/BEOverlay.tsx @@ -5,14 +5,38 @@ import { isLimitedToBE } from '@/react/portainer/feature-flags/feature-flags.ser import { BEFeatureIndicator } from './BEFeatureIndicator'; +type Variants = 'form-section' | 'widget' | 'multi-widget'; + +type OverlayClasses = { + beLinkContainerClassName: string; + contentClassName: string; +}; + +const variantClassNames: Record = { + 'form-section': { + beLinkContainerClassName: '', + contentClassName: '', + }, + widget: { + beLinkContainerClassName: '', + // no padding so that the border overlaps the widget border + contentClassName: '!p-0', + }, + 'multi-widget': { + beLinkContainerClassName: 'm-4', + // widgets have a mx of 15px and mb of 15px - match this at the top with padding + contentClassName: '!p-0 !pt-[15px]', + }, +}; + export function BEOverlay({ featureId, children, - className, + variant = 'form-section', }: { featureId: FeatureId; children: React.ReactNode; - className?: string; + variant?: 'form-section' | 'widget' | 'multi-widget'; }) { const isLimited = isLimitedToBE(featureId); if (!isLimited) { @@ -21,10 +45,22 @@ export function BEOverlay({ return (
-
+
-
{children}
+
+ {children} +
); } diff --git a/app/react/portainer/settings/SettingsView/BackupSettingsView/BackupS3Form.tsx b/app/react/portainer/settings/SettingsView/BackupSettingsView/BackupS3Form.tsx index 7368013df..ad1f8b962 100644 --- a/app/react/portainer/settings/SettingsView/BackupSettingsView/BackupS3Form.tsx +++ b/app/react/portainer/settings/SettingsView/BackupSettingsView/BackupS3Form.tsx @@ -58,7 +58,10 @@ export function BackupS3Form() { validateOnMount > {({ values, errors, isSubmitting, setFieldValue, isValid }) => ( - +
diff --git a/app/react/portainer/settings/SettingsView/BackupSettingsView/BackupSettingsPanel.tsx b/app/react/portainer/settings/SettingsView/BackupSettingsView/BackupSettingsPanel.tsx index 107e6b6e6..b1cd423a5 100644 --- a/app/react/portainer/settings/SettingsView/BackupSettingsView/BackupSettingsPanel.tsx +++ b/app/react/portainer/settings/SettingsView/BackupSettingsView/BackupSettingsPanel.tsx @@ -12,6 +12,8 @@ import { BackupS3Form } from './BackupS3Form'; export function BackupSettingsPanel() { const [backupType, setBackupType] = useState(options[0].value); + console.log(backupType); + return ( diff --git a/app/react/portainer/settings/SettingsView/HelmCertPanel.tsx b/app/react/portainer/settings/SettingsView/HelmCertPanel.tsx index bc2301802..2fa00c3b4 100644 --- a/app/react/portainer/settings/SettingsView/HelmCertPanel.tsx +++ b/app/react/portainer/settings/SettingsView/HelmCertPanel.tsx @@ -30,7 +30,7 @@ export function HelmCertPanel() { }; return ( - +