Skip to content

Commit

Permalink
GUI S3 Objects lifecycle (#2759): lifecycle restored versions - make …
Browse files Browse the repository at this point in the history
…downloadable and restoreable (git restore) (#2874)
  • Loading branch information
AleksandrGorodetskii authored Oct 14, 2022
1 parent 25e2f8b commit eb41483
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions client/src/components/pipelines/browser/DataStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ export default class DataStorage extends React.Component {
(item.type && item.type.toLowerCase() === 'folder') ||
!item.isVersion ||
item.deleteMarker ||
(item.isVersion && item.archived)
(item.isVersion && !item.restored)
) {
return false;
}
Expand Down Expand Up @@ -1331,29 +1331,33 @@ export default class DataStorage extends React.Component {
return undefined;
}
const childList = [];
const restored = (this.checkRestoredStatus(item) || {}).status === STATUS.SUCCEEDED;
const restoreStatus = this.checkRestoredStatus(item) || {};
const fileRestored = restoreStatus.status === STATUS.SUCCEEDED;
for (let version in versions) {
if (versions.hasOwnProperty(version)) {
const archived = versions[version].labels &&
versions[version].labels['StorageClass'] !== STORAGE_CLASSES.standard;
const versionRestored = archived && restoreStatus.restoreVersions;
const latest = versions[version].version === item.version;
childList.push({
key: `${item.type}_${item.path}_${version}`,
...versions[version],
downloadable: item.type.toLowerCase() === 'file' &&
!versions[version].deleteMarker &&
!sensitive &&
((latest && restored) || !archived),
(!archived || (latest ? fileRestored : versionRestored)),
editable: versions[version].version === item.version &&
roleModel.writeAllowed(this.props.info.value) &&
!versions[version].deleteMarker,
roleModel.writeAllowed(this.props.info.value) &&
!versions[version].deleteMarker,
deletable: roleModel.writeAllowed(this.props.info.value),
selectable: false,
shareAvailable: false,
latest,
isVersion: true,
archived,
restored
restored: latest
? fileRestored
: versionRestored
});
}
}
Expand Down

0 comments on commit eb41483

Please sign in to comment.