本文整理匯總了TypeScript中common/core/services/util-ui-service.showNotification函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript showNotification函數的具體用法?TypeScript showNotification怎麽用?TypeScript showNotification使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了showNotification函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
this._loadCategories().then(() => {
if (newLocation.isNew) {
this._newDashboard();
return;
}
// validate report full name:
const wantedFullName = this._getWantedReportFullName(newLocation);
if (!wantedFullName) {
this.navigateNewDashboard(); // change url to "?isNew=1"
return;
}
if (newLocation.fullName === wantedFullName) {
// wanted report and report from the location are the same - open dashboard.
this.loadDashboardInternal(wantedFullName, !!updateFromSource);
} else {
if (newLocation.fullName) {
// show notification to a user if we change the location from wrong report to default.
let message = this.$izendaLocaleService.localeText('js_FailedToLoadDashboard',
'Failed to load dashboard "{0}". Opening default dashboard "{1}".');
message = message.replace('{0}', newLocation.fullName);
message = message.replace('{1}', wantedFullName);
this.$izendaUtilUiService.showNotification(message);
}
this.navigateToDashboard(wantedFullName); // change url to "?rn=default_dashboard"
}
});
示例2:
this.$izendaDashboardStorageService.sendEmail(this.sendEmailState.sendType, this.sendEmailState.email).then(result => {
this.sendEmailState.opened = false;
if (result === 'OK') {
this.$izendaUtilUiService.showNotification(
this.$izendaLocaleService.localeText('js_EmailWasSent', 'Email was sent'));
} else {
const errorText = this.$izendaLocaleService.localeText('js_FailedToSendEmail', 'Failed to send email');
this.$izendaUtilUiService.showErrorDialog(errorText);
}
},
示例3: sendEmail
/**
* Send dashboard via email
*/
sendEmail(type) {
if (type === 'Link') {
if (!this.model.reportFullName) {
const errorText =
this.$izendaLocaleService.localeText('js_CantSendUnsavedLink', 'Cannot email link to unsaved dashboard');
this.$izendaUtilUiService.showNotification(errorText);
return;
}
let redirectUrl =
`?subject=${encodeURIComponent(this.model.reportFullName)}&body=${encodeURIComponent(location.href)}`;
redirectUrl = `mailto:${redirectUrl.replace(/ /g, '%20')}`;
window.top.location.href = redirectUrl;
} else
this.showEmailModal(type);
}