Skip to content

Commit 8893672

Browse files
authoredMar 10, 2025
HP-1956 fix: discovery table checkbox enabled bug (#1679)
* fix: discovery table checkbox enabled bug * default disabled to false
1 parent 61992c9 commit 8893672

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
 

‎src/Discovery/DiscoveryListView.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ const DiscoveryListView: React.FunctionComponent<Props> = (props: Props) => {
6464
(props.config.features.exportToWorkspace.enableDownloadManifest || props.config.features.exportToWorkspace.enableDownloadZip)
6565
? 'download'
6666
: '',
67-
'open in workspace'
67+
'open in workspace',
6868
]
6969
.filter(Boolean)
7070
.join(' or ')
71-
}`}
71+
}`}
7272
overlayStyle={{ maxWidth: '150px' }}
7373
>
7474
{node}
@@ -79,7 +79,7 @@ const DiscoveryListView: React.FunctionComponent<Props> = (props: Props) => {
7979
props.onResourcesSelected(selectedRows);
8080
},
8181
getCheckboxProps: (record) => {
82-
let disabled;
82+
let disabled:boolean = false;
8383
// if auth is enabled, disable checkbox if user doesn't have access
8484
if (props.config.features.authorization.enabled) {
8585
disabled = (record[props.accessibleFieldName] !== AccessLevel.ACCESSIBLE) && (record[props.accessibleFieldName] !== AccessLevel.MIXED);
@@ -102,7 +102,11 @@ const DiscoveryListView: React.FunctionComponent<Props> = (props: Props) => {
102102
if (!record[manifestFieldName] || record[manifestFieldName].length === 0) {
103103
// put some hard-coded field names here, so that only checkboxes in proper table rows will be enabled
104104
// TODO: this can be addressed by the cart feature
105-
if (enableExportFullMetadata && (!record.external_file_metadata || record.external_file_metadata.length === 0)) {
105+
// if export full metadata is not enabled, disable the checkbox if no manifest
106+
if (!enableExportFullMetadata) {
107+
disabled = true;
108+
// otherwise, check if there is external file metadata
109+
} else if (!record.external_file_metadata || record.external_file_metadata.length === 0) {
106110
disabled = true;
107111
}
108112
}

0 commit comments

Comments
 (0)