ProgressBar null not undefined (#6953)

* ProgressBar null not undefined

* notification banner null

* update progress dialog

* docs: update type

---------

Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>
Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
This commit is contained in:
David 'Epper' Marshall 2023-08-29 19:49:31 -04:00 committed by GitHub
parent ca06a6a047
commit b87459dfd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 13 additions and 13 deletions

View File

@ -165,7 +165,7 @@ export default class NotificationAPI extends EventEmitter {
/** /**
* Create a new progress notification. These notifications will contain a progress bar. * Create a new progress notification. These notifications will contain a progress bar.
* @param {string} message * @param {string} message
* @param {number | 'unknown'} progressPerc A value between 0 and 100, or the string 'unknown'. * @param {number | null} progressPerc A value between 0 and 100, or null.
* @param {string} [progressText] Text description of progress (eg. "10 of 20 objects copied"). * @param {string} [progressText] Text description of progress (eg. "10 of 20 objects copied").
*/ */
progress(message, progressPerc, progressText) { progress(message, progressPerc, progressText) {

View File

@ -141,7 +141,7 @@ class OverlayAPI {
* @see NotificationService * @see NotificationService
* *
* @typedef options * @typedef options
* @property {number} progressPerc the initial progress value (0-100) or {string} 'unknown' for anonymous progress * @property {number | null} progressPerc the initial progress value (0-100) or null for anonymous progress
* @property {string} progressText the initial text to be shown under the progress bar * @property {string} progressText the initial text to be shown under the progress bar
* @property {buttons[]} buttons a list of buttons with title and callback properties that will * @property {buttons[]} buttons a list of buttons with title and callback properties that will
* be added to the dialog. * be added to the dialog.

View File

@ -70,7 +70,7 @@ export default class CreateAction extends PropertiesAction {
// Show saving progress dialog // Show saving progress dialog
let dialog = this.openmct.overlays.progressDialog({ let dialog = this.openmct.overlays.progressDialog({
progressPerc: 'unknown', progressPerc: null,
message: message:
'Do not navigate away from this page or close this browser tab while this message is displayed.', 'Do not navigate away from this page or close this browser tab while this message is displayed.',
iconClass: 'info', iconClass: 'info',

View File

@ -105,7 +105,7 @@
<progress-bar <progress-bar
v-if="savingTransaction" v-if="savingTransaction"
class="c-telemetry-table__progress-bar" class="c-telemetry-table__progress-bar"
:model="{ progressPerc: undefined }" :model="{ progressPerc: null }"
/> />
<div v-if="selectedPage && selectedPage.isLocked" class="c-notebook__page-locked"> <div v-if="selectedPage && selectedPage.isLocked" class="c-notebook__page-locked">
<div class="icon-lock"></div> <div class="icon-lock"></div>

View File

@ -29,7 +29,7 @@
<progress-bar <progress-bar
v-show="!!loading" v-show="!!loading"
class="c-telemetry-table__progress-bar" class="c-telemetry-table__progress-bar"
:model="{ progressPerc: undefined }" :model="{ progressPerc: null }"
/> />
<mct-plot <mct-plot
:class="[plotLegendExpandedStateClass, plotLegendPositionClass]" :class="[plotLegendExpandedStateClass, plotLegendPositionClass]"

View File

@ -135,7 +135,7 @@
<progress-bar <progress-bar
v-if="loading" v-if="loading"
class="c-telemetry-table__progress-bar" class="c-telemetry-table__progress-bar"
:model="{ progressPerc: undefined }" :model="{ progressPerc: null }"
/> />
<!-- Headers table --> <!-- Headers table -->

View File

@ -23,7 +23,7 @@
<div class="c-progress-bar"> <div class="c-progress-bar">
<div <div
class="c-progress-bar__bar" class="c-progress-bar__bar"
:class="{ '--indeterminate': model.progressPerc === undefined }" :class="{ '--indeterminate': model.progressPerc === null }"
:style="styleBarWidth" :style="styleBarWidth"
></div> ></div>
<div v-if="model.progressText !== undefined" class="c-progress-bar__text"> <div v-if="model.progressText !== undefined" class="c-progress-bar__text">
@ -43,7 +43,7 @@ export default {
}, },
computed: { computed: {
styleBarWidth() { styleBarWidth() {
return this.model.progressPerc !== undefined ? `width: ${this.model.progressPerc}%;` : ''; return this.model.progressPerc !== null ? `width: ${this.model.progressPerc}%;` : '';
} }
} }
}; };

View File

@ -359,7 +359,7 @@ export default {
}, },
saveAndFinishEditing() { saveAndFinishEditing() {
let dialog = this.openmct.overlays.progressDialog({ let dialog = this.openmct.overlays.progressDialog({
progressPerc: 'unknown', progressPerc: null,
message: message:
'Do not navigate away from this page or close this browser tab while this message is displayed.', 'Do not navigate away from this page or close this browser tab while this message is displayed.',
iconClass: 'info', iconClass: 'info',

View File

@ -50,7 +50,7 @@
</div> </div>
<div v-if="searchLoading" class="c-gsearch__result-pane-msg"> <div v-if="searchLoading" class="c-gsearch__result-pane-msg">
<div class="hint">Searching...</div> <div class="hint">Searching...</div>
<progress-bar :model="{ progressPerc: undefined }" /> <progress-bar :model="{ progressPerc: null }" />
</div> </div>
<div <div
v-if=" v-if="

View File

@ -40,7 +40,7 @@
> >
<progress-bar <progress-bar
v-if="activeModel.progressPerc !== undefined" v-if="activeModel.progressPerc !== null"
class="c-message-banner__progress-bar" class="c-message-banner__progress-bar"
:model="activeModel" :model="activeModel"
/> />
@ -88,7 +88,7 @@ export default {
return { return {
activeModel: { activeModel: {
message: undefined, message: undefined,
progressPerc: undefined, progressPerc: null,
progressText: undefined, progressText: undefined,
minimized: undefined, minimized: undefined,
options: undefined options: undefined
@ -178,7 +178,7 @@ export default {
return; return;
} }
if (this.activeModel.progressPerc !== undefined) { if (this.activeModel.progressPerc !== null) {
maximizedDialog = this.openmct.overlays.progressDialog({ maximizedDialog = this.openmct.overlays.progressDialog({
buttons: [minimizeButton], buttons: [minimizeButton],
...this.activeModel ...this.activeModel