當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。