当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript settings-service.getCategoryCharacter函数代码示例

本文整理汇总了TypeScript中common/query/services/settings-service.getCategoryCharacter函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getCategoryCharacter函数的具体用法?TypeScript getCategoryCharacter怎么用?TypeScript getCategoryCharacter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getCategoryCharacter函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: _getWantedReportFullName

	/**
	 * Check report name obtained from the 'rn' parameter and load default dashboard if rn parameter doesn't
	 * contain valid dashboard name.
	 * @param {object} location Location object.
	 * @returns {string} fixed dashboard full name (or empty string if can't find default dashboard).
	 */
	_getWantedReportFullName(location) {
		const urlFullName = location.fullName;
		const categories = this.categories.getValue();
		const isUrlFullNameExist =
			testFullName => categories.some(cat => cat.dashboards.some(dashName => dashName === testFullName));

		// calc current dashboard category
		const currentCategoryName = this._getWantedCategoryName();

		// calc current dashboard full name
		let currentDashboardFullName = '';
		let isCurrentDashbiardNameSet = false;
		if (isUrlFullNameExist(urlFullName)) {
			currentDashboardFullName = urlFullName;
			isCurrentDashbiardNameSet = true;
		}
		if (!isCurrentDashbiardNameSet && this.$izendaDashboardConfig.defaultDashboardName !== null) {
			currentDashboardFullName = this.$izendaDashboardConfig.defaultDashboardName;
			if (currentDashboardFullName && currentCategoryName && !this.$izendaUtilService.isUncategorized(currentCategoryName)) {
				currentDashboardFullName =
					currentCategoryName + this.$izendaSettingsService.getCategoryCharacter() + currentDashboardFullName;
			}
			isCurrentDashbiardNameSet = true;
		}

		// couldn't find dashboard - use first
		if (!isCurrentDashbiardNameSet) {
			const defaultCats = categories.filter(cat => cat.dashboards.length);
			currentDashboardFullName = defaultCats.length ? defaultCats[0].dashboards[0] : '';
		}

		return currentDashboardFullName;
	}
开发者ID:izenda,项目名称:resources,代码行数:39,代码来源:dashboard-storage-service.ts

示例2: getReportSetPreviewQueued

	/**
	 * Run reportSet preview request. If request R2 have come earlier that request R1 - R1 request cancels.
	 */
	getReportSetPreviewQueued(reportSetConfig) {
		this.cancelAllPreviewQueries();
		// prepare params
		const paramsArray = [
			'iic=1', // invalidate in cache
			'urlencoded=true',
			'wscmd=getNewReportSetPreviewFromJson',
			`wsarg0=${encodeURIComponent(JSON.stringify(reportSetConfig))}`
		];
		if (typeof (window.izendaPageId$) !== 'undefined')
			paramsArray.push(`izpid=${window.izendaPageId$}`);
		if (typeof (window.angularPageId$) !== 'undefined')
			paramsArray.push(`anpid=${window.angularPageId$}`);

		const rnParamValue = (reportSetConfig.reportCategory
			? reportSetConfig.reportCategory + this.$izendaSettingsService.getCategoryCharacter() + reportSetConfig.reportName
			: reportSetConfig.reportName);

		var resolver = this.$q.defer();
		const canceller = this.$q.defer();
		const req = {
			method: 'POST',
			url: this.$izendaUrlService.settings.urlRsPage,
			params: { 'rnalt': rnParamValue },
			timeout: canceller.promise,
			dataType: 'text',
			data: paramsArray.join('&'), // query parameters
			headers: {
				'Content-Type': 'text/html'
			}
		};

		// add request to current requests list
		this.requestList.push({
			canceller: canceller,
			resolver: resolver
		});

		const requestPromise = this.$http(req);
		requestPromise
			.then(
				response => resolver.resolve(response.data),
				response => {
					if (response.config.timeout.$$state.value !== 'Cancelled!') {
						//handle errors:
						const errorText = this.$izendaLocaleService.localeText('js_FailedToLoadPreview', 'Failed to load preview.');
						this.$izendaUtilUiService.showErrorDialog(errorText);
						resolver.reject(response.data);
					}
				});
		return resolver.promise;
	}
开发者ID:izenda,项目名称:resources,代码行数:55,代码来源:instant-report-query.ts

示例3: catch

		return this.$q((resolve, reject) => {
			try {

				// prepare report name variables
				let newReportName = reportName || null;
				let newReportCategory = categoryName || null;
				let newReportFullName: string;
				if (this.$izendaUtilService.isUncategorized(newReportCategory))
					newReportCategory = null;
				if (newReportName) {
					// if name was set
					newReportFullName = this.$izendaUtilService.createReportFullName(newReportName,
						this.$izendaSettingsService.getCategoryCharacter(),
						newReportCategory);
				} else {
					// if name wasn't set
					const currentLocation = this.location.getValue();
					newReportName = currentLocation.name;
					newReportCategory = currentLocation.category;
					newReportFullName = currentLocation.fullName;
				}

				// update report names in the model
				const model: IzendaDashboardModel = this.model.getValue();
				model.reportCategory = newReportCategory;
				model.reportName = newReportName;
				model.reportFullName = this.$izendaSettingsService.getReportFullName(newReportName, newReportCategory);

				// create json and send save request
				const json = this.createJsonConfigForSend();
				this.$izendaDashboardQueryService.saveDashboardNew(json).then(() => {
					this.$izendaUrlService.setReportFullName(newReportFullName);
					resolve();
				}, (error) => {
					reject(error);
				});
			} catch (e) {
				reject(e);
			}
		});
开发者ID:izenda,项目名称:resources,代码行数:40,代码来源:dashboard-storage-service.ts

示例4: itemSelectedHandler

	/**
	 * User clicked to report set item
	 */
	itemSelectedHandler(item) {
		const isReportPart = item.isReportPart;
		let reportFullName = item.Name;

		if (item.CategoryFull)
			reportFullName = item.CategoryFull + this.$izendaSettingsService.getCategoryCharacter() + reportFullName;

		if (!isReportPart) {
			// if report set selected
			this.isLoading = true;
			this.groups = [];
			this.$izendaCommonQueryService.getReportParts(reportFullName).then(data => {
				var reports = data.Reports;
				this.addReportPartsToModal(reports);
				this.isLoading = false;
			});
		} else {
			this.openedInner = false;
			// if report part selected
			if (angular.isFunction(this.onSelected))
				this.onSelected({ reportPartInfo: item });
		}
	}
开发者ID:izenda,项目名称:resources,代码行数:26,代码来源:select-report-component.ts

示例5:

			.map<string>(report => {
				const category = report.Category ? report.Category : this.uncategorizedText;
				return !report.Subcategory
					? category
					: category + this.$izendaSettingsService.getCategoryCharacter() + report.Subcategory;
			});
开发者ID:izenda,项目名称:resources,代码行数:6,代码来源:select-report-component.ts


注:本文中的common/query/services/settings-service.getCategoryCharacter函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。