@nu-art/conflict-resolution-frontend 0.401.9 → 0.500.6
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/_ats/ATS_ConflictResolution/ATS_ConflictResolution.d.ts +4 -2
- package/_ats/ATS_ConflictResolution/ATS_ConflictResolution.js +13 -7
- package/_ats/index.d.ts +1 -1
- package/_ats/index.js +5 -0
- package/_dispatchers/show-conflict-resolution.d.ts +2 -2
- package/_dispatchers/show-conflict-resolution.js +6 -1
- package/_modules/ModuleFE_ConflictResolution.d.ts +1 -1
- package/_modules/ModuleFE_ConflictResolution.js +12 -7
- package/_ui/ConflictResolutionTree/ConflictResolutionTree.d.ts +2 -2
- package/_ui/ConflictResolutionTree/ConflictResolutionTree.js +1 -1
- package/_ui/ConflictResolutionTree/tree-calculation.d.ts +1 -1
- package/_ui/ConflictResolutionTree/tree-calculation.js +6 -1
- package/_ui/ConflictResolutionTree/tree-rendering.js +4 -2
- package/_ui/ConflictResolutionTree/types.d.ts +5 -4
- package/_ui/ConflictResolutionTree/types.js +5 -0
- package/_ui/Overlay_ConflictResolution/Overlay_ConflictResolution.d.ts +3 -3
- package/_ui/Overlay_ConflictResolution/Overlay_ConflictResolution.js +1 -1
- package/_ui/Panel_ConflictResolution/Panel_ConflictResolution.d.ts +2 -2
- package/_ui/Panel_ConflictResolution/Panel_ConflictResolution.js +5 -7
- package/package.json +16 -11
- package/_dispatchers/index.d.ts +0 -1
- package/_dispatchers/index.js +0 -1
- package/_ui/index.d.ts +0 -1
- package/_ui/index.js +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import './ATS_ConflictResolution.scss';
|
|
2
|
-
import {
|
|
2
|
+
import { ComponentSync } from '@nu-art/thunder-widgets';
|
|
3
|
+
import { AppToolsScreen } from '@nu-art/thunder-ui-modules';
|
|
4
|
+
import type { ModuleFE_BaseApi } from '@nu-art/db-api-frontend';
|
|
3
5
|
type State = {
|
|
4
|
-
upgradableModules: ModuleFE_BaseApi<any
|
|
6
|
+
upgradableModules: ModuleFE_BaseApi<any>[];
|
|
5
7
|
selectedModule?: ModuleFE_BaseApi<any>;
|
|
6
8
|
itemId?: string;
|
|
7
9
|
};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
/*
|
|
3
|
+
* @nu-art/conflict-resolution-frontend - Conflict resolution ATS screen component
|
|
4
|
+
* Copyright (C) 2026 Adam van der Kruk aka TacB0sS
|
|
5
|
+
* Licensed under the Apache License, Version 2.0
|
|
6
|
+
*/
|
|
7
|
+
import { filterDuplicates, RuntimeModules, sortArray } from '@nu-art/ts-common';
|
|
3
8
|
import './ATS_ConflictResolution.scss';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
9
|
+
import { Button, ComponentSync, LL_V_L, SimpleListAdapter, TS_DropDown, TS_Input, TS_PropRenderer } from '@nu-art/thunder-widgets';
|
|
10
|
+
import { ATS_Backend } from '@nu-art/thunder-ui-modules';
|
|
11
|
+
import { ModuleFE_CollectionActions } from '@nu-art/db-api-frontend';
|
|
6
12
|
import { ModuleFE_ConflictResolution } from '../../_modules/ModuleFE_ConflictResolution.js';
|
|
7
13
|
export class ATS_ConflictResolution extends ComponentSync {
|
|
8
14
|
static screen = {
|
|
@@ -18,17 +24,17 @@ export class ATS_ConflictResolution extends ComponentSync {
|
|
|
18
24
|
return state;
|
|
19
25
|
}
|
|
20
26
|
getAdapter = () => {
|
|
21
|
-
return SimpleListAdapter(this.state.upgradableModules, module => _jsx(_Fragment, { children: module.item.
|
|
27
|
+
return SimpleListAdapter(this.state.upgradableModules, module => _jsx(_Fragment, { children: module.item.config.dbKey }));
|
|
22
28
|
};
|
|
23
29
|
checkUsage = async () => {
|
|
24
30
|
const itemId = this.state.itemId;
|
|
25
|
-
const dbKey = this.state.selectedModule?.
|
|
31
|
+
const dbKey = this.state.selectedModule?.config.dbKey;
|
|
26
32
|
if (!itemId || !dbKey)
|
|
27
33
|
return;
|
|
28
34
|
const response = await ModuleFE_CollectionActions.check.usage({
|
|
29
|
-
dbKey
|
|
35
|
+
dbKey,
|
|
30
36
|
itemIds: [itemId]
|
|
31
|
-
})
|
|
37
|
+
});
|
|
32
38
|
if (response.dependencies)
|
|
33
39
|
ModuleFE_ConflictResolution.showDependencies(response.dependencies);
|
|
34
40
|
};
|
package/_ats/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppToolsScreen } from '@nu-art/
|
|
1
|
+
import { AppToolsScreen } from '@nu-art/thunder-ui-modules';
|
|
2
2
|
export declare const ATSGroup_ConflictResolution: AppToolsScreen[];
|
package/_ats/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @nu-art/conflict-resolution-frontend - Conflict resolution ATS group
|
|
3
|
+
* Copyright (C) 2026 Adam van der Kruk aka TacB0sS
|
|
4
|
+
* Licensed under the Apache License, Version 2.0
|
|
5
|
+
*/
|
|
1
6
|
import { ATS_ConflictResolution } from './ATS_ConflictResolution/ATS_ConflictResolution.js';
|
|
2
7
|
export const ATSGroup_ConflictResolution = [
|
|
3
8
|
ATS_ConflictResolution.screen,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DBEntityDependencies } from '@nu-art/
|
|
2
|
-
import { ThunderDispatcher } from '@nu-art/
|
|
1
|
+
import type { DBEntityDependencies } from '@nu-art/conflict-resolution-shared';
|
|
2
|
+
import { ThunderDispatcher } from '@nu-art/thunder-core';
|
|
3
3
|
export interface OnShowConflictResolution {
|
|
4
4
|
__onShowConflictResolution: (dependencies?: DBEntityDependencies) => void;
|
|
5
5
|
}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* @nu-art/conflict-resolution-frontend - Dispatcher for showing conflict resolution UI
|
|
3
|
+
* Copyright (C) 2026 Adam van der Kruk aka TacB0sS
|
|
4
|
+
* Licensed under the Apache License, Version 2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ThunderDispatcher } from '@nu-art/thunder-core';
|
|
2
7
|
export const dispatch_ShowConflictResolution = new ThunderDispatcher('__onShowConflictResolution');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DBEntityDependencies } from '@nu-art/
|
|
1
|
+
import { DBEntityDependencies } from '@nu-art/conflict-resolution-shared';
|
|
2
2
|
import { Module, TypedMap } from '@nu-art/ts-common';
|
|
3
3
|
import { ConflictResolutionItem } from '@nu-art/conflict-resolution-shared';
|
|
4
4
|
declare class ModuleFE_ConflictResolution_Class extends Module {
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* @nu-art/conflict-resolution-frontend - Conflict resolution frontend module
|
|
3
|
+
* Copyright (C) 2026 Adam van der Kruk aka TacB0sS
|
|
4
|
+
* Licensed under the Apache License, Version 2.0
|
|
5
|
+
*/
|
|
6
|
+
import { DBEntityDependencyErrorType } from '@nu-art/conflict-resolution-shared';
|
|
7
|
+
import { HttpClient } from '@nu-art/http-client';
|
|
3
8
|
import { BadImplementationException, Module, asArray } from '@nu-art/ts-common';
|
|
4
|
-
import { dispatch_ShowConflictResolution } from '../_dispatchers/
|
|
9
|
+
import { dispatch_ShowConflictResolution } from '../_dispatchers/show-conflict-resolution.js';
|
|
5
10
|
class ModuleFE_ConflictResolution_Class extends Module {
|
|
6
11
|
conflictResolutionItems = [];
|
|
7
12
|
initDefaultHasDependencyResponse = () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
HttpClient.default?.setDefaultOnError(async (errorResponse) => {
|
|
14
|
+
const err = errorResponse.errorResponse?.error;
|
|
15
|
+
if (err?.type === DBEntityDependencyErrorType && err.data)
|
|
16
|
+
dispatch_ShowConflictResolution.dispatchUI(err.data);
|
|
12
17
|
});
|
|
13
18
|
};
|
|
14
19
|
showDependencies = (dependencies) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DBEntityDependencies } from '@nu-art/
|
|
2
|
-
import { Adapter, ComponentSync } from '@nu-art/
|
|
1
|
+
import type { DBEntityDependencies } from '@nu-art/conflict-resolution-shared';
|
|
2
|
+
import { Adapter, ComponentSync } from '@nu-art/thunder-widgets';
|
|
3
3
|
import './ConflictResolutionTree.scss';
|
|
4
4
|
type Props = {
|
|
5
5
|
dependencies: DBEntityDependencies;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { AdapterBuilder, ComponentSync, TS_Tree } from '@nu-art/
|
|
2
|
+
import { AdapterBuilder, ComponentSync, TS_Tree } from '@nu-art/thunder-widgets';
|
|
3
3
|
import { calculateConflictResolutionTree } from './tree-calculation.js';
|
|
4
4
|
import { ConflictResolutionTreeRenderers } from './tree-rendering.js';
|
|
5
5
|
import { ModuleFE_ConflictResolution } from '../../_modules/ModuleFE_ConflictResolution.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DBEntityDependencies } from '@nu-art/
|
|
1
|
+
import type { DBEntityDependencies } from '@nu-art/conflict-resolution-shared';
|
|
2
2
|
import { ConflictResolutionTree } from './types.js';
|
|
3
3
|
export declare const calculateConflictResolutionTree: (dependencies: DBEntityDependencies) => ConflictResolutionTree["nodeType"];
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @nu-art/conflict-resolution-frontend - Conflict resolution tree calculation
|
|
3
|
+
* Copyright (C) 2026 Adam van der Kruk aka TacB0sS
|
|
4
|
+
* Licensed under the Apache License, Version 2.0
|
|
5
|
+
*/
|
|
1
6
|
import { RuntimeModules, StaticLogger, _keys } from '@nu-art/ts-common';
|
|
2
7
|
const getItem = (dbKey, itemId) => {
|
|
3
|
-
const module = RuntimeModules().filter(
|
|
8
|
+
const module = RuntimeModules().filter(m => m.config?.dbKey === dbKey)[0];
|
|
4
9
|
if (!module) {
|
|
5
10
|
StaticLogger.logWarning(`Could not get module for dbKey ${dbKey}`);
|
|
6
11
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Label
|
|
2
|
+
import { Label } from '@nu-art/thunder-widgets';
|
|
3
3
|
const renderTreeNode_CheckedItem = (props, map) => {
|
|
4
4
|
const crItem = map[props.item.dbKey];
|
|
5
5
|
let content;
|
|
@@ -22,7 +22,9 @@ const renderTreeNode_ConflictingItem = (props, map) => {
|
|
|
22
22
|
content = props.item.itemId;
|
|
23
23
|
else
|
|
24
24
|
content = crItem.renderer(props.item.item) ?? props.item.itemId;
|
|
25
|
-
return _jsx(Label, { className: 'conflict-resolution-tree__conflicting-item', tooltip: content, onClick: () =>
|
|
25
|
+
return _jsx(Label, { className: 'conflict-resolution-tree__conflicting-item', tooltip: content, onClick: () => {
|
|
26
|
+
void navigator.clipboard.writeText(String(props.item.itemId));
|
|
27
|
+
}, children: content });
|
|
26
28
|
};
|
|
27
29
|
export const ConflictResolutionTreeRenderers = (map) => ({
|
|
28
30
|
root: () => _jsx(_Fragment, {}),
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { TreeNode, TreeType } from '@nu-art/
|
|
3
|
-
import {
|
|
2
|
+
import { TreeNode, TreeType } from '@nu-art/thunder-widgets';
|
|
3
|
+
import { DB_Prototype } from '@nu-art/db-api-shared';
|
|
4
|
+
import { UniqueId } from '@nu-art/ts-common';
|
|
4
5
|
type Props_CheckedItem = {
|
|
5
6
|
itemId: UniqueId;
|
|
6
7
|
dbKey: string;
|
|
7
|
-
item?:
|
|
8
|
+
item?: DB_Prototype['dbType'];
|
|
8
9
|
};
|
|
9
10
|
type Props_ConflictingCollection = {
|
|
10
11
|
dbKey: string;
|
|
@@ -12,7 +13,7 @@ type Props_ConflictingCollection = {
|
|
|
12
13
|
type Props_ConflictingItem = {
|
|
13
14
|
itemId: UniqueId;
|
|
14
15
|
dbKey: string;
|
|
15
|
-
item?:
|
|
16
|
+
item?: DB_Prototype['dbType'];
|
|
16
17
|
};
|
|
17
18
|
type ConflictResolutionTree_Map = {
|
|
18
19
|
root: {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DBEntityDependencies } from '@nu-art/
|
|
2
|
-
import { ComponentSync } from '@nu-art/
|
|
1
|
+
import type { DBEntityDependencies } from '@nu-art/conflict-resolution-shared';
|
|
2
|
+
import { ComponentSync } from '@nu-art/thunder-widgets';
|
|
3
3
|
import './Overlay_ConflictResolution.scss';
|
|
4
|
-
import { OnShowConflictResolution } from '../../_dispatchers/
|
|
4
|
+
import { OnShowConflictResolution } from '../../_dispatchers/show-conflict-resolution.js';
|
|
5
5
|
type State = {
|
|
6
6
|
dependencies?: DBEntityDependencies;
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ComponentSync } from '@nu-art/
|
|
2
|
+
import { ComponentSync } from '@nu-art/thunder-widgets';
|
|
3
3
|
import './Overlay_ConflictResolution.scss';
|
|
4
4
|
import { Panel_ConflictResolution } from '../Panel_ConflictResolution/Panel_ConflictResolution.js';
|
|
5
5
|
export class Overlay_ConflictResolution extends ComponentSync {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DBEntityDependencies } from '@nu-art/
|
|
2
|
-
import { ComponentSync } from '@nu-art/
|
|
1
|
+
import type { DBEntityDependencies } from '@nu-art/conflict-resolution-shared';
|
|
2
|
+
import { ComponentSync } from '@nu-art/thunder-widgets';
|
|
3
3
|
import './Panel_ConflictResolution.scss';
|
|
4
4
|
type Props = {
|
|
5
5
|
dependencies: DBEntityDependencies;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Button, ComponentSync, LL_H_C, LL_V_L } from '@nu-art/
|
|
2
|
+
import { Button, ComponentSync, LL_H_C, LL_V_L } from '@nu-art/thunder-widgets';
|
|
3
3
|
import { _keys, _values, filterDuplicates, flatArray, RuntimeModules } from '@nu-art/ts-common';
|
|
4
|
-
import { dispatch_ShowConflictResolution } from '../../_dispatchers/
|
|
5
|
-
import { TS_Icons } from '@nu-art/ts-styles/icons/
|
|
4
|
+
import { dispatch_ShowConflictResolution } from '../../_dispatchers/show-conflict-resolution.js';
|
|
5
|
+
import { TS_Icons } from '@nu-art/ts-styles/icons/icons';
|
|
6
6
|
import './Panel_ConflictResolution.scss';
|
|
7
7
|
import { ConflictResolutionTree } from '../ConflictResolutionTree/ConflictResolutionTree.js';
|
|
8
8
|
export class Panel_ConflictResolution extends ComponentSync {
|
|
@@ -11,10 +11,9 @@ export class Panel_ConflictResolution extends ComponentSync {
|
|
|
11
11
|
state.dependencies = nextProps.dependencies;
|
|
12
12
|
return state;
|
|
13
13
|
}
|
|
14
|
-
// ##################### Logic #####################
|
|
15
14
|
resolveEntityLabel = () => {
|
|
16
|
-
const module = RuntimeModules().filter(
|
|
17
|
-
return module?.
|
|
15
|
+
const module = RuntimeModules().filter(m => m.config?.dbKey === this.props.dependencies.dbKey)[0];
|
|
16
|
+
return module?.config.dbConfig.name ?? 'Entity';
|
|
18
17
|
};
|
|
19
18
|
closePanel = () => {
|
|
20
19
|
dispatch_ShowConflictResolution.dispatchUI();
|
|
@@ -32,7 +31,6 @@ export class Panel_ConflictResolution extends ComponentSync {
|
|
|
32
31
|
expand = () => {
|
|
33
32
|
this.setState({ expanded: true });
|
|
34
33
|
};
|
|
35
|
-
// ##################### Render #####################
|
|
36
34
|
render() {
|
|
37
35
|
return _jsxs(LL_V_L, { id: 'panel__conflict-resolution', className: this.state.expanded ? 'expanded' : undefined, children: [this.render_Header(), this.render_Body()] });
|
|
38
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nu-art/conflict-resolution-frontend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.500.6",
|
|
4
4
|
"description": "Conflict Resolution Frontend",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"TacB0sS",
|
|
@@ -16,13 +16,12 @@
|
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "git+ssh://git@github.com:nu-art-js/thunderstorm.git"
|
|
19
|
+
"url": "git+ssh://git@github.com:nu-art-js/thunderstorm.git",
|
|
20
|
+
"directory": "_thunderstorm/to-review/conflict-resolution/frontend"
|
|
20
21
|
},
|
|
21
22
|
"license": "Apache-2.0",
|
|
22
23
|
"author": "TacB0sS",
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "tsc"
|
|
25
|
-
},
|
|
24
|
+
"scripts": {},
|
|
26
25
|
"contributors": [
|
|
27
26
|
{
|
|
28
27
|
"name": "TacB0sS"
|
|
@@ -37,12 +36,18 @@
|
|
|
37
36
|
"linkDirectory": true
|
|
38
37
|
},
|
|
39
38
|
"dependencies": {
|
|
40
|
-
"@nu-art/conflict-resolution-shared": "0.
|
|
41
|
-
"@nu-art/
|
|
42
|
-
"@nu-art/
|
|
43
|
-
"
|
|
44
|
-
"@nu-art/
|
|
45
|
-
"
|
|
39
|
+
"@nu-art/conflict-resolution-shared": "0.500.6",
|
|
40
|
+
"@nu-art/ts-common": "0.500.6",
|
|
41
|
+
"@nu-art/ts-styles": "0.500.6",
|
|
42
|
+
"react": "^18.0.0",
|
|
43
|
+
"@nu-art/db-api-frontend": "0.500.6",
|
|
44
|
+
"@nu-art/db-api-shared": "0.500.6",
|
|
45
|
+
"@nu-art/editable-item": "0.500.6",
|
|
46
|
+
"@nu-art/http-client": "0.500.6",
|
|
47
|
+
"@nu-art/thunder-core": "0.500.6",
|
|
48
|
+
"@nu-art/thunder-routing": "0.500.6",
|
|
49
|
+
"@nu-art/thunder-ui-modules": "0.500.6",
|
|
50
|
+
"@nu-art/thunder-widgets": "0.500.6"
|
|
46
51
|
},
|
|
47
52
|
"devDependencies": {
|
|
48
53
|
"@types/react": "^18.0.0"
|
package/_dispatchers/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './show-conflict-resolution.js';
|
package/_dispatchers/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './show-conflict-resolution.js';
|
package/_ui/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Overlay_ConflictResolution/Overlay_ConflictResolution.js';
|
package/_ui/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Overlay_ConflictResolution/Overlay_ConflictResolution.js';
|