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


TypeScript util-service.isUncategorized函数代码示例

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


在下文中一共展示了isUncategorized函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getReportFullName

	getReportFullName(reportName: string, reportCategory?: string): string {
		let result = null;
		if (reportName) {
			result = '';
			if (!this.$izendaUtilService.isUncategorized(reportCategory))
				result = reportCategory + this.getCategoryCharacter();
			result += reportName;
		}
		return result;
	}
开发者ID:izenda,项目名称:resources,代码行数:10,代码来源:settings-service.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:

		const category = categories.first(cat => currentCategoryName === cat.name ||
			(this.$izendaUtilService.isUncategorized(currentCategoryName) && this.$izendaUtilService.isUncategorized(cat.name)));
开发者ID:izenda,项目名称:resources,代码行数:2,代码来源:dashboard-storage-service.ts


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