@gooddata/typings
Advanced tools
Comparing version 2.26.0 to 2.26.1-lanhuynh-lhq-sd-xxxx-2020-08-10T08-28-30-173Z
@@ -126,3 +126,4 @@ import { CommandFailed, IObjectMeta, IGdcMessageEvent, IGdcMessageEnvelope, CommandFailedData, GdcProductName, IDrillableItemsCommandBody, EmbeddedGdc } from './common'; | ||
*/ | ||
RemoveFilterContextFinished = "removeFilterContextFinished" | ||
RemoveFilterContextFinished = "removeFilterContextFinished", | ||
EditInsightCancelled = "EditInsightCancelled" | ||
} | ||
@@ -431,3 +432,3 @@ /** | ||
*/ | ||
type RemoveFilterContextCommandData = IGdcAdMessageEnvelope<GdcAdCommandType.RemoveFilterContext, EmbeddedGdc.IFilterContextContent>; | ||
type RemoveFilterContextCommandData = IGdcAdMessageEnvelope<GdcAdCommandType.RemoveFilterContext, EmbeddedGdc.IRemoveFilterContextContent>; | ||
/** | ||
@@ -439,3 +440,3 @@ * Remove the filter context | ||
*/ | ||
type RemoveFilterContextCommand = IGdcAdMessageEvent<GdcAdCommandType.RemoveFilterContext, EmbeddedGdc.IFilterContextContent>; | ||
type RemoveFilterContextCommand = IGdcAdMessageEvent<GdcAdCommandType.RemoveFilterContext, EmbeddedGdc.IRemoveFilterContextContent>; | ||
/** | ||
@@ -442,0 +443,0 @@ * Type-guard checking whether an object is an instance of {@link RemoveFilterContextCommand} |
@@ -112,2 +112,3 @@ "use strict"; | ||
GdcAdEventType["RemoveFilterContextFinished"] = "removeFilterContextFinished"; | ||
GdcAdEventType["EditInsightCancelled"] = "EditInsightCancelled"; | ||
})(GdcAdEventType = EmbeddedAnalyticalDesigner.GdcAdEventType || (EmbeddedAnalyticalDesigner.GdcAdEventType = {})); | ||
@@ -114,0 +115,0 @@ /** |
@@ -179,4 +179,17 @@ import { AFM } from '../AFM'; | ||
type INegativeAttributeFilter = AFM.INegativeAttributeFilter; | ||
type IAbsoluteDateFilter = AFM.IAbsoluteDateFilter; | ||
type IRelativeDateFilter = AFM.IRelativeDateFilter; | ||
interface IAbsoluteDateFilter { | ||
absoluteDateFilter: { | ||
dataSet?: ObjQualifier; | ||
from: string; | ||
to: string; | ||
}; | ||
} | ||
interface IRelativeDateFilter { | ||
relativeDateFilter: { | ||
dataSet?: ObjQualifier; | ||
granularity: string; | ||
from: number; | ||
to: number; | ||
}; | ||
} | ||
type AttributeFilterItem = IPositiveAttributeFilter | INegativeAttributeFilter; | ||
@@ -186,5 +199,13 @@ type DateFilterItem = IAbsoluteDateFilter | IRelativeDateFilter; | ||
type ObjQualifier = AFM.ObjQualifier; | ||
const isDateFilter: typeof AFM.isDateFilter; | ||
const isRelativeDateFilter: typeof AFM.isRelativeDateFilter; | ||
const isAbsoluteDateFilter: typeof AFM.isAbsoluteDateFilter; | ||
type CompatibilityFilter = FilterItem | AFM.IExpressionFilter | AFM.IMeasureValueFilter; | ||
interface IRemoveDateFilterItem { | ||
dataSet: ObjQualifier; | ||
} | ||
interface IRemoveAttributeFilterItem { | ||
displayForm: ObjQualifier; | ||
} | ||
type RemoveFilterItem = IRemoveDateFilterItem | IRemoveAttributeFilterItem; | ||
function isDateFilter(filter: CompatibilityFilter): filter is DateFilterItem; | ||
function isRelativeDateFilter(filter: CompatibilityFilter): filter is IRelativeDateFilter; | ||
function isAbsoluteDateFilter(filter: CompatibilityFilter): filter is IAbsoluteDateFilter; | ||
const isAttributeFilter: typeof AFM.isAttributeFilter; | ||
@@ -202,2 +223,11 @@ const isPositiveAttributeFilter: typeof AFM.isPositiveAttributeFilter; | ||
} | ||
/** | ||
* The remove filter context content that is used to exchange the filter context | ||
* between AD, KD embedded page and parent application | ||
*/ | ||
interface IRemoveFilterContextContent { | ||
filters: RemoveFilterItem[]; | ||
} | ||
function isRemoveDateFilter(filter: any): filter is EmbeddedGdc.IRemoveDateFilterItem; | ||
function isRemoveAttributeFilter(filter: any): filter is EmbeddedGdc.IRemoveAttributeFilterItem; | ||
} |
"use strict"; | ||
exports.__esModule = true; | ||
// (C) 2020 GoodData Corporation | ||
exports.__esModule = true; | ||
var isEmpty = require("lodash/isEmpty"); | ||
var AFM_1 = require("../AFM"); | ||
@@ -74,5 +75,14 @@ /** | ||
(function (EmbeddedGdc) { | ||
EmbeddedGdc.isDateFilter = AFM_1.AFM.isDateFilter; | ||
EmbeddedGdc.isRelativeDateFilter = AFM_1.AFM.isRelativeDateFilter; | ||
EmbeddedGdc.isAbsoluteDateFilter = AFM_1.AFM.isAbsoluteDateFilter; | ||
function isDateFilter(filter) { | ||
return !isEmpty(filter) && (isRelativeDateFilter(filter) || isAbsoluteDateFilter(filter)); | ||
} | ||
EmbeddedGdc.isDateFilter = isDateFilter; | ||
function isRelativeDateFilter(filter) { | ||
return !isEmpty(filter) && filter.relativeDateFilter !== undefined; | ||
} | ||
EmbeddedGdc.isRelativeDateFilter = isRelativeDateFilter; | ||
function isAbsoluteDateFilter(filter) { | ||
return !isEmpty(filter) && filter.absoluteDateFilter !== undefined; | ||
} | ||
EmbeddedGdc.isAbsoluteDateFilter = isAbsoluteDateFilter; | ||
EmbeddedGdc.isAttributeFilter = AFM_1.AFM.isAttributeFilter; | ||
@@ -83,3 +93,11 @@ EmbeddedGdc.isPositiveAttributeFilter = AFM_1.AFM.isPositiveAttributeFilter; | ||
EmbeddedGdc.isObjectUriQualifier = AFM_1.AFM.isObjectUriQualifier; | ||
function isRemoveDateFilter(filter) { | ||
return !isEmpty(filter) && filter.dataSet !== undefined; | ||
} | ||
EmbeddedGdc.isRemoveDateFilter = isRemoveDateFilter; | ||
function isRemoveAttributeFilter(filter) { | ||
return !isEmpty(filter) && filter.displayForm !== undefined; | ||
} | ||
EmbeddedGdc.isRemoveAttributeFilter = isRemoveAttributeFilter; | ||
})(EmbeddedGdc = exports.EmbeddedGdc || (exports.EmbeddedGdc = {})); | ||
//# sourceMappingURL=common.js.map |
@@ -58,3 +58,7 @@ import { IGdcMessageEvent, GdcProductName, IGdcMessageEnvelope, IDrillableItemsCommandBody, EmbeddedGdc } from './common'; | ||
*/ | ||
RemoveFilterContext = "removeFilterContext" | ||
RemoveFilterContext = "removeFilterContext", | ||
/** | ||
* The command to duplicate a KPI Dashboard | ||
*/ | ||
SaveAsDashboard = "saveAsDashboard" | ||
} | ||
@@ -207,2 +211,28 @@ /** | ||
/** | ||
* Creates a new dashboard from an existing dashboard | ||
* | ||
* Contract: | ||
* | ||
* - if KD saves as new an existing dashboard in view mode, the DashboardSaved event will be posted, | ||
* the new duplicated dashboard doesn't apply changes from the filter bar. | ||
* | ||
* - if KD saves as new an existing dashboard in edit mode, the DashboardSaved event will be posted, | ||
* the new duplicated dashboard applies all changes from the existing dashboard like | ||
* title, filter context, insight widgets, layout... | ||
* | ||
* - if KD saves as new an existing dashboard in the locked dashboard but the user can create new dashboard, | ||
* the DashboardSaved event will be posted, the new duplicated dashboard won't be locked. | ||
* | ||
* - if KD doesn't have an existing dashboard, no permission to create dashboard or the title is empty, | ||
* CommandFailed is posted | ||
*/ | ||
type SaveAsDashboardCommand = IGdcKdMessageEvent<GdcKdCommandType.SaveAsDashboard, IKdSaveCommandBody>; | ||
type SaveAsDashboardCommandData = IGdcKdMessageEnvelope<GdcKdCommandType.SaveAsDashboard, IKdSaveCommandBody>; | ||
/** | ||
* Type-guard checking whether object is an instance of {@link SaveAsDashboardCommandData}. | ||
* | ||
* @param obj - object to test | ||
*/ | ||
function isSaveAsDashboardCommandData(obj: any): obj is SaveAsDashboardCommandData; | ||
/** | ||
* Cancels editing and switches dashboard to view mode. | ||
@@ -319,3 +349,3 @@ * | ||
*/ | ||
type RemoveFilterContextCommandData = IGdcKdMessageEnvelope<GdcKdCommandType.RemoveFilterContext, EmbeddedGdc.IFilterContextContent>; | ||
type RemoveFilterContextCommandData = IGdcKdMessageEnvelope<GdcKdCommandType.RemoveFilterContext, EmbeddedGdc.IRemoveFilterContextContent>; | ||
/** | ||
@@ -327,3 +357,3 @@ * Remove the filter context | ||
*/ | ||
type RemoveFilterContextCommand = IGdcKdMessageEvent<GdcKdCommandType.RemoveFilterContext, EmbeddedGdc.IFilterContextContent>; | ||
type RemoveFilterContextCommand = IGdcKdMessageEvent<GdcKdCommandType.RemoveFilterContext, EmbeddedGdc.IRemoveFilterContextContent>; | ||
/** | ||
@@ -330,0 +360,0 @@ * Type-guard checking whether an object is an instance of {@link RemoveFilterContextCommand} |
@@ -56,2 +56,6 @@ "use strict"; | ||
GdcKdCommandType["RemoveFilterContext"] = "removeFilterContext"; | ||
/** | ||
* The command to duplicate a KPI Dashboard | ||
*/ | ||
GdcKdCommandType["SaveAsDashboard"] = "saveAsDashboard"; | ||
})(GdcKdCommandType = EmbeddedKpiDashboard.GdcKdCommandType || (EmbeddedKpiDashboard.GdcKdCommandType = {})); | ||
@@ -172,2 +176,11 @@ /** | ||
/** | ||
* Type-guard checking whether object is an instance of {@link SaveAsDashboardCommandData}. | ||
* | ||
* @param obj - object to test | ||
*/ | ||
function isSaveAsDashboardCommandData(obj) { | ||
return common_1.getEventType(obj) === GdcKdCommandType.SaveAsDashboard; | ||
} | ||
EmbeddedKpiDashboard.isSaveAsDashboardCommandData = isSaveAsDashboardCommandData; | ||
/** | ||
* Type-guard checking whether object is an instance of {@link CancelEditData}. | ||
@@ -174,0 +187,0 @@ * |
{ | ||
"name": "@gooddata/typings", | ||
"version": "2.26.0", | ||
"version": "2.26.1-lanhuynh-lhq-sd-xxxx-2020-08-10T08-28-30-173Z", | ||
"description": "TypeScript definition files for GoodData platform", | ||
@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
358037
6162
1