Merge branch 'develop' into feature/account-menu-react
This commit is contained in:
@@ -61,10 +61,11 @@ class HistoryMenuCtrl extends PureViewCtrl<unknown, HistoryState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async openSessionRevision(revision: HistoryEntry) {
|
async openSessionRevision(revision: HistoryEntry & { previewTitle: () => string }) {
|
||||||
this.application.presentRevisionPreviewModal(
|
this.application.presentRevisionPreviewModal(
|
||||||
revision.payload.uuid,
|
revision.payload.uuid,
|
||||||
revision.payload.content
|
revision.payload.content,
|
||||||
|
revision.previewTitle()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +85,8 @@ class HistoryMenuCtrl extends PureViewCtrl<unknown, HistoryState> {
|
|||||||
}
|
}
|
||||||
this.application.presentRevisionPreviewModal(
|
this.application.presentRevisionPreviewModal(
|
||||||
remoteRevision.payload.uuid,
|
remoteRevision.payload.uuid,
|
||||||
remoteRevision.payload.content
|
remoteRevision.payload.content,
|
||||||
|
this.previewRemoteHistoryTitle(revision)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,7 +156,7 @@ class HistoryMenuCtrl extends PureViewCtrl<unknown, HistoryState> {
|
|||||||
this.reloadState();
|
this.reloadState();
|
||||||
}
|
}
|
||||||
|
|
||||||
previewRemoteHistoryTitle(revision: SingleRevision) {
|
previewRemoteHistoryTitle(revision: RevisionListEntry) {
|
||||||
return new Date(revision.created_at).toLocaleString();
|
return new Date(revision.created_at).toLocaleString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class RevisionPreviewModalCtrl extends PureViewCtrl implements RevisionPreviewSc
|
|||||||
$timeout: ng.ITimeoutService
|
$timeout: ng.ITimeoutService
|
||||||
uuid!: string
|
uuid!: string
|
||||||
content!: PayloadContent
|
content!: PayloadContent
|
||||||
|
title?: string
|
||||||
application!: WebApplication
|
application!: WebApplication
|
||||||
unregisterComponent?: any
|
unregisterComponent?: any
|
||||||
note!: SNNote
|
note!: SNNote
|
||||||
@@ -139,6 +140,7 @@ export class RevisionPreviewModal extends WebDirective {
|
|||||||
this.scope = {
|
this.scope = {
|
||||||
uuid: '=',
|
uuid: '=',
|
||||||
content: '=',
|
content: '=',
|
||||||
|
title: '=',
|
||||||
application: '='
|
application: '='
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -189,13 +189,14 @@ export class WebApplication extends SNApplication {
|
|||||||
this.applicationElement.append(el);
|
this.applicationElement.append(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
presentRevisionPreviewModal(uuid: string, content: any) {
|
presentRevisionPreviewModal(uuid: string, content: any, title?: string) {
|
||||||
const scope: any = this.scope!.$new(true);
|
const scope: any = this.scope!.$new(true);
|
||||||
scope.uuid = uuid;
|
scope.uuid = uuid;
|
||||||
scope.content = content;
|
scope.content = content;
|
||||||
|
scope.title = title;
|
||||||
scope.application = this;
|
scope.application = this;
|
||||||
const el = this.$compile!(
|
const el = this.$compile!(
|
||||||
`<revision-preview-modal application='application' uuid='uuid' content='content'
|
`<revision-preview-modal application='application' uuid='uuid' content='content' title='title'
|
||||||
class='sk-modal'></revision-preview-modal>`
|
class='sk-modal'></revision-preview-modal>`
|
||||||
)(scope);
|
)(scope);
|
||||||
this.applicationElement.append(el);
|
this.applicationElement.append(el);
|
||||||
|
|||||||
@@ -5,7 +5,11 @@
|
|||||||
.sn-component
|
.sn-component
|
||||||
.sk-panel
|
.sk-panel
|
||||||
.sk-panel-header
|
.sk-panel-header
|
||||||
.sk-panel-header-title Preview
|
div
|
||||||
|
.sk-panel-header-title Preview
|
||||||
|
.sk-subtitle.neutral.mt-1(
|
||||||
|
ng-if="ctrl.title"
|
||||||
|
) {{ctrl.title}}
|
||||||
.sk-horizontal-group
|
.sk-horizontal-group
|
||||||
a.sk-a.info.close-button(
|
a.sk-a.info.close-button(
|
||||||
ng-click="ctrl.restore(false)"
|
ng-click="ctrl.restore(false)"
|
||||||
|
|||||||
Reference in New Issue
Block a user