Remote revision history use item preview modal
This commit is contained in:
@@ -11,8 +11,6 @@ class ActionsMenu {
|
||||
controller($scope, modelManager, actionsManager) {
|
||||
'ngInject';
|
||||
|
||||
$scope.renderData = {};
|
||||
|
||||
$scope.extensions = actionsManager.extensions.sort((a, b) => {return a.name.toLowerCase() > b.name.toLowerCase()});
|
||||
|
||||
for(let ext of $scope.extensions) {
|
||||
@@ -51,11 +49,7 @@ class ActionsMenu {
|
||||
switch (action.verb) {
|
||||
case "render": {
|
||||
var item = response.item;
|
||||
if(item.content_type == "Note") {
|
||||
$scope.renderData.title = item.title;
|
||||
$scope.renderData.text = item.text;
|
||||
$scope.renderData.showRenderModal = true;
|
||||
}
|
||||
actionsManager.presentRevisionPreviewModal(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,8 +71,6 @@ class ActionsMenu {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,9 +32,11 @@ class RevisionPreviewModal {
|
||||
item = modelManager.createItem({content_type: "Note", content: contentCopy});
|
||||
modelManager.addItem(item);
|
||||
} else {
|
||||
item = modelManager.findItem($scope.revision.itemUuid);
|
||||
// revision can be an ItemRevision revision object or just a plain SFItem
|
||||
var uuid = $scope.revision.uuid;
|
||||
item = modelManager.findItem(uuid);
|
||||
item.content = Object.assign({}, $scope.revision.content);
|
||||
item.mapContentToLocalProperties(item.content);
|
||||
modelManager.mapResponseItemsToLocalModels([item], SFModelManager.MappingSourceRemoteActionRetrieved);
|
||||
}
|
||||
item.setDirty(true);
|
||||
syncManager.sync();
|
||||
|
||||
@@ -227,7 +227,7 @@ class ItemRevision {
|
||||
} else {
|
||||
this.date = date;
|
||||
}
|
||||
this.itemUuid = item.uuid;
|
||||
this.uuid = item.uuid;
|
||||
this.hasPreviousRevision = previousRevision != null;
|
||||
this.content = Object.assign({}, item.content);
|
||||
}
|
||||
|
||||
@@ -20,15 +20,3 @@
|
||||
access to this note.
|
||||
|
||||
%menu-row{"ng-if" => "extension.actionsWithContextForItem(item).length == 0", "label" => "'No Actions Available'", "faded" => "true"}
|
||||
|
||||
|
||||
.modal.medium-text.medium{"ng-if" => "renderData.showRenderModal", "ng-click" => "$event.stopPropagation();"}
|
||||
.content
|
||||
.sn-component
|
||||
.panel
|
||||
.header
|
||||
%h1.title Preview
|
||||
%a.close-button.info{"ng-click" => "renderData.showRenderModal = false; $event.stopPropagation();"} Close
|
||||
.content.selectable
|
||||
%h2 {{renderData.title}}
|
||||
%p.normal{"style" => "white-space: pre-wrap; font-size: 16px;"} {{renderData.text}}
|
||||
|
||||
@@ -21,14 +21,3 @@
|
||||
"label" => "revision.previewTitle()"}
|
||||
.sublabel.opaque{"ng-class" => "classForRevision(revision)"}
|
||||
{{revision.previewSubTitle()}}
|
||||
|
||||
.modal.medium-text.medium{"ng-if" => "renderData.showRenderModal", "ng-click" => "$event.stopPropagation();"}
|
||||
.content
|
||||
.sn-component
|
||||
.panel
|
||||
.header
|
||||
%h1.title Preview
|
||||
%a.close-button.info{"ng-click" => "renderData.showRenderModal = false; $event.stopPropagation();"} Close
|
||||
.content.selectable
|
||||
%h2 {{renderData.title}}
|
||||
%p.normal{"style" => "white-space: pre-wrap; font-size: 16px;"} {{renderData.text}}
|
||||
|
||||
Reference in New Issue
Block a user