@reltio/components 1.4.1806-hf → 1.4.1824-hf-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/AttributesFiltersBuilder/helpers.d.ts +1 -1
- package/cjs/components/BasicTableView/BasicTablePagination/BasicTablePagination.d.ts +1 -1
- package/cjs/components/ProfileBandNavigation/ProfileBandNavigationWidget.d.ts +1 -1
- package/cjs/components/RelationEditor/RelationEditor.js +24 -6
- package/cjs/components/attributes/PivotingAttributes/PivotingTooltip.js +4 -3
- package/cjs/components/attributes/PivotingAttributes/PivotingTooltipContent.d.ts +2 -4
- package/cjs/components/attributes/PivotingAttributes/PivotingTooltipContent.js +3 -3
- package/cjs/components/charts/BarChart/BarChart.d.ts +1 -4
- package/cjs/components/charts/BarChart/getBarChartSettings.d.ts +1 -1
- package/cjs/components/charts/BubbleChart/BubbleChart.d.ts +5 -19
- package/cjs/components/charts/ChartsFactory.d.ts +3 -1
- package/cjs/components/charts/ChartsFactory.js +12 -13
- package/cjs/components/charts/CloudChart/CloudChart.d.ts +5 -11
- package/cjs/components/charts/LineChart/LineChart.d.ts +1 -4
- package/cjs/components/charts/LineChart/getLineChartSettings.d.ts +1 -1
- package/cjs/components/charts/MapChart/MapChart.d.ts +5 -17
- package/cjs/components/charts/MapChart/MapChart.js +2 -2
- package/cjs/components/charts/PieChart/PieChart.d.ts +6 -18
- package/cjs/components/charts/TableWithBars/TableWithBars.d.ts +2 -6
- package/cjs/components/charts/TreeChart/TreeChart.d.ts +2 -2
- package/cjs/components/charts/types/charts.d.ts +51 -0
- package/cjs/components/charts/types/index.d.ts +1 -5
- package/cjs/components/crosswalks/hooks/useAttributeActions.js +7 -8
- package/cjs/components/history/HistoryTree/styles.d.ts +1 -1
- package/cjs/components/history/hooks/useHistoryDiff.js +4 -0
- package/cjs/components/history/hooks/useHistorySlice.js +8 -0
- package/cjs/contexts/ConfigPermissionsContext/index.d.ts +2 -2
- package/cjs/contexts/MdmModuleContext/context.d.ts +7 -5
- package/cjs/contexts/MdmModuleContext/hooks.d.ts +2 -1
- package/cjs/hooks/usePivotingDataLoader/usePivotingDataLoader.d.ts +2 -4
- package/cjs/hooks/usePivotingDataLoader/usePivotingDataLoader.js +5 -5
- package/cjs/hooks/useRelationsLoader.d.ts +1 -1
- package/esm/components/AttributesFiltersBuilder/helpers.d.ts +1 -1
- package/esm/components/BasicTableView/BasicTablePagination/BasicTablePagination.d.ts +1 -1
- package/esm/components/ProfileBandNavigation/ProfileBandNavigationWidget.d.ts +1 -1
- package/esm/components/RelationEditor/RelationEditor.js +27 -9
- package/esm/components/attributes/PivotingAttributes/PivotingTooltip.js +4 -3
- package/esm/components/attributes/PivotingAttributes/PivotingTooltipContent.d.ts +2 -4
- package/esm/components/attributes/PivotingAttributes/PivotingTooltipContent.js +3 -3
- package/esm/components/charts/BarChart/BarChart.d.ts +1 -4
- package/esm/components/charts/BarChart/getBarChartSettings.d.ts +1 -1
- package/esm/components/charts/BubbleChart/BubbleChart.d.ts +5 -19
- package/esm/components/charts/ChartsFactory.d.ts +3 -1
- package/esm/components/charts/ChartsFactory.js +13 -14
- package/esm/components/charts/CloudChart/CloudChart.d.ts +5 -11
- package/esm/components/charts/LineChart/LineChart.d.ts +1 -4
- package/esm/components/charts/LineChart/getLineChartSettings.d.ts +1 -1
- package/esm/components/charts/MapChart/MapChart.d.ts +5 -17
- package/esm/components/charts/MapChart/MapChart.js +2 -2
- package/esm/components/charts/PieChart/PieChart.d.ts +6 -18
- package/esm/components/charts/TableWithBars/TableWithBars.d.ts +2 -6
- package/esm/components/charts/TreeChart/TreeChart.d.ts +2 -2
- package/esm/components/charts/types/charts.d.ts +51 -0
- package/esm/components/charts/types/index.d.ts +1 -5
- package/esm/components/crosswalks/hooks/useAttributeActions.js +9 -10
- package/esm/components/history/HistoryTree/styles.d.ts +1 -1
- package/esm/components/history/hooks/useHistoryDiff.js +4 -0
- package/esm/components/history/hooks/useHistorySlice.js +10 -2
- package/esm/contexts/ConfigPermissionsContext/index.d.ts +2 -2
- package/esm/contexts/MdmModuleContext/context.d.ts +7 -5
- package/esm/contexts/MdmModuleContext/hooks.d.ts +2 -1
- package/esm/hooks/usePivotingDataLoader/usePivotingDataLoader.d.ts +2 -4
- package/esm/hooks/usePivotingDataLoader/usePivotingDataLoader.js +5 -5
- package/esm/hooks/useRelationsLoader.d.ts +1 -1
- package/package.json +2 -2
- package/cjs/components/charts/types/BarChartOptions.d.ts +0 -7
- package/cjs/components/charts/types/ChartData.d.ts +0 -7
- package/cjs/components/charts/types/ChartData.js +0 -2
- package/cjs/components/charts/types/ChartProps.d.ts +0 -7
- package/cjs/components/charts/types/ChartProps.js +0 -2
- package/cjs/components/charts/types/LineChartOptions.d.ts +0 -6
- package/cjs/components/charts/types/LineChartOptions.js +0 -2
- package/cjs/components/charts/types/TableWithBarsOptions.d.ts +0 -4
- package/cjs/components/charts/types/TableWithBarsOptions.js +0 -2
- package/esm/components/charts/types/BarChartOptions.d.ts +0 -7
- package/esm/components/charts/types/ChartData.d.ts +0 -7
- package/esm/components/charts/types/ChartData.js +0 -1
- package/esm/components/charts/types/ChartProps.d.ts +0 -7
- package/esm/components/charts/types/ChartProps.js +0 -1
- package/esm/components/charts/types/LineChartOptions.d.ts +0 -6
- package/esm/components/charts/types/LineChartOptions.js +0 -1
- package/esm/components/charts/types/TableWithBarsOptions.d.ts +0 -4
- package/esm/components/charts/types/TableWithBarsOptions.js +0 -1
- /package/cjs/components/charts/types/{BarChartOptions.js → charts.js} +0 -0
- /package/esm/components/charts/types/{BarChartOptions.js → charts.js} +0 -0
|
@@ -8,6 +8,6 @@ export declare const getRowsDataFromFilters: (filters: SearchFilter[], attribute
|
|
|
8
8
|
filter: string;
|
|
9
9
|
operator: import("@reltio/mdm-sdk").SearchOperator;
|
|
10
10
|
id: number;
|
|
11
|
-
values:
|
|
11
|
+
values: import("@reltio/mdm-sdk").SearchValue[];
|
|
12
12
|
}[];
|
|
13
13
|
export declare const getEntityTypeFromAttrTypes: (attributeTypes: AttributeType[]) => any;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { TablePaginationProps } from '@mui/material/TablePagination';
|
|
3
3
|
type BasicTablePaginationProps = {
|
|
4
4
|
classes?: TablePaginationProps['classes'];
|
|
5
|
-
basicTableRef?: React.
|
|
5
|
+
basicTableRef?: React.RefObject<HTMLElement>;
|
|
6
6
|
count?: number;
|
|
7
7
|
page?: number;
|
|
8
8
|
rowsPerPage?: number;
|
|
@@ -17,7 +17,7 @@ declare const LinkWithTooltip: React.ForwardRefExoticComponent<import("prop-type
|
|
|
17
17
|
variant?: import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides>;
|
|
18
18
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof React.AnchorHTMLAttributes<HTMLAnchorElement>> & {
|
|
19
19
|
ref?: React.Ref<HTMLAnchorElement>;
|
|
20
|
-
}, "m" | "id" | "type" | "hidden" | "visibility" | "title" | "key" | "children" | "defaultValue" | "prefix" | "order" | "width" | "minHeight" | "maxHeight" | "height" | "flex" | "minWidth" | "maxWidth" | "top" | "right" | "left" | "position" | "referrerPolicy" | "results" | "p" | "slot" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "translate" | "whiteSpace" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "
|
|
20
|
+
}, "m" | "id" | "type" | "hidden" | "visibility" | "title" | "key" | "children" | "defaultValue" | "prefix" | "order" | "width" | "minHeight" | "maxHeight" | "height" | "flex" | "minWidth" | "maxWidth" | "top" | "right" | "left" | "margin" | "position" | "referrerPolicy" | "results" | "p" | "slot" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "translate" | "whiteSpace" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "overflow" | "padding" | "underline" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | "lang" | "media" | "target" | "role" | "tabIndex" | "href" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "security" | "unselectable" | "inputMode" | "is" | "hrefLang" | "rel" | "download" | "ping" | "align" | "variant" | "bgcolor" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "noWrap" | "gutterBottom" | "paragraph" | "variantMapping" | "TypographyClasses"> & {
|
|
21
21
|
component: string;
|
|
22
22
|
}>;
|
|
23
23
|
type Props = {
|
|
@@ -85,13 +85,17 @@ var RelationEditor = function (_a) {
|
|
|
85
85
|
var globalSearchRequestOptions = (0, contexts_1.useMdmGlobalSearchRequestOptions)(['ovOnly']);
|
|
86
86
|
var profileErrors = (0, contexts_1.useMdmProfileErrors)();
|
|
87
87
|
var authoringItems = (0, contexts_1.useMdmAuthoringItemsByEntityType)(mainEntity === null || mainEntity === void 0 ? void 0 : mainEntity.type);
|
|
88
|
+
var mainEntityUri = (0, contexts_1.useMdmEntityUri)();
|
|
88
89
|
var error = (0, mdm_sdk_1.getRelationEditorActiveError)(connection, profileErrors);
|
|
90
|
+
var allRelationEditorErrors = (0, mdm_sdk_1.getAllRelationEditorActiveErrors)(connection, profileErrors);
|
|
89
91
|
var modifiedEntity = isTempEntity ? mdmModifiedEntity : null;
|
|
90
92
|
var allModifiedEntities = isTempEntity ? mdmAllModifiedEntities : null;
|
|
91
93
|
var _d = (0, hooks_1.useScrollToAttributeError)({ highlightedError: highlightedError, isSimple: true }), ref = _d.ref, errorClassName = _d.errorClassName;
|
|
92
94
|
var _e = (0, react_1.useMemo)(function () {
|
|
93
95
|
return (0, mdm_sdk_1.getInOutRelations)({
|
|
94
|
-
content: connection.parentEntityUri
|
|
96
|
+
content: connection.parentEntityUri
|
|
97
|
+
? config.contentSecondLevel
|
|
98
|
+
: config.content,
|
|
95
99
|
direction: direction,
|
|
96
100
|
relationType: relationType,
|
|
97
101
|
mode: mode,
|
|
@@ -144,11 +148,15 @@ var RelationEditor = function (_a) {
|
|
|
144
148
|
}
|
|
145
149
|
}, [config.id, relationUri, setRelationEntity, errorDeactivated, modifiedEntity, deleteModifiedEntity, error]);
|
|
146
150
|
var validate = (0, react_1.useCallback)(function () {
|
|
147
|
-
var errors = (0, mdm_sdk_1.validateConnection)(metadata, allModifiedEntities, connection)
|
|
151
|
+
var errors = (0, mdm_sdk_1.validateConnection)(metadata, allModifiedEntities, connection).map(function (error) { return (__assign(__assign({}, error), { path: (0, ramda_1.pipe)(mdm_sdk_1.evaluateErrorPath, (0, ramda_1.map)((0, ramda_1.when)((0, ramda_1.propEq)('type', mdm_sdk_1.AttributeValuePathItemType.relationConnection), (0, ramda_1.assoc)('viewId', config.id))))({
|
|
152
|
+
entityUri: mainEntityUri,
|
|
153
|
+
metadata: metadata,
|
|
154
|
+
connections: [connection],
|
|
155
|
+
entitiesMap: allModifiedEntities || {}
|
|
156
|
+
}, error.uri || error.parentUri) })); });
|
|
148
157
|
errorsSet(errors);
|
|
149
158
|
return errors.length === 0;
|
|
150
|
-
}, [connection, metadata, allModifiedEntities, errorsSet]);
|
|
151
|
-
var resetErrors = (0, react_1.useCallback)(function () { return errorsSet([]); }, [errorsSet]);
|
|
159
|
+
}, [connection, metadata, allModifiedEntities, errorsSet, mainEntityUri, config]);
|
|
152
160
|
var onApply = (0, react_1.useCallback)((0, ramda_1.pipe)((0, ramda_1.always)(connection), (0, ramda_1.when)(validate, (0, ramda_1.pipe)(mdm_sdk_1.omitMarks, updateModifiedEntityLabel, applyAction(config.id), (0, ramda_1.always)((0, ramda_1.differenceWith)(ramda_1.equals, relatedTempEntitiesUrisHistory.current, relatedTempEntities.map((0, ramda_1.prop)('uri')))), (0, ramda_1.forEach)(deleteModifiedEntity), handleClose))), [connection, config, updateModifiedEntityLabel, validate, relatedTempEntities]);
|
|
153
161
|
var onCancel = (0, react_1.useCallback)(function () {
|
|
154
162
|
if (modifiedEntity !== initialModifiedEntity) {
|
|
@@ -166,9 +174,19 @@ var RelationEditor = function (_a) {
|
|
|
166
174
|
var entitiesUrisToDelete = (0, ramda_1.differenceWith)(ramda_1.equals, relatedTempEntitiesUrisHistory.current, initialTempEntities.map((0, ramda_1.prop)('uri')));
|
|
167
175
|
entitiesUrisToDelete.forEach(deleteModifiedEntity);
|
|
168
176
|
initialTempEntities.forEach(setModifiedEntity);
|
|
169
|
-
|
|
177
|
+
var filteredErrors = profileErrors.filter(function (profileError) { return !allRelationEditorErrors.some(function (error) { return (0, mdm_sdk_1.getErrorId)(error) === (0, mdm_sdk_1.getErrorId)(profileError); }); });
|
|
178
|
+
errorsSet(filteredErrors);
|
|
170
179
|
handleClose();
|
|
171
|
-
}, [
|
|
180
|
+
}, [
|
|
181
|
+
handleClose,
|
|
182
|
+
setModifiedEntity,
|
|
183
|
+
deleteModifiedEntity,
|
|
184
|
+
modifiedEntity,
|
|
185
|
+
initialModifiedEntity,
|
|
186
|
+
allRelationEditorErrors,
|
|
187
|
+
errorsSet,
|
|
188
|
+
profileErrors
|
|
189
|
+
]);
|
|
172
190
|
var onAddAttributes = (0, react_1.useCallback)(function (params) { return addAttributes(params.map(function (param) { return (__assign(__assign({}, param), { viewId: config.id })); })); }, [config.id, addAttributes]);
|
|
173
191
|
var onChangeAttribute = (0, react_1.useCallback)(function (params) { return modifyAttribute(__assign(__assign({}, params), { viewId: config.id })); }, [config.id, modifyAttribute]);
|
|
174
192
|
var onDeleteAttribute = (0, react_1.useCallback)(function (params) { return removeAttribute(__assign(__assign({}, params), { viewId: config.id })); }, [config.id, removeAttribute]);
|
|
@@ -59,6 +59,7 @@ var PivotingTooltip = function (_a) {
|
|
|
59
59
|
var uri = _a.uri;
|
|
60
60
|
return uri === attributeType.uri;
|
|
61
61
|
});
|
|
62
|
+
var popupConfiguration = pivotingAttribute === null || pivotingAttribute === void 0 ? void 0 : pivotingAttribute.popup;
|
|
62
63
|
var convertPivotingValue = function () {
|
|
63
64
|
return Array.isArray(pivotingValue)
|
|
64
65
|
? (0, helpers_1.convertNestedAttributePivotingValue)(pivotingValue)
|
|
@@ -69,11 +70,11 @@ var PivotingTooltip = function (_a) {
|
|
|
69
70
|
openPivotingPerspective({ value: generatedValue, attributeType: attributeType });
|
|
70
71
|
};
|
|
71
72
|
var _b = (0, usePivotingDataLoader_1.usePivotingDataLoader)({
|
|
72
|
-
value: pivotingValue,
|
|
73
73
|
attributeType: attributeType,
|
|
74
|
-
|
|
74
|
+
value: pivotingValue,
|
|
75
|
+
entityType: popupConfiguration === null || popupConfiguration === void 0 ? void 0 : popupConfiguration.entityType
|
|
75
76
|
}), entities = _b.entities, total = _b.total, loadPivotingData = _b.loadPivotingData;
|
|
76
|
-
return isPivotingAttribute ? (react_1.default.createElement(Tooltip_1.default, { arrow: true, placement: "right-start", classes: styles, disableInteractive: false, onOpen: loadPivotingData, title: react_1.default.createElement(PivotingTooltipContent_1.PivotingTooltipContent, { generatedValue: generatedValue, attributeType: attributeType,
|
|
77
|
+
return isPivotingAttribute ? (react_1.default.createElement(Tooltip_1.default, { arrow: true, placement: "right-start", classes: styles, disableInteractive: false, onOpen: loadPivotingData, title: react_1.default.createElement(PivotingTooltipContent_1.PivotingTooltipContent, { generatedValue: generatedValue, attributeType: attributeType, label: popupConfiguration === null || popupConfiguration === void 0 ? void 0 : popupConfiguration.label, onSeeAllClick: handleSeeAllClick, entities: entities, total: total }) },
|
|
77
78
|
react_1.default.createElement("span", { className: className },
|
|
78
79
|
react_1.default.createElement(PivotingIcon_1.default, { className: contentStyles.icon }),
|
|
79
80
|
react_1.default.createElement(PivotingUriLink_1.default, { onClick: handleSeeAllClick, className: contentStyles.content, value: generatedValue, attributeType: attributeType }, children)))) : (react_1.default.createElement(react_1.default.Fragment, null, children));
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
import { AttributeType, Entity, PivotingValue } from '@reltio/mdm-sdk';
|
|
3
3
|
export type Props = {
|
|
4
4
|
attributeType: AttributeType;
|
|
5
|
-
|
|
6
|
-
label?: string;
|
|
7
|
-
};
|
|
5
|
+
label?: string;
|
|
8
6
|
entities: Entity[];
|
|
9
7
|
generatedValue: PivotingValue[];
|
|
10
8
|
onSeeAllClick: () => void;
|
|
11
9
|
total: number;
|
|
12
10
|
};
|
|
13
|
-
export declare const PivotingTooltipContent: ({ attributeType,
|
|
11
|
+
export declare const PivotingTooltipContent: ({ attributeType, label, entities, generatedValue, onSeeAllClick, total }: Props) => JSX.Element;
|
|
@@ -13,16 +13,16 @@ var PivotingUriLink_1 = __importDefault(require("../../PivotingUriLink/PivotingU
|
|
|
13
13
|
var usePivotingDataLoader_1 = require("../../../hooks/usePivotingDataLoader/usePivotingDataLoader");
|
|
14
14
|
var styles_1 = require("./styles");
|
|
15
15
|
var PivotingTooltipContent = function (_a) {
|
|
16
|
-
var attributeType = _a.attributeType,
|
|
16
|
+
var attributeType = _a.attributeType, label = _a.label, entities = _a.entities, generatedValue = _a.generatedValue, onSeeAllClick = _a.onSeeAllClick, total = _a.total;
|
|
17
17
|
var styles = (0, styles_1.useStyles)();
|
|
18
18
|
var shouldShowSeeAllButton = total > usePivotingDataLoader_1.MAX_ENTITIES_PIVOTING_TOOLTIP;
|
|
19
|
-
var hasEntityTypeLabel = Boolean(
|
|
19
|
+
var hasEntityTypeLabel = Boolean(label);
|
|
20
20
|
return (react_1.default.createElement("div", { className: styles.container },
|
|
21
21
|
react_1.default.createElement("div", { className: styles.header },
|
|
22
22
|
react_1.default.createElement("div", { className: styles.title }, ui_i18n_1.default.text('Pivot profiles')),
|
|
23
23
|
react_1.default.createElement("div", { className: styles.divider }),
|
|
24
24
|
react_1.default.createElement("div", { className: styles.headerCount }, ui_i18n_1.default.number(total, '0,0') + ' ' + (total === 1 ? ui_i18n_1.default.text('item') : ui_i18n_1.default.text('items')))),
|
|
25
|
-
hasEntityTypeLabel && react_1.default.createElement("div", { className: styles.entityTypeLabel },
|
|
25
|
+
hasEntityTypeLabel && react_1.default.createElement("div", { className: styles.entityTypeLabel }, label),
|
|
26
26
|
react_1.default.createElement("div", { className: styles.body }, entities.map(function (visibleEntity) { return (react_1.default.createElement("div", { key: visibleEntity.uri, className: styles.entityContainer },
|
|
27
27
|
react_1.default.createElement(EntityAvatar_1.default, { entity: visibleEntity, avatarClassName: styles.profileIcon }),
|
|
28
28
|
react_1.default.createElement(EntityUriLink_1.default, { className: styles.entityLabel, value: (0, mdm_sdk_1.getEntityUriForLink)(visibleEntity) }, (0, mdm_sdk_1.getLabel)(visibleEntity.label)))); })),
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
type BarChartProps = ChartProps & {
|
|
4
|
-
options?: BarChartOptions;
|
|
5
|
-
};
|
|
2
|
+
import { BarChartProps } from '../types';
|
|
6
3
|
declare const BarChart: ({ width, height, data, options, onItemClick }: BarChartProps) => JSX.Element;
|
|
7
4
|
export default BarChart;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BarChart, BarProps, CartesianGridProps, TooltipProps, XAxisProps, YAxisProps } from 'recharts';
|
|
3
|
-
import { BarChartOptions } from '
|
|
3
|
+
import { BarChartOptions } from '@reltio/mdm-sdk';
|
|
4
4
|
type BarChartSettings = {
|
|
5
5
|
barChart: React.ComponentProps<typeof BarChart>;
|
|
6
6
|
bar: Omit<BarProps, 'ref'>;
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type Props = ChartProps & {
|
|
5
|
-
options?: {
|
|
6
|
-
showLegend?: boolean;
|
|
7
|
-
margin?: LegendProps['margin'];
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export declare const BubbleChart: ({ width, height, data, options, onItemClick }: Props) => JSX.Element;
|
|
2
|
+
import { BubbleChartProps } from '../types';
|
|
3
|
+
export declare const BubbleChart: ({ width, height, data, options, onItemClick }: BubbleChartProps) => JSX.Element;
|
|
11
4
|
declare const _default: {
|
|
12
|
-
({ data, ...otherProps }:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
margin?: {
|
|
16
|
-
top?: number;
|
|
17
|
-
left?: number;
|
|
18
|
-
bottom?: number;
|
|
19
|
-
right?: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
5
|
+
({ data, ...otherProps }: import("../types/charts").BaseChartProps & {
|
|
6
|
+
chartType?: import("@reltio/mdm-sdk").ChartType.BUBBLE;
|
|
7
|
+
options?: import("@reltio/mdm-sdk").BubbleChartOptions;
|
|
22
8
|
}): JSX.Element;
|
|
23
9
|
displayName: string;
|
|
24
10
|
};
|
|
@@ -27,26 +27,25 @@ var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
|
27
27
|
var ChartsFactory = /** @class */ (function () {
|
|
28
28
|
function ChartsFactory() {
|
|
29
29
|
}
|
|
30
|
-
ChartsFactory.build = function (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
case mdm_sdk_1.ChartTypes.BAR:
|
|
30
|
+
ChartsFactory.build = function (props) {
|
|
31
|
+
switch (props.chartType) {
|
|
32
|
+
case mdm_sdk_1.ChartType.BAR:
|
|
34
33
|
return react_1.default.createElement(BarChart_1.default, __assign({}, props));
|
|
35
|
-
case mdm_sdk_1.
|
|
36
|
-
return react_1.default.createElement(PieChart_1.default, __assign({
|
|
37
|
-
case mdm_sdk_1.
|
|
34
|
+
case mdm_sdk_1.ChartType.DONUT:
|
|
35
|
+
return react_1.default.createElement(PieChart_1.default, __assign({ isDonut: true }, props));
|
|
36
|
+
case mdm_sdk_1.ChartType.PIE:
|
|
38
37
|
return react_1.default.createElement(PieChart_1.default, __assign({}, props));
|
|
39
|
-
case mdm_sdk_1.
|
|
38
|
+
case mdm_sdk_1.ChartType.TREE:
|
|
40
39
|
return react_1.default.createElement(TreeChart_1.default, __assign({}, props));
|
|
41
|
-
case mdm_sdk_1.
|
|
40
|
+
case mdm_sdk_1.ChartType.TABLE:
|
|
42
41
|
return react_1.default.createElement(TableWithBars_1.default, __assign({}, props));
|
|
43
|
-
case mdm_sdk_1.
|
|
42
|
+
case mdm_sdk_1.ChartType.BUBBLE:
|
|
44
43
|
return react_1.default.createElement(BubbleChart_1.default, __assign({}, props));
|
|
45
|
-
case mdm_sdk_1.
|
|
44
|
+
case mdm_sdk_1.ChartType.LINE:
|
|
46
45
|
return react_1.default.createElement(LineChart_1.default, __assign({}, props));
|
|
47
|
-
case mdm_sdk_1.
|
|
46
|
+
case mdm_sdk_1.ChartType.MAP:
|
|
48
47
|
return react_1.default.createElement(MapChart_1.default, __assign({}, props));
|
|
49
|
-
case mdm_sdk_1.
|
|
48
|
+
case mdm_sdk_1.ChartType.CLOUD:
|
|
50
49
|
return react_1.default.createElement(CloudChart_1.default, __assign({}, props));
|
|
51
50
|
default:
|
|
52
51
|
return react_1.default.createElement("div", null);
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
options?: {
|
|
5
|
-
maxFontSize?: number;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export declare const CloudChart: ({ width, height, data, options, onItemClick }: Props) => JSX.Element;
|
|
2
|
+
import { CloudChartProps } from '../types';
|
|
3
|
+
export declare const CloudChart: ({ width, height, data, options, onItemClick }: CloudChartProps) => JSX.Element;
|
|
9
4
|
declare const _default: {
|
|
10
|
-
({ data, ...otherProps }:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
5
|
+
({ data, ...otherProps }: import("../types/charts").BaseChartProps & {
|
|
6
|
+
chartType?: import("@reltio/mdm-sdk").ChartType.CLOUD;
|
|
7
|
+
options?: import("@reltio/mdm-sdk").CloudChartOptions;
|
|
14
8
|
}): JSX.Element;
|
|
15
9
|
displayName: string;
|
|
16
10
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
type LineChartProps = ChartProps & {
|
|
4
|
-
options?: LineChartOptions;
|
|
5
|
-
};
|
|
2
|
+
import { LineChartProps } from '../types';
|
|
6
3
|
declare const LineChart: ({ width, height, data, options, onItemClick }: LineChartProps) => JSX.Element;
|
|
7
4
|
export default LineChart;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { LineChartOptions } from '@reltio/mdm-sdk';
|
|
2
3
|
import { CartesianGridProps, LineChart, LineProps, TooltipProps, XAxisProps, YAxisProps } from 'recharts';
|
|
3
|
-
import { LineChartOptions } from '../types/LineChartOptions';
|
|
4
4
|
type LineChartSettings = {
|
|
5
5
|
lineChart: React.ComponentProps<typeof LineChart>;
|
|
6
6
|
xAxis: XAxisProps;
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
type Props = ChartProps & {
|
|
4
|
-
options?: {
|
|
5
|
-
geoUrl?: string;
|
|
6
|
-
projection?: string;
|
|
7
|
-
geoIdName?: string;
|
|
8
|
-
showLegend?: boolean;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
2
|
+
import { MapChartProps } from '../types';
|
|
11
3
|
export declare const LEGEND_WIDTH = 75;
|
|
12
|
-
export declare const MapChart: ({ data, width, height, options, onItemClick }:
|
|
4
|
+
export declare const MapChart: ({ data, width, height, options, onItemClick }: MapChartProps) => JSX.Element;
|
|
13
5
|
declare const _default: {
|
|
14
|
-
({ data, ...otherProps }:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
projection?: string;
|
|
18
|
-
geoIdName?: string;
|
|
19
|
-
showLegend?: boolean;
|
|
20
|
-
};
|
|
6
|
+
({ data, ...otherProps }: import("../types/charts").BaseChartProps & {
|
|
7
|
+
chartType?: import("@reltio/mdm-sdk").ChartType.MAP;
|
|
8
|
+
options?: import("@reltio/mdm-sdk").MapChartOptions;
|
|
21
9
|
}): JSX.Element;
|
|
22
10
|
displayName: string;
|
|
23
11
|
};
|
|
@@ -59,9 +59,9 @@ var USA_MAP = 'https://s3.amazonaws.com/reltio-ui-files/map_resources/us-albers.
|
|
|
59
59
|
var MAP_COLORS = ['#CDE0FE', '#0160AD'];
|
|
60
60
|
exports.LEGEND_WIDTH = 75;
|
|
61
61
|
var MapChart = function (_a) {
|
|
62
|
-
var data = _a.data, width = _a.width, height = _a.height,
|
|
62
|
+
var data = _a.data, width = _a.width, height = _a.height, _b = _a.options, options = _b === void 0 ? {} : _b, onItemClick = _a.onItemClick;
|
|
63
63
|
var styles = (0, styles_1.useStyles)();
|
|
64
|
-
var
|
|
64
|
+
var geoUrl = options.geoUrl, geoIdName = options.geoIdName, _c = options.showLegend, showLegend = _c === void 0 ? true : _c;
|
|
65
65
|
var values = (0, ramda_1.pluck)('value', data);
|
|
66
66
|
var minValue = Math.min.apply(Math, values);
|
|
67
67
|
var maxValue = Math.max.apply(Math, values);
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type Props = ChartProps & {
|
|
5
|
-
options?: {
|
|
6
|
-
margin?: React.ComponentProps<typeof PieChartWidget>['margin'];
|
|
7
|
-
showLegend?: boolean;
|
|
8
|
-
showActiveShape?: boolean;
|
|
9
|
-
};
|
|
10
|
-
isDonut?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const PieChart: ({ width, height, data, options, isDonut, onItemClick }: Props) => JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PieChartProps } from '../types';
|
|
3
|
+
export declare const PieChart: ({ width, height, data, options, isDonut, onItemClick }: PieChartProps) => JSX.Element;
|
|
13
4
|
declare const _default: {
|
|
14
|
-
({ data, ...otherProps }:
|
|
15
|
-
|
|
16
|
-
margin?: import("recharts/types/util/types").Margin;
|
|
17
|
-
showLegend?: boolean;
|
|
18
|
-
showActiveShape?: boolean;
|
|
19
|
-
};
|
|
5
|
+
({ data, ...otherProps }: import("../types/charts").BaseChartProps & {
|
|
6
|
+
chartType?: import("@reltio/mdm-sdk").ChartType.DONUT | import("@reltio/mdm-sdk").ChartType.PIE;
|
|
20
7
|
isDonut?: boolean;
|
|
8
|
+
options?: import("@reltio/mdm-sdk").PieChartOptions;
|
|
21
9
|
}): JSX.Element;
|
|
22
10
|
displayName: string;
|
|
23
11
|
};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
type TableWithBarsProps = ChartProps & {
|
|
4
|
-
options?: TableWithBarsOptions;
|
|
5
|
-
basicTableRef?: React.MutableRefObject<any> | null;
|
|
6
|
-
};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TableWithBarsProps } from '../types';
|
|
7
3
|
declare const TableWithBars: ({ width, height, data, options, basicTableRef, onItemClick }: TableWithBarsProps) => JSX.Element;
|
|
8
4
|
export default TableWithBars;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
declare const TreeChart: ({ data, width, height, onItemClick }:
|
|
2
|
+
import { TreeChartProps } from '../types';
|
|
3
|
+
declare const TreeChart: ({ data, width, height, onItemClick }: TreeChartProps) => JSX.Element;
|
|
4
4
|
export default TreeChart;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { ChartType, BarChartOptions, BubbleChartOptions, ChartOptions, CloudChartOptions, LineChartOptions, MapChartOptions, PieChartOptions, TableWithBarsOptions } from '@reltio/mdm-sdk';
|
|
3
|
+
export type ChartData = {
|
|
4
|
+
value: number;
|
|
5
|
+
label: string;
|
|
6
|
+
group: string;
|
|
7
|
+
localizedValue?: string;
|
|
8
|
+
percent?: number;
|
|
9
|
+
};
|
|
10
|
+
export type BaseChartProps = {
|
|
11
|
+
data: ChartData[];
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
onItemClick?: (group: string) => void;
|
|
15
|
+
chartType?: ChartType;
|
|
16
|
+
options?: ChartOptions;
|
|
17
|
+
};
|
|
18
|
+
export type BarChartProps = BaseChartProps & {
|
|
19
|
+
chartType?: ChartType.BAR;
|
|
20
|
+
options?: BarChartOptions;
|
|
21
|
+
};
|
|
22
|
+
export type PieChartProps = BaseChartProps & {
|
|
23
|
+
chartType?: ChartType.PIE | ChartType.DONUT;
|
|
24
|
+
isDonut?: boolean;
|
|
25
|
+
options?: PieChartOptions;
|
|
26
|
+
};
|
|
27
|
+
export type TreeChartProps = BaseChartProps & {
|
|
28
|
+
chartType?: ChartType.TREE;
|
|
29
|
+
};
|
|
30
|
+
export type TableWithBarsProps = BaseChartProps & {
|
|
31
|
+
chartType?: ChartType.TABLE;
|
|
32
|
+
basicTableRef?: RefObject<HTMLDivElement>;
|
|
33
|
+
options?: TableWithBarsOptions;
|
|
34
|
+
};
|
|
35
|
+
export type BubbleChartProps = BaseChartProps & {
|
|
36
|
+
chartType?: ChartType.BUBBLE;
|
|
37
|
+
options?: BubbleChartOptions;
|
|
38
|
+
};
|
|
39
|
+
export type LineChartProps = BaseChartProps & {
|
|
40
|
+
chartType?: ChartType.LINE;
|
|
41
|
+
options?: LineChartOptions;
|
|
42
|
+
};
|
|
43
|
+
export type MapChartProps = BaseChartProps & {
|
|
44
|
+
chartType?: ChartType.MAP;
|
|
45
|
+
options?: MapChartOptions;
|
|
46
|
+
};
|
|
47
|
+
export type CloudChartProps = BaseChartProps & {
|
|
48
|
+
chartType?: ChartType.CLOUD;
|
|
49
|
+
options?: CloudChartOptions;
|
|
50
|
+
};
|
|
51
|
+
export type ChartProps = BarChartProps | PieChartProps | TreeChartProps | TableWithBarsProps | BubbleChartProps | LineChartProps | MapChartProps | CloudChartProps;
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
export type { ChartData } from './
|
|
2
|
-
export type { BarChartOptions } from './BarChartOptions';
|
|
3
|
-
export type { ChartProps } from './ChartProps';
|
|
4
|
-
export type { TableWithBarsOptions } from './TableWithBarsOptions';
|
|
5
|
-
export type { LineChartOptions } from './LineChartOptions';
|
|
1
|
+
export type { ChartData, ChartProps, BarChartProps, BubbleChartProps, PieChartProps, TableWithBarsProps, TreeChartProps, LineChartProps, MapChartProps, CloudChartProps } from './charts';
|
|
@@ -62,15 +62,14 @@ var useAttributeActions = function (_a) {
|
|
|
62
62
|
var attributeValue = _a.attributeValue, attributeType = _a.attributeType, crosswalks = _a.crosswalks;
|
|
63
63
|
var action = (0, mdm_sdk_1.isReference)(attributeType)
|
|
64
64
|
? (0, ramda_1.pipe)(mdm_sdk_1.getReferencedRelationFromAttrValue, (0, ramda_1.prop)('objectURI'), mdm_sdk_1.removeRelation, handleErrorResponse)(attributeValue)
|
|
65
|
-
:
|
|
65
|
+
: (0, ramda_1.pipe)((0, ramda_1.defaultTo)([]), (0, ramda_1.map)(function (_a) {
|
|
66
66
|
var type = _a.type, value = _a.value, sourceTable = _a.sourceTable;
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}));
|
|
67
|
+
return ({
|
|
68
|
+
type: 'DELETE_ATTRIBUTE',
|
|
69
|
+
uri: attributeValue.uri,
|
|
70
|
+
crosswalk: sourceTable ? { type: type, value: value, sourceTable: sourceTable } : { type: type, value: value }
|
|
71
|
+
});
|
|
72
|
+
}), function (diff) { return ({ uri: (0, mdm_sdk_1.getBaseUri)(attributeValue.uri), diff: diff }); }, mdm_sdk_1.entityCumulativeDelete, handleErrorResponse)(crosswalks);
|
|
74
73
|
handleAction(action);
|
|
75
74
|
}, [handleAction, handleErrorResponse]);
|
|
76
75
|
var pinAttributeAction = (0, react_1.useCallback)(function (_a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"graph" | "historyTree" | "history" | "buttonContainer" | "shadow">;
|
|
@@ -25,6 +25,7 @@ var prepareHistorySlice = function (historySlice) {
|
|
|
25
25
|
};
|
|
26
26
|
var useHistoryDiff = function () {
|
|
27
27
|
var setHistoryDiff = (0, contexts_1.useMdmAction)('setHistoryDiff');
|
|
28
|
+
var clearHistoryDiff = (0, contexts_1.useMdmAction)('clearHistoryDiff');
|
|
28
29
|
var historySlice = (0, contexts_1.useMdmHistorySlice)();
|
|
29
30
|
var historyDiff = (0, contexts_1.useMdmHistoryDiff)();
|
|
30
31
|
var historyMode = (0, contexts_1.useMdmHistoryMode)();
|
|
@@ -36,6 +37,9 @@ var useHistoryDiff = function () {
|
|
|
36
37
|
var historyDiff_1 = historyManager.computeEntityHistoryDiff(prepareHistorySlice(historyMode === mdm_sdk_1.HistoryMode.Current ? entity : bEntity), prepareHistorySlice(aEntity));
|
|
37
38
|
setHistoryDiff(historyDiff_1);
|
|
38
39
|
}
|
|
40
|
+
else {
|
|
41
|
+
clearHistoryDiff();
|
|
42
|
+
}
|
|
39
43
|
}, [historySlice, historyMode, setHistoryDiff, entity]);
|
|
40
44
|
return historyDiff || exports.defaultHistoryDiff;
|
|
41
45
|
};
|
|
@@ -9,10 +9,18 @@ var useHistorySlice = function (_a) {
|
|
|
9
9
|
var entity = _a.entity, historyEvent = _a.historyEvent;
|
|
10
10
|
var _b = (0, react_1.useState)(false), isLoading = _b[0], setIsLoading = _b[1];
|
|
11
11
|
var setHistorySlice = (0, contexts_1.useMdmAction)('setHistorySlice');
|
|
12
|
+
var clearHistoryEvent = (0, contexts_1.useMdmAction)('clearHistoryEvent');
|
|
12
13
|
var historySlice = (0, contexts_1.useMdmHistorySlice)();
|
|
13
14
|
var safePromise = (0, hooks_1.useSafePromise)();
|
|
15
|
+
var mode = (0, contexts_1.useMdmMode)();
|
|
14
16
|
var _c = historyEvent || {}, aStamp = _c.aStamp, bStamp = _c.bStamp, overrideUri = _c.overrideUri;
|
|
15
17
|
var entityUri = overrideUri || (entity === null || entity === void 0 ? void 0 : entity.uri);
|
|
18
|
+
(0, react_1.useEffect)(function () {
|
|
19
|
+
if ((0, mdm_sdk_1.isEditableMode)(mode) && entityUri) {
|
|
20
|
+
safePromise(Promise.resolve());
|
|
21
|
+
clearHistoryEvent();
|
|
22
|
+
}
|
|
23
|
+
}, [mode, entityUri]);
|
|
16
24
|
(0, react_1.useEffect)(function () {
|
|
17
25
|
if (historyEvent && entityUri) {
|
|
18
26
|
setIsLoading(true);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ProfileView } from '@reltio/mdm-sdk';
|
|
3
3
|
type ConfigPermissionsContextValue = {
|
|
4
4
|
canCreate: boolean;
|
|
5
5
|
canUpdate: boolean;
|
|
@@ -8,7 +8,7 @@ type ConfigPermissionsContextValue = {
|
|
|
8
8
|
declare const ConfigPermissionsContext: React.Context<ConfigPermissionsContextValue>;
|
|
9
9
|
type Props = {
|
|
10
10
|
children: React.ReactNode;
|
|
11
|
-
view?:
|
|
11
|
+
view?: ProfileView;
|
|
12
12
|
};
|
|
13
13
|
declare const ConfigPermissionsContextProvider: ({ children, view }: Props) => JSX.Element;
|
|
14
14
|
declare const useAttributeValueConfigPermissions: (attributeValueUri: string) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Metadata, SearchState, AttributesPresentation, Entity, Mode, AttributeType, AttributeError, ImageAttributeValue, SortingStrategy, DependentLookupsConfig, PivotingValue, PivotingAttribute, DataTenant, HistoryDiff, ImageAttributeFieldsOrder, Connection, User, SearchNavigationData, SearchProviderData, Lookups, HistoryMode, HistorySlice, HistoryEvent, RequestNextPageOfAttributeValuesPayload, LookupsForTypeResolvedPayload, RelationsLoadedPayload, CompactRelationType, AddAttributesPayload, ModifyAttributePayload, RemoveAttributePayload, RelationsState, DependentLookupsState, ActivityFilter, SearchOptions, GlobalFilter,
|
|
1
|
+
import { Metadata, SearchState, AttributesPresentation, Entity, Mode, AttributeType, AttributeError, ImageAttributeValue, SortingStrategy, DependentLookupsConfig, PivotingValue, PivotingAttribute, DataTenant, HistoryDiff, ImageAttributeFieldsOrder, Connection, User, SearchNavigationData, SearchProviderData, Lookups, HistoryMode, HistorySlice, HistoryEvent, RequestNextPageOfAttributeValuesPayload, LookupsForTypeResolvedPayload, RelationsLoadedPayload, CompactRelationType, AddAttributesPayload, ModifyAttributePayload, RemoveAttributePayload, RelationsState, DependentLookupsState, ActivityFilter, SearchOptions, GlobalFilter, Layout, Profile } from '@reltio/mdm-sdk';
|
|
2
2
|
import { AnyAction } from '../../types';
|
|
3
3
|
export type MdmModuleValuesContextProps = Partial<{
|
|
4
4
|
autoCloseInterval: number;
|
|
@@ -51,8 +51,8 @@ export type MdmModuleValuesContextProps = Partial<{
|
|
|
51
51
|
searchProviderData: SearchProviderData;
|
|
52
52
|
isWorkflowEnabled: boolean;
|
|
53
53
|
isCollaborationEnabled: boolean;
|
|
54
|
-
uiConfigLayout:
|
|
55
|
-
uiConfigProfile:
|
|
54
|
+
uiConfigLayout: Layout;
|
|
55
|
+
uiConfigProfile: Profile;
|
|
56
56
|
}>;
|
|
57
57
|
export type MdmModuleActionsContextProps = Partial<{
|
|
58
58
|
openSearch: (payload: SearchState) => void;
|
|
@@ -93,6 +93,7 @@ export type MdmModuleActionsContextProps = Partial<{
|
|
|
93
93
|
modeUpdated: (payload: Mode) => void;
|
|
94
94
|
setHistoryEvent: (payload: HistoryEvent) => void;
|
|
95
95
|
clearHistoryEvent: () => void;
|
|
96
|
+
clearHistoryDiff: () => void;
|
|
96
97
|
setHistoryDiff: (payload: HistoryDiff) => void;
|
|
97
98
|
setHistorySlice: (payload: HistorySlice) => void;
|
|
98
99
|
updateSearchNavigationDataFields: (payload: Partial<SearchNavigationData>) => void;
|
|
@@ -158,6 +159,7 @@ export declare const MdmModuleActionsContext: import("@fluentui/react-context-se
|
|
|
158
159
|
modeUpdated: (payload: Mode) => void;
|
|
159
160
|
setHistoryEvent: (payload: HistoryEvent) => void;
|
|
160
161
|
clearHistoryEvent: () => void;
|
|
162
|
+
clearHistoryDiff: () => void;
|
|
161
163
|
setHistoryDiff: (payload: HistoryDiff) => void;
|
|
162
164
|
setHistorySlice: (payload: HistorySlice) => void;
|
|
163
165
|
updateSearchNavigationDataFields: (payload: Partial<SearchNavigationData>) => void;
|
|
@@ -230,8 +232,8 @@ export declare const MdmModuleValuesContext: import("@fluentui/react-context-sel
|
|
|
230
232
|
searchProviderData: SearchProviderData;
|
|
231
233
|
isWorkflowEnabled: boolean;
|
|
232
234
|
isCollaborationEnabled: boolean;
|
|
233
|
-
uiConfigLayout:
|
|
234
|
-
uiConfigProfile:
|
|
235
|
+
uiConfigLayout: Layout;
|
|
236
|
+
uiConfigProfile: Profile;
|
|
235
237
|
}>>;
|
|
236
238
|
export declare const MdmModuleListenersContext: import("@fluentui/react-context-selector").Context<Partial<{
|
|
237
239
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|