當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript util-ui-service.showNotification函數代碼示例

本文整理匯總了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"
			}
		});
開發者ID:izenda,項目名稱:resources,代碼行數:26,代碼來源:dashboard-storage-service.ts

示例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);
					}
				},
開發者ID:izenda,項目名稱:resources,代碼行數:10,代碼來源:toolbar-component.ts

示例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);
	}
開發者ID:izenda,項目名稱:resources,代碼行數:18,代碼來源:toolbar-component.ts


注:本文中的common/core/services/util-ui-service.showNotification函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。