mirror of
https://github.com/nasa/openmct.git
synced 2025-06-10 03:11:39 +00:00
* Save and Finish blocking modal dialog Refactor and Styles #2500 * created new template for ProgressDialogComponent * Tweaks for #2501 - Normalized dialog icon size; - Enhanced text formatting in dialog; - Changed "Saving..." to remove ellipsis;
This commit is contained in:
parent
6e2497461a
commit
c6f83dea8d
@ -6,7 +6,7 @@ define([], function () {
|
|||||||
|
|
||||||
SaveInProgressDialog.prototype.show = function () {
|
SaveInProgressDialog.prototype.show = function () {
|
||||||
this.dialog = this.dialogService.showBlockingMessage({
|
this.dialog = this.dialogService.showBlockingMessage({
|
||||||
title: "Saving...",
|
title: "Saving",
|
||||||
hint: "Do not navigate away from this page or close this browser tab while this message is displayed.",
|
hint: "Do not navigate away from this page or close this browser tab while this message is displayed.",
|
||||||
unknownProgress: true,
|
unknownProgress: true,
|
||||||
severity: "info",
|
severity: "info",
|
||||||
|
@ -1,25 +1,31 @@
|
|||||||
import ProgressComponent from '../../ui/components/ProgressBar.vue';
|
import ProgressDialogComponent from './components/ProgressDialogComponent.vue';
|
||||||
import Overlay from './Overlay';
|
import Overlay from './Overlay';
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
|
||||||
var component;
|
var component;
|
||||||
|
|
||||||
class ProgressDialog extends Overlay {
|
class ProgressDialog extends Overlay {
|
||||||
constructor({progressPerc, progressText, ...options}) {
|
constructor({progressPerc, progressText, iconClass, message, title, hint, timestamp, ...options}) {
|
||||||
|
|
||||||
component = new Vue({
|
component = new Vue({
|
||||||
|
provide: {
|
||||||
|
iconClass,
|
||||||
|
message,
|
||||||
|
title,
|
||||||
|
hint,
|
||||||
|
timestamp
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
ProgressComponent: ProgressComponent
|
ProgressDialogComponent: ProgressDialogComponent
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
model: {
|
model: {
|
||||||
progressPerc: progressPerc || 0,
|
progressPerc: progressPerc || 0,
|
||||||
progressText: progressText
|
progressText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
template: '<progress-component :model="model"></progress-component>'
|
template: '<progress-dialog-component :model="model"></progress-dialog-component>'
|
||||||
}).$mount();
|
}).$mount();
|
||||||
|
|
||||||
super({
|
super({
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
v-if="message">
|
v-if="message">
|
||||||
{{message}}
|
{{message}}
|
||||||
</div>
|
</div>
|
||||||
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -44,7 +45,7 @@
|
|||||||
|
|
||||||
&__icon {
|
&__icon {
|
||||||
// Holds a background SVG graphic
|
// Holds a background SVG graphic
|
||||||
$s: 50px;
|
$s: 80px;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
min-width: $s;
|
min-width: $s;
|
||||||
min-height: $s;
|
min-height: $s;
|
||||||
@ -61,9 +62,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// __text elements
|
// __text elements
|
||||||
&__title,
|
|
||||||
&__action-text {
|
&__action-text {
|
||||||
font-size: 1.2em; // TEMP
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
font-size: 1.5em;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
&--simple {
|
&--simple {
|
||||||
|
22
src/api/overlays/components/ProgressDialogComponent.vue
Normal file
22
src/api/overlays/components/ProgressDialogComponent.vue
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<template>
|
||||||
|
<dialog-component>
|
||||||
|
<progress-component :model="model"></progress-component>
|
||||||
|
</dialog-component>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ProgressComponent from '../../../ui/components/ProgressBar.vue';
|
||||||
|
import DialogComponent from './DialogComponent.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
DialogComponent: DialogComponent,
|
||||||
|
ProgressComponent: ProgressComponent,
|
||||||
|
},
|
||||||
|
inject:['iconClass', 'title', 'hint', 'timestamp', 'message'],
|
||||||
|
props:['model']
|
||||||
|
}
|
||||||
|
</script>
|
@ -129,10 +129,13 @@ const PLACEHOLDER_OBJECT = {};
|
|||||||
saveAndFinishEditing() {
|
saveAndFinishEditing() {
|
||||||
let dialog = this.openmct.overlays.progressDialog({
|
let dialog = this.openmct.overlays.progressDialog({
|
||||||
progressPerc: 'unknown',
|
progressPerc: 'unknown',
|
||||||
progressText: 'Saving...',
|
message: 'Do not navigate away from this page or close this browser tab while this message is displayed.',
|
||||||
|
iconClass: 'info',
|
||||||
|
title: 'Saving',
|
||||||
});
|
});
|
||||||
|
|
||||||
return this.openmct.editor.save().then(()=> {
|
return this.openmct.editor.save()
|
||||||
|
.then(()=> {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
this.openmct.notifications.info('Save successful');
|
this.openmct.notifications.info('Save successful');
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user