Ejemplo n.º 1
0
		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"
			}
		});
Ejemplo n.º 2
0
				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);
					}
				},
Ejemplo n.º 3
0
	/**
	 * 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);
	}
Ejemplo n.º 4
0
				.then(() => {
					this.$izendaUtilUiService.showNotification(this.$izendaLocaleService.localeText('js_DashboardSaved',
						'Dashboard sucessfully saved'));
				},