Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to lock object sub-tree and fix object locking bugs #7855

Merged
merged 24 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a212b6f
Script for locking an object tree
akhenry Sep 30, 2024
70d1a5f
Show lock button if locked
akhenry Sep 30, 2024
7ee4c89
Do not allow properties editing of locked objects
akhenry Sep 30, 2024
dafd011
Remove package-lock.json
akhenry Sep 30, 2024
4ad615f
Added p-debounce
akhenry Sep 30, 2024
64d20ff
Allow duplication of locked objects
akhenry Sep 30, 2024
0c8bbaa
Better user feedback
akhenry Sep 30, 2024
c434960
Add semaphores to prevent file handle exhaustion
akhenry Sep 30, 2024
dcce640
Merge branch 'master' into fix-object-locking
akhenry Oct 7, 2024
3389b3b
Leverage official Apache Couch library - nano. Clean up dependencies.…
akhenry Oct 8, 2024
b57c8b5
Added lock user attribution
akhenry Oct 8, 2024
1695403
Remove unused code
akhenry Oct 8, 2024
dc15529
Modify open script for adding auth design doc
akhenry Oct 9, 2024
5f38706
Added script for creating auth design doc
akhenry Oct 9, 2024
8bd6ba9
Add css class for disallow unlock
akhenry Oct 9, 2024
405c021
Add user attribution to lock button
akhenry Oct 9, 2024
aab158e
Fix import
akhenry Oct 9, 2024
58f3097
Typo
akhenry Oct 9, 2024
48a8b3d
User it was locked by, not current user. Wow.
akhenry Oct 9, 2024
e7f8002
Merge branch 'master' into fix-object-locking
akhenry Oct 9, 2024
3fcefd7
Closes #7877
charlesh88 Oct 10, 2024
ca6d9f4
Merge branch 'master' into fix-object-locking
akhenry Oct 10, 2024
198f474
Fixed bug where lock is shown even if object is not locked
akhenry Oct 10, 2024
60e2fc4
Merge branch 'master' into fix-object-locking
ozyx Oct 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"moment": "2.30.1",
"moment-duration-format": "2.3.2",
"moment-timezone": "0.5.41",
"nano": "10.1.4",
"npm-run-all2": "6.1.2",
"nyc": "15.1.0",
"painterro": "1.2.87",
Expand Down Expand Up @@ -156,4 +157,4 @@
"keywords": [
"nasa"
]
}
}
6 changes: 3 additions & 3 deletions src/plugins/duplicate/DuplicateAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ class DuplicateAction {
let currentParentKeystring = this.openmct.objects.makeKeyString(currentParent.identifier);
let parentCandidateKeystring = this.openmct.objects.makeKeyString(parentCandidate.identifier);
let objectKeystring = this.openmct.objects.makeKeyString(this.object.identifier);
const isLocked = parentCandidate.locked === true;

if (!this.openmct.objects.isPersistable(parentCandidate.identifier)) {
if (isLocked || !this.openmct.objects.isPersistable(parentCandidate.identifier)) {
return false;
}

Expand Down Expand Up @@ -139,10 +140,9 @@ class DuplicateAction {
const parentType = parent && this.openmct.types.get(parent.type);
const child = objectPath[0];
const childType = child && this.openmct.types.get(child.type);
const locked = child.locked ? child.locked : parent && parent.locked;
const isPersistable = this.openmct.objects.isPersistable(child.identifier);

if (locked || !isPersistable) {
if (!isPersistable) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/formActions/EditPropertiesAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class EditPropertiesAction extends PropertiesAction {
const definition = this._getTypeDefinition(object.type);
const persistable = this.openmct.objects.isPersistable(object.identifier);

return persistable && definition && definition.creatable;
return persistable && definition && definition.creatable && !object.locked;
}

invoke(objectPath) {
Expand Down
9 changes: 9 additions & 0 deletions src/plugins/inspectorViews/properties/PropertiesComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export default {
const createdTimestamp = this.domainObject.created;
const createdBy = this.domainObject.createdBy ? this.domainObject.createdBy : UNKNOWN_USER;
const modifiedBy = this.domainObject.modifiedBy ? this.domainObject.modifiedBy : UNKNOWN_USER;
const locked = this.domainObject.locked;
const lockedBy = this.domainObject.lockedBy ?? UNKNOWN_USER;
const modifiedTimestamp = this.domainObject.modified
? this.domainObject.modified
: this.domainObject.created;
Expand Down Expand Up @@ -148,6 +150,13 @@ export default {
});
}

if (locked === true) {
details.push({
name: 'Locked By',
value: lockedBy
});
}

if (version) {
details.push({
name: 'Version',
Expand Down
Loading
Loading