]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-19345 Allow deselection of now-empty facets
authorDavid Cho-Lerat <david.cho-lerat@sonarsource.com>
Tue, 13 Jun 2023 12:09:09 +0000 (14:09 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 13 Jun 2023 20:03:38 +0000 (20:03 +0000)
server/sonar-web/design-system/src/components/FacetItem.tsx
server/sonar-web/src/main/js/apps/projectDump/__tests__/ProjectDumpApp-it.tsx

index 9fbeff5e730aa0a34ca344a70f45bfd77eec103a..6a4a262d41708943926efee9d9b3352a45946740 100644 (file)
@@ -47,7 +47,9 @@ export function FacetItem({
   tooltip,
   value,
 }: FacetItemProps) {
-  const disabled = disabledProp || (stat !== undefined && stat === 0);
+  // alow an active facet to be disabled even if it now has a "0" stat
+  // (it was activated when a different value of My issues/All/New code was selected)
+  const disabled = disabledProp || (!active && stat !== undefined && stat === 0);
 
   const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
     event.preventDefault();
index 6343f5a293a1be17a19e53416867e56712a03e66..b0ae3c875623a421c80e237c0995882949125e7e 100644 (file)
@@ -42,14 +42,14 @@ const ui = {
   exportBtn: byRole('button', { name: 'project_dump.do_export' }),
   importBtn: byRole('button', { name: 'project_dump.do_import' }),
 
-  successExport: byText('project_dump.latest_export_available.June 8, 2023 at', { exact: false }),
-  pendingExport: byText('project_dump.pending_export.June 8, 2023 at', { exact: false }),
+  successExport: byText('project_dump.latest_export_available.June 8, 2023', { exact: false }),
+  pendingExport: byText('project_dump.pending_export.June 8, 2023', { exact: false }),
   inProgressExport: byText('project_dump.in_progress_export.1 hour ago'),
   failedExport: byText('project_dump.failed_export'),
   cantExportMsg: byText('project_dump.can_not_export'),
 
-  successImport: byText('project_dump.import_success.June 8, 2023 at', { exact: false }),
-  pendingImport: byText('project_dump.pending_import.June 8, 2023 at', { exact: false }),
+  successImport: byText('project_dump.import_success.June 8, 2023', { exact: false }),
+  pendingImport: byText('project_dump.pending_import.June 8, 2023', { exact: false }),
   inProgressImport: byText('project_dump.in_progress_import.1 hour ago'),
   failedImport: byText('project_dump.failed_import'),
   cantImportMsg: byText('project_dump.can_not_import'),