Editor stack app bar, expired components enter readonly state

This commit is contained in:
Mo Bitar
2018-12-15 12:22:41 -06:00
parent f7dfec36f8
commit dcd44083ac
8 changed files with 64 additions and 90 deletions

View File

@@ -313,6 +313,24 @@ class ComponentManager {
return;
}
// Actions that won't succeeed with readonly mode
let readwriteActions = [
"save-items",
"associate-item",
"deassociate-item",
"create-item",
"create-items",
"delete-items",
"set-component-data"
];
if(component.readonly && readwriteActions.includes(message.action)) {
// A component can be marked readonly if changes should not be saved.
// Particullary used for revision preview windows where the notes should not be savable.
alert(`The extension ${component.name} is trying to save, but it is in a locked state and cannot accept changes.`);
return;
}
/**
Possible Messages:
set-size
@@ -473,13 +491,6 @@ class ComponentManager {
}
handleSaveItemsMessage(component, message) {
if(component.readonly) {
// A component can be marked readonly if changes should not be saved.
// Particullary used for revision preview windows where the notes should not be savable.
alert(`The extension ${component.name} is trying to save, but it is in a locked state and cannot accept changes.`);
return;
}
var responseItems = message.data.items;
var requiredPermissions;