Skip to content

Commit 4e4ccd2

Browse files
authored
Copy folder access settings when copying freezers and assay designs - GitHub 284 and 305 (#1912)
### version 7.6.0 *Released*: 29 December 2025 - Copy folder access settings when copying freezers and assay designs - GitHub Issue #284: Freezer copy - GitHub Issue #305: Assay design copy
1 parent 9797807 commit 4e4ccd2

File tree

5 files changed

+40
-23
lines changed

5 files changed

+40
-23
lines changed

packages/components/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@labkey/components",
3-
"version": "7.5.1",
3+
"version": "7.6.0",
44
"description": "Components, models, actions, and utility functions for LabKey applications and pages",
55
"sideEffects": false,
66
"files": [

packages/components/releaseNotes/components.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# @labkey/components
22
Components, models, actions, and utility functions for LabKey applications and pages
33

4+
### version 7.6.0
5+
*Released*: 29 December 2025
6+
- Copy folder access settings when copying freezers and assay designs
7+
- GitHub Issue #284: Freezer copy
8+
- GitHub Issue #305: Assay design copy
9+
410
### version 7.5.1
511
*Released*: 24 December 2025
612
- Add `displaySelectedOptions` prop and respect setting when passing `selectedOptions` to the underlying `SelectInput`

packages/components/src/internal/components/domainproperties/DataTypeFoldersPanel.tsx

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
} from './DomainPropertiesPanelCollapse';
2222

2323
interface OwnProps {
24+
dataTypeCopyId?: number; // RowId for the data type being copied, if applicable
2425
dataTypeName?: string;
2526
dataTypeRowId?: number;
2627
entityDataType: EntityDataType;
@@ -30,11 +31,12 @@ interface OwnProps {
3031
}
3132

3233
// export for jest testing
33-
export const DataTypeFoldersPanelImpl: FC<OwnProps & InjectedDomainPropertiesPanelCollapseProps> = memo(props => {
34+
export const DataTypeFoldersPanelImpl: FC<InjectedDomainPropertiesPanelCollapseProps & OwnProps> = memo(props => {
3435
const {
3536
collapsed,
3637
togglePanel,
3738
controlledCollapse,
39+
dataTypeCopyId,
3840
dataTypeRowId,
3941
dataTypeName,
4042
onUpdateExcludedFolders,
@@ -53,6 +55,8 @@ export const DataTypeFoldersPanelImpl: FC<OwnProps & InjectedDomainPropertiesPan
5355
const [excludedContainerIdsDB, setExcludedContainerIdsDB] = useState<string[]>();
5456
const [excludedContainerIds, setExcludedContainerIds] = useState<string[]>();
5557
const [relatedExcludedContainerIdsDB, setRelatedExcludedContainerIdsDB] = useState<string[]>();
58+
const copy = !!dataTypeCopyId && !dataTypeRowId;
59+
const isNewEntity = !dataTypeRowId && !copy;
5660

5761
useEffect(
5862
() => {
@@ -62,6 +66,7 @@ export const DataTypeFoldersPanelImpl: FC<OwnProps & InjectedDomainPropertiesPan
6266

6367
try {
6468
const containers = await api.folder.getContainers(container, moduleContext, true, true, true);
69+
const dataTypeRowId_ = copy ? dataTypeCopyId : dataTypeRowId;
6570

6671
const allContainers_ = containers.map(container_ => {
6772
return {
@@ -77,10 +82,13 @@ export const DataTypeFoldersPanelImpl: FC<OwnProps & InjectedDomainPropertiesPan
7782

7883
const excludedContainerIds_ = await api.folder.getDataTypeExcludedContainers(
7984
entityDataType.folderConfigurableDataType,
80-
dataTypeRowId
85+
dataTypeRowId_
8186
);
8287
setExcludedContainerIdsDB(excludedContainerIds_);
8388
setExcludedContainerIds(excludedContainerIds_);
89+
if (copy) {
90+
onUpdateExcludedFolders(entityDataType.folderConfigurableDataType, excludedContainerIds_);
91+
}
8492

8593
const allDataCounts_ = await api.query.getDataTypeFolderDataCount(
8694
entityDataType,
@@ -138,19 +146,19 @@ export const DataTypeFoldersPanelImpl: FC<OwnProps & InjectedDomainPropertiesPan
138146

139147
return (
140148
<BasePropertiesPanel
141-
headerId="domain-folders-hdr"
142-
title="Folders"
143149
collapsed={collapsed}
144150
controlledCollapse={controlledCollapse}
151+
headerId="domain-folders-hdr"
145152
isValid
146153
panelStatus={collapsed && isValid ? 'COMPLETE' : isValid ? 'INPROGRESS' : 'TODO'}
147-
updateValidStatus={updateValidStatus}
154+
title="Folders"
148155
todoIconHelpMsg={
149156
'This section defines which folders use this ' +
150157
entityDataType.typeNounSingular.toLowerCase() +
151158
'. You may want to review.'
152159
}
153160
togglePanel={togglePanel}
161+
updateValidStatus={updateValidStatus}
154162
>
155163
<div className="bottom-padding">
156164
Select which folders can use this {entityDataType.typeNounSingular.toLowerCase()}.
@@ -169,47 +177,47 @@ export const DataTypeFoldersPanelImpl: FC<OwnProps & InjectedDomainPropertiesPan
169177
{!relatedFolderConfigurableDataType && (
170178
<div className="col-xs-12 bottom-padding">
171179
<DataTypeSelector
172-
entityDataType={entityDataType}
173180
allDataCounts={allDataCounts}
174181
allDataTypes={childFolders}
175-
updateUncheckedTypes={updateExcludedFolders}
176-
uncheckedEntitiesDB={excludedContainerIdsDB}
177-
dataTypeLabel="folders"
178-
noHeader
179182
columns={2}
183+
dataTypeLabel="folders"
184+
entityDataType={entityDataType}
180185
inactiveSectionLabel="Archived Folders"
181-
isNewEntity={!dataTypeRowId}
186+
isNewEntity={isNewEntity}
187+
noHeader
182188
showUncheckedWarning={!!dataTypeRowId}
189+
uncheckedEntitiesDB={excludedContainerIdsDB}
190+
updateUncheckedTypes={updateExcludedFolders}
183191
/>
184192
</div>
185193
)}
186194
{!!relatedFolderConfigurableDataType && (
187195
<>
188196
<div className="col-xs-6 bottom-padding">
189197
<DataTypeSelector
190-
entityDataType={entityDataType}
191198
allDataCounts={allDataCounts}
192199
allDataTypes={childFolders}
193-
updateUncheckedTypes={updateExcludedFolders}
194-
uncheckedEntitiesDB={excludedContainerIdsDB}
195200
dataTypeLabel="Include in Folders"
201+
entityDataType={entityDataType}
196202
inactiveSectionLabel="Archived Folders"
197-
isNewEntity={!dataTypeRowId}
203+
isNewEntity={isNewEntity}
198204
showUncheckedWarning={!!dataTypeRowId}
205+
uncheckedEntitiesDB={excludedContainerIdsDB}
206+
updateUncheckedTypes={updateExcludedFolders}
199207
/>
200208
</div>
201209
<div className="col-xs-6 bottom-padding">
202210
<DataTypeSelector
211+
allDataTypes={allContainers}
212+
dataTypeLabel={relatedDataTypeLabel}
203213
dataTypePrefix="Dashboard"
204214
entityDataType={entityDataType}
205-
allDataTypes={allContainers}
206-
updateUncheckedTypes={updateRelatedExcludedFolders}
207-
uncheckedEntitiesDB={relatedExcludedContainerIdsDB}
208215
hiddenEntities={excludedContainerIds}
209-
dataTypeLabel={relatedDataTypeLabel}
210216
inactiveSectionLabel="Archived Folders"
211-
isNewEntity={!dataTypeRowId}
217+
isNewEntity={isNewEntity}
212218
showUncheckedWarning={false}
219+
uncheckedEntitiesDB={relatedExcludedContainerIdsDB}
220+
updateUncheckedTypes={updateRelatedExcludedFolders}
213221
/>
214222
</div>
215223
</>

packages/components/src/internal/components/domainproperties/assay/AssayDesignerPanels.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export interface AssayDesignerPanelsProps {
163163
hideAdvancedProperties?: boolean;
164164
hideEmptyBatchDomain?: boolean;
165165
initModel: AssayProtocolModel;
166+
initProtocolId?: number; // used for copy assay design since initModel will not have the protocolId in that case
166167
onCancel: () => void;
167168
onChange?: (model: AssayProtocolModel) => void;
168169
onComplete: (model: AssayProtocolModel) => void;
@@ -392,6 +393,7 @@ export class AssayDesignerPanelsImpl extends React.PureComponent<Props, State> {
392393
appPropertiesOnly,
393394
hideAdvancedProperties,
394395
initModel,
396+
initProtocolId,
395397
domainFormDisplayOptions,
396398
currentPanelIndex,
397399
validatePanel,
@@ -475,6 +477,7 @@ export class AssayDesignerPanelsImpl extends React.PureComponent<Props, State> {
475477
{appPropertiesOnly && allowFolderExclusion && (
476478
<DataTypeFoldersPanel
477479
controlledCollapse
480+
dataTypeCopyId={initProtocolId}
478481
dataTypeName={protocolModel?.name}
479482
dataTypeRowId={protocolModel?.protocolId}
480483
entityDataType={AssayRunDataType}

0 commit comments

Comments
 (0)