@crystaldesign/diva-backoffice 26.12.0-beta.3 → 26.12.0-beta.4
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/build/esm/index.js +973 -357
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/components/ArticleTable/index.d.ts +10 -2
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/components/ArticleTable/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/hooks/useHeaderProducts.d.ts +15 -0
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/hooks/useHeaderProducts.d.ts.map +1 -0
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/hooks/useRefreshHeaderValues.d.ts +9 -0
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/hooks/useRefreshHeaderValues.d.ts.map +1 -0
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/index.d.ts +5 -2
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/logic/articleColumns.d.ts +2 -1
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/logic/articleColumns.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/logic/headerLink.d.ts +38 -0
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/logic/headerLink.d.ts.map +1 -0
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/logic/headerSync.d.ts +36 -0
- package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/logic/headerSync.d.ts.map +1 -0
- package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/components/AffectedCount/index.d.ts +3 -2
- package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/components/AffectedCount/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/components/Content/index.d.ts +1 -1
- package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/components/Content/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/hooks/useAffectedProducts.d.ts +6 -6
- package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/hooks/useHeaderData.d.ts +14 -0
- package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/hooks/useHeaderData.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/hooks/useSaveHeaderData.d.ts +7 -6
- package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/hooks/useSaveHeaderData.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/AssortmentManager/tests/headerLink.test.d.ts +2 -0
- package/build/types/backoffice/src/ui/AssortmentManager/tests/headerLink.test.d.ts.map +1 -0
- package/build/types/backoffice/src/ui/AssortmentManager/tests/headerSync.test.d.ts +2 -0
- package/build/types/backoffice/src/ui/AssortmentManager/tests/headerSync.test.d.ts.map +1 -0
- package/package.json +10 -10
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DivaSpreadsheetHooks, SpreadsheetRefProps } from '@crystaldesign/spreadsheet';
|
|
2
|
+
import { DivaActionDef, DivaContext, DivaSpreadsheetHooks, SpreadsheetRefProps } from '@crystaldesign/spreadsheet';
|
|
3
|
+
import { HeaderProducts } from '../../logic/headerSync';
|
|
3
4
|
interface ArticleTableProps {
|
|
4
5
|
/** Free text of the page's search input — the grid ORs it over the legacy search fields. */
|
|
5
6
|
searchTerm?: string;
|
|
6
7
|
/** Page-level hooks, e.g. the selection that drives the subtable tabs. */
|
|
7
8
|
hooks?: DivaSpreadsheetHooks<Record<string, unknown>>;
|
|
9
|
+
/** The page's row buttons (actions column), e.g. the header refresh. */
|
|
10
|
+
rowActions?: DivaActionDef<Record<string, unknown>, DivaContext>[];
|
|
11
|
+
/** The organization's header rows for the refresh marker; the grid waits for them (undefined = loading). */
|
|
12
|
+
headers?: HeaderProducts;
|
|
8
13
|
}
|
|
9
14
|
/**
|
|
10
15
|
* All articles of the organization as a server-side grid: the catalog service pages, sorts and
|
|
11
16
|
* filters `/v1/products`. The organization scoping lives in the preFilter — the products filter path
|
|
12
17
|
* applies neither the organization nor `archived` by itself (see HeaderData/hooks/useHeaderData.ts).
|
|
13
18
|
* The supplier / EK group context is per row: the two leading columns name it; keeping the header
|
|
14
|
-
* inheritance (`headerValues`)
|
|
19
|
+
* inheritance (`headerValues`) linked to those values is a server concern. A header save changes no
|
|
20
|
+
* article — rows whose header snapshot differs from the header row, or that are not linked to the
|
|
21
|
+
* header row of their context yet, get a warning accent, and the page's row action pulls the current
|
|
22
|
+
* header values in.
|
|
15
23
|
*/
|
|
16
24
|
declare const ArticleTable: React.ForwardRefExoticComponent<ArticleTableProps & React.RefAttributes<SpreadsheetRefProps<Record<string, unknown>>>>;
|
|
17
25
|
export default ArticleTable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/ui/AssortmentManager/ArticleData/components/ArticleTable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAO,EAAiB,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/ui/AssortmentManager/ArticleData/components/ArticleTable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAO,EAAiB,aAAa,EAAE,WAAW,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAUlI,OAAO,EAAE,cAAc,EAAoB,MAAM,wBAAwB,CAAC;AAI1E,UAAU,iBAAiB;IACzB,4FAA4F;IAC5F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,wEAAwE;IACxE,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC;IACnE,4GAA4G;IAC5G,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED;;;;;;;;;GASG;AACH,QAAA,MAAM,YAAY,wHAmHhB,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/hooks/useHeaderProducts.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import RootStore from '../../../../store/RootStore';
|
|
2
|
+
import { HeaderProducts } from '../logic/headerSync';
|
|
3
|
+
export interface HeaderProductsState {
|
|
4
|
+
/** The active header rows, indexed. Undefined while loading; empty after a failed load (nothing is marked then). */
|
|
5
|
+
headers?: HeaderProducts;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The header rows the article table compares the articles against (`isHeaderOutdated`, `hasUnlinkedHeader`).
|
|
10
|
+
* Loaded once per mount — the grid waits for it, because ag-grid does not re-evaluate row classes when a
|
|
11
|
+
* value outside the row data changes. A failed load degrades to "nothing marked" with a warning toast; the
|
|
12
|
+
* articles themselves stay fully usable.
|
|
13
|
+
*/
|
|
14
|
+
export default function useHeaderProducts(root: RootStore): HeaderProductsState;
|
|
15
|
+
//# sourceMappingURL=useHeaderProducts.d.ts.map
|
package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/hooks/useHeaderProducts.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHeaderProducts.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/AssortmentManager/ArticleData/hooks/useHeaderProducts.ts"],"names":[],"mappings":"AAGA,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAyB1E,MAAM,WAAW,mBAAmB;IAClC,oHAAoH;IACpH,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CAClB;AA+CD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,mBAAmB,CA0B9E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import RootStore from '../../../../store/RootStore';
|
|
2
|
+
/**
|
|
3
|
+
* Pulls the current header values into one article through the catalog service
|
|
4
|
+
* (`POST /v1/products/:id/headervalues/refresh`) and returns the updated article, which the grid uses to
|
|
5
|
+
* replace its row. The server resolves the header row, rebuilds the merge and refuses transferred
|
|
6
|
+
* articles — the client sends nothing but the id. No loading state here: the row action button shows its own.
|
|
7
|
+
*/
|
|
8
|
+
export default function useRefreshHeaderValues(root: RootStore): (articleId: string) => Promise<Record<string, unknown>>;
|
|
9
|
+
//# sourceMappingURL=useRefreshHeaderValues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRefreshHeaderValues.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/AssortmentManager/ArticleData/hooks/useRefreshHeaderValues.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAGpD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,IAAI,EAAE,SAAS,eAExC,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAkB9D"}
|
|
@@ -2,8 +2,11 @@ import React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* The article ("Positionsdaten") page of the assortment manager: lists all articles of the
|
|
4
4
|
* organization, narrowed by the free text search. The supplier / EK group context lives per row in
|
|
5
|
-
* the two leading columns;
|
|
6
|
-
*
|
|
5
|
+
* the two leading columns; writes into them link the header row client side (`onCellEditRequest` →
|
|
6
|
+
* headerLink), the catalog service relinks on every save that changes them. A header save does not
|
|
7
|
+
* change the articles — rows whose header snapshot differs from the current header row show as
|
|
8
|
+
* outdated, and the row action of the actions column pulls the current header values into one
|
|
9
|
+
* article on request. The selected row feeds the ITEM_GROUP tabs in the bottom toolbar.
|
|
7
10
|
*/
|
|
8
11
|
declare function ArticleData(): React.JSX.Element;
|
|
9
12
|
declare const _default: typeof ArticleData & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/AssortmentManager/ArticleData/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/AssortmentManager/ArticleData/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAwBtE;;;;;;;;GAQG;AACH,iBAAS,WAAW,sBA0OnB;;;;AAED,wBAAqC"}
|
package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/logic/articleColumns.d.ts
CHANGED
|
@@ -46,7 +46,8 @@ export declare function labelCompanionResets(oldData: ArticleRow | undefined, da
|
|
|
46
46
|
* Builds the article table's column tree from the field catalogue: one header group per catalogue
|
|
47
47
|
* `group` in file order, one column per `showOnArticle` entry; entries without a group render
|
|
48
48
|
* ungrouped at the top level. Header-inheritable text and number fields render as `withPlaceholder`
|
|
49
|
-
* columns
|
|
49
|
+
* columns (except the two context columns, see CONTEXT_FIELD_KEYS), multilanguage fields as nested
|
|
50
|
+
* language groups, ITEM_GROUPs as row-count summaries.
|
|
50
51
|
* Fields naming a `commonColumn` collapse into one shared symbol column each, their own columns
|
|
51
52
|
* hidden.
|
|
52
53
|
*/
|
package/build/types/backoffice/src/ui/AssortmentManager/ArticleData/logic/articleColumns.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"articleColumns.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/AssortmentManager/ArticleData/logic/articleColumns.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"articleColumns.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/AssortmentManager/ArticleData/logic/articleColumns.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAoB,MAAM,4BAA4B,CAAC;AAE3F,OAAO,EAA0B,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAIvE,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC1C,KAAK,aAAa,GAAG,UAAU,CAAC,UAAU,CAAC,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,UAAqB,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,UAQjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,UAIjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,8BAG/B,CAAC;AAoBF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,aAAa,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAIvF,CAAC;AAuDH;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAOjH;AA8QD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,CAAC,EAAE,SAAS,EACZ,wBAAwB,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,EACjE,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAM,GAC1C,aAAa,EAAE,CA8EjB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CellEditRequestedEvent, DivaContext } from '@crystaldesign/spreadsheet';
|
|
2
|
+
import { HeaderProduct } from '../../HeaderData/hooks/useHeaderData';
|
|
3
|
+
type ArticleRow = Record<string, unknown>;
|
|
4
|
+
/** Loads the header product of a supplier / EK group combination; undefined when the combination has none. */
|
|
5
|
+
export type HeaderResolver = (supplierNr: string, ekg: string) => Promise<HeaderProduct | undefined>;
|
|
6
|
+
/** The article paths the header row is looked up by — the key fields the catalog relinks on (`headerInheritance.keyFields`). */
|
|
7
|
+
export declare const HEADER_KEY_PATHS: {
|
|
8
|
+
readonly supplier: "customData.SAP.SAP_EINA_LIFNR";
|
|
9
|
+
readonly ekg: "customData.SAP.SAP_EINE_EKGRP";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The `headerValues` an article carries for its header row, in the shape the catalog service writes
|
|
13
|
+
* itself (`buildHeaderValuesSnapshot`): the row's customData as the inheritance source plus its audit
|
|
14
|
+
* fields (`lastUpdated` is what the outdated marker compares, see headerSync.ts).
|
|
15
|
+
*/
|
|
16
|
+
export declare function headerValuesSnapshot(header: HeaderProduct): Record<string, unknown>;
|
|
17
|
+
export type HeaderLinker = ReturnType<typeof createHeaderLinker>;
|
|
18
|
+
/**
|
|
19
|
+
* Links the header row client side, the way the lookup cell fills its dependent fields: once both key
|
|
20
|
+
* fields of a row are set, the header product is loaded and written into the row's `headerValues`, so
|
|
21
|
+
* the placeholder cells show the inherited values before anything is saved and the commit carries the
|
|
22
|
+
* link. The catalog service respects a body carrying `headerValues` on create and rebuilds the link
|
|
23
|
+
* itself whenever the keys change later, so it stays the authority — this only moves the moment the
|
|
24
|
+
* user sees the inheritance forward. A missing key, a combination without a header row and a failed
|
|
25
|
+
* lookup all remove the link, as the server would: the previous header's values must not survive a
|
|
26
|
+
* key change — and the catalog links the row on save anyway.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createHeaderLinker(resolveHeader: HeaderResolver): {
|
|
29
|
+
/**
|
|
30
|
+
* The grid's `hooks.onCellEditRequest`: every write into a cell arrives here; whenever it changes the
|
|
31
|
+
* supplier / EK group combination (`oldData` vs `data`, the row as the write leaves it — whichever
|
|
32
|
+
* column or source did it), the (re)link starts with the new keys. The transaction handler lock holds
|
|
33
|
+
* the auto-commit back until the link is written, so the saved row carries it.
|
|
34
|
+
*/
|
|
35
|
+
onCellEditRequest({ oldData, data, node, context, api }: CellEditRequestedEvent<ArticleRow, DivaContext>): void;
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=headerLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headerLink.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/AssortmentManager/ArticleData/logic/headerLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C,8GAA8G;AAC9G,MAAM,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;AAErG,gIAAgI;AAChI,eAAO,MAAM,gBAAgB;;;CAA+F,CAAC;AAE7H;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWnF;AAWD,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEjE;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,cAAc;IAiC5D;;;;;OAKG;6DACsD,sBAAsB,CAAC,UAAU,EAAE,WAAW,CAAC,GAAG,IAAI;EAiBlH"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The active header rows of the organization (`_id`, `lastUpdated`, key fields), keyed by product id and by
|
|
3
|
+
* their supplier / EK group context ({@link headerContextKey}).
|
|
4
|
+
*/
|
|
5
|
+
export interface HeaderProducts {
|
|
6
|
+
byId: ReadonlyMap<string, Record<string, unknown>>;
|
|
7
|
+
byContext: ReadonlyMap<string, Record<string, unknown>>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The supplier / EK group context of a row as one map key — the client-side counterpart of the catalog's
|
|
11
|
+
* header key fields (`headerInheritance.keyFields`), read from the materialized values. Undefined while a
|
|
12
|
+
* key field is missing or empty: an incomplete context pairs with no header row.
|
|
13
|
+
*/
|
|
14
|
+
export declare function headerContextKey(data: Record<string, unknown> | undefined): string | undefined;
|
|
15
|
+
/** Indexes the loaded header rows for {@link isHeaderOutdated} and {@link hasUnlinkedHeader}. */
|
|
16
|
+
export declare function indexHeaderProducts(rows: Record<string, unknown>[]): HeaderProducts;
|
|
17
|
+
/**
|
|
18
|
+
* An article whose header snapshot is older than the header row it references: the header was saved after
|
|
19
|
+
* the article last pulled its values. Compared by timestamp — `headerValues.lastUpdated` is the header's
|
|
20
|
+
* `lastUpdated` at snapshot time — so the header rows are loaded with a few fields instead of their whole
|
|
21
|
+
* `customData`; an organization has thousands of them. Derived from the data on both sides, a header save
|
|
22
|
+
* writes nothing into articles. Not reported for transferred articles (they can never be refreshed), for
|
|
23
|
+
* articles without a link, and while the header rows are not loaded or the referenced row is gone.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isHeaderOutdated(data: Record<string, unknown> | undefined, headers: HeaderProducts | undefined): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* An article without a header link whose supplier / EK group context has a header row by now: the article
|
|
28
|
+
* was imported or created before that header row existed (the import sets no link then, and a header save
|
|
29
|
+
* writes nothing into articles). A refresh links it — the catalog resolves the header through the key
|
|
30
|
+
* fields, not through the stored link. Not reported for transferred articles and while the header rows are
|
|
31
|
+
* not loaded.
|
|
32
|
+
*/
|
|
33
|
+
export declare function hasUnlinkedHeader(data: Record<string, unknown> | undefined, headers: HeaderProducts | undefined): boolean;
|
|
34
|
+
/** Whether the refresh action has something to pull: outdated header values, or a header row not linked yet. */
|
|
35
|
+
export declare function canRefreshHeader(data: Record<string, unknown> | undefined, headers: HeaderProducts | undefined): boolean;
|
|
36
|
+
//# sourceMappingURL=headerSync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headerSync.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/AssortmentManager/ArticleData/logic/headerSync.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACzD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAI9F;AAED,iGAAiG;AACjG,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,cAAc,CAOnF;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAOxH;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAMzH;AAED,gHAAgH;AAChH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAExH"}
|
|
@@ -2,12 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { AffectedProductsState } from '../../hooks/useAffectedProducts';
|
|
3
3
|
interface AffectedCountProps {
|
|
4
4
|
affected: AffectedProductsState;
|
|
5
|
-
/** Unsaved changes present — the number turns into a warning because
|
|
5
|
+
/** Unsaved changes present — the number turns into a warning because saving makes that many articles outdated. */
|
|
6
6
|
dirty: boolean;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* How many articles inherit the header values. Stays quiet while nothing is edited and turns into a warning
|
|
10
|
-
* as soon as there are unsaved changes
|
|
10
|
+
* as soon as there are unsaved changes: after the save exactly these articles show as outdated in the
|
|
11
|
+
* article table, and each of them has to be refreshed there.
|
|
11
12
|
*
|
|
12
13
|
* The count is per supplier / EK group and not per field: the filter behind it does not look at individual
|
|
13
14
|
* fields, so a per-field number would be the same one repeated.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/ui/AssortmentManager/HeaderData/components/AffectedCount/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAIxE,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,qBAAqB,CAAC;IAChC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/ui/AssortmentManager/HeaderData/components/AffectedCount/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAIxE,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,qBAAqB,CAAC;IAChC,kHAAkH;IAClH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,iBAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,kBAAkB,4BA6B7D;AAED,eAAe,aAAa,CAAC"}
|
package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/components/Content/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { PreparedTableSave } from '../../types';
|
|
|
5
5
|
interface ContentProps {
|
|
6
6
|
/** The loaded header product (`isHeader: true`) whose values are edited. */
|
|
7
7
|
data?: HeaderProduct;
|
|
8
|
-
/** How many articles
|
|
8
|
+
/** How many articles inherit from this header — the ones that show as outdated after a save. */
|
|
9
9
|
affected: AffectedProductsState;
|
|
10
10
|
/** Group keys (= product paths) of ITEM_GROUP tabs with unsaved changes; drives save button and markers. */
|
|
11
11
|
tableDirtyKeys: string[];
|
package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/components/Content/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/ui/AssortmentManager/HeaderData/components/Content/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AASnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AA2ChD,UAAU,YAAY;IACpB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/ui/AssortmentManager/HeaderData/components/Content/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AASnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AA2ChD,UAAU,YAAY;IACpB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,gGAAgG;IAChG,QAAQ,EAAE,qBAAqB,CAAC;IAChC,4GAA4G;IAC5G,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB;;;;OAIG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAChD,uGAAuG;IACvG,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,sGAAsG;IACtG,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;GAKG;AACH,iBAAS,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,YAAY,qBA0MnI;AAED,eAAe,OAAO,CAAC"}
|
package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/hooks/useAffectedProducts.d.ts
CHANGED
|
@@ -6,13 +6,13 @@ export interface AffectedProductsState {
|
|
|
6
6
|
error?: string;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Counts the articles a change to the header values
|
|
9
|
+
* Counts the articles a change to the header values concerns — the ones that show as outdated in the
|
|
10
|
+
* article table after a save and can be refreshed there.
|
|
10
11
|
*
|
|
11
|
-
* The filter
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* articles that are already transferred.
|
|
12
|
+
* The filter is the `headerValues._id` reference plus the two exclusions the refresh refuses anyway.
|
|
13
|
+
* Deliberately unlike the SAP import path (`PfisterArticleService.updateHeaderValuesInProducts`), articles
|
|
14
|
+
* already sent to SAP (`SentToSAPSuccess: true`) are excluded: transferred articles can never be refreshed,
|
|
15
|
+
* so the article table does not report them as outdated either.
|
|
16
16
|
* `limit=0` makes this a pure count: the catalog service skips the data pipeline and only runs the count
|
|
17
17
|
* aggregation, so `total` arrives without any documents.
|
|
18
18
|
*/
|
|
@@ -10,6 +10,20 @@ export interface HeaderDataState {
|
|
|
10
10
|
/** Set when the request itself failed, which is a different situation from "no header row exists". */
|
|
11
11
|
error?: string;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Fetches the header product (`isHeader: true`) of a supplier / EK group combination; undefined when
|
|
15
|
+
* the combination has none.
|
|
16
|
+
*
|
|
17
|
+
* `type: 'string'` on the two SAP keys is required: `parseFilterParam` casts an unquoted numeric string to
|
|
18
|
+
* a number, which then matches nothing. `archived` is filtered here because the catalog service drops the
|
|
19
|
+
* controller's own `archived: false` on the filter code path — the same reason
|
|
20
|
+
* `PfisterArticleService.getProductHeaderValues` spells it out.
|
|
21
|
+
*
|
|
22
|
+
* `organizationId` belongs in the filter as well: on that same code path the `organizationIds` query
|
|
23
|
+
* parameter only drives the permission check and does not scope the query (`ProductService.search`), so
|
|
24
|
+
* without the clause another organization's header row could be loaded.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fetchHeaderProduct(root: RootStore, supplierNr: string, ekg: string): Promise<HeaderProduct | undefined>;
|
|
13
27
|
/** Loads the header product for a supplier / EK group combination as reactive state. */
|
|
14
28
|
export default function useHeaderData(root: RootStore, supplierNr?: string, ekg?: string): HeaderDataState;
|
|
15
29
|
//# sourceMappingURL=useHeaderData.d.ts.map
|
package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/hooks/useHeaderData.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHeaderData.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/AssortmentManager/HeaderData/hooks/useHeaderData.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAGpD,yFAAyF;AACzF,MAAM,WAAW,aAAc,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5D,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,uGAAuG;IACvG,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,sGAAsG;IACtG,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"useHeaderData.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/AssortmentManager/HeaderData/hooks/useHeaderData.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAGpD,yFAAyF;AACzF,MAAM,WAAW,aAAc,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5D,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,uGAAuG;IACvG,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,sGAAsG;IACtG,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAwB7H;AAED,wFAAwF;AACxF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,eAAe,CA4BzG"}
|
package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/hooks/useSaveHeaderData.d.ts
CHANGED
|
@@ -8,18 +8,19 @@ export interface SaveHeaderDataState {
|
|
|
8
8
|
/**
|
|
9
9
|
* Saves the header product through the catalog service.
|
|
10
10
|
*
|
|
11
|
-
* `PATCH /v1/products/:id/headervalues` patches the header row and
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* `PATCH /v1/products/:id/headervalues` patches the header row and nothing else — the products referencing
|
|
12
|
+
* it keep their values until the user refreshes them one by one in the article table, which recognizes them
|
|
13
|
+
* by comparing their header snapshot with the header row. The route lives in the catalog because that is
|
|
14
|
+
* where `isHeader`, `headerValues` and `overrideValues` are defined and merged — going through a client
|
|
15
|
+
* specific service is not necessary and would tie the assortment manager to one customer's article service.
|
|
15
16
|
*
|
|
16
17
|
* Only the changed paths are sent, as JSON Patch. That is the reason for using this endpoint over the older
|
|
17
18
|
* route through diva-pfister-article, whose `createProductFromDivaNr` was written to sync whole records out
|
|
18
19
|
* of the legacy SQL database and replaces `customData` wholesale — it forced the client to send the entire
|
|
19
20
|
* object back and silently dropped anything left out.
|
|
20
21
|
*
|
|
21
|
-
* Which products inherit from this header is
|
|
22
|
-
*
|
|
22
|
+
* Which products inherit from this header is recorded on the products themselves (`headerValues._id`); the
|
|
23
|
+
* client sends nothing about them.
|
|
23
24
|
*/
|
|
24
25
|
export default function useSaveHeaderData(root: RootStore, data?: HeaderProduct): SaveHeaderDataState;
|
|
25
26
|
//# sourceMappingURL=useSaveHeaderData.d.ts.map
|
package/build/types/backoffice/src/ui/AssortmentManager/HeaderData/hooks/useSaveHeaderData.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSaveHeaderData.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/AssortmentManager/HeaderData/hooks/useSaveHeaderData.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,WAAW,mBAAmB;IAClC,4FAA4F;IAC5F,IAAI,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IACzE,MAAM,EAAE,OAAO,CAAC;CACjB;AASD
|
|
1
|
+
{"version":3,"file":"useSaveHeaderData.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/AssortmentManager/HeaderData/hooks/useSaveHeaderData.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,WAAW,mBAAmB;IAClC,4FAA4F;IAC5F,IAAI,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IACzE,MAAM,EAAE,OAAO,CAAC;CACjB;AASD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,mBAAmB,CAoCpG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headerLink.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/AssortmentManager/tests/headerLink.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headerSync.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/AssortmentManager/tests/headerSync.test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crystaldesign/diva-backoffice",
|
|
3
|
-
"version": "26.12.0-beta.
|
|
3
|
+
"version": "26.12.0-beta.4",
|
|
4
4
|
"description": "Ant Design backoffice shell: configuration plus the IDM and enricher editors.",
|
|
5
5
|
"license": "COMMERCIAL",
|
|
6
6
|
"devDependencies": {
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@ant-design/icons": "6.3.4",
|
|
18
18
|
"@babel/runtime": "7.24.7",
|
|
19
|
-
"@crystaldesign/content-box": "26.12.0-beta.
|
|
20
|
-
"@crystaldesign/content-item": "26.12.0-beta.
|
|
21
|
-
"@crystaldesign/diva-agent": "26.12.0-beta.
|
|
22
|
-
"@crystaldesign/diva-core": "26.12.0-beta.
|
|
23
|
-
"@crystaldesign/diva-utils": "26.12.0-beta.
|
|
24
|
-
"@crystaldesign/media-upload": "26.12.0-beta.
|
|
25
|
-
"@crystaldesign/rtf-editor": "26.12.0-beta.
|
|
26
|
-
"@crystaldesign/spreadsheet": "26.12.0-beta.
|
|
19
|
+
"@crystaldesign/content-box": "26.12.0-beta.4",
|
|
20
|
+
"@crystaldesign/content-item": "26.12.0-beta.4",
|
|
21
|
+
"@crystaldesign/diva-agent": "26.12.0-beta.4",
|
|
22
|
+
"@crystaldesign/diva-core": "26.12.0-beta.4",
|
|
23
|
+
"@crystaldesign/diva-utils": "26.12.0-beta.4",
|
|
24
|
+
"@crystaldesign/media-upload": "26.12.0-beta.4",
|
|
25
|
+
"@crystaldesign/rtf-editor": "26.12.0-beta.4",
|
|
26
|
+
"@crystaldesign/spreadsheet": "26.12.0-beta.4",
|
|
27
27
|
"@dnd-kit/core": "^6.1.0",
|
|
28
28
|
"@dnd-kit/sortable": "^8.0.0",
|
|
29
29
|
"@dnd-kit/utilities": "^3.2.2",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
},
|
|
58
58
|
"module": "build/esm/index.js",
|
|
59
59
|
"types": "./build/types/backoffice/src/index.d.ts",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "54efd799af3f284d39e2fed5b8b3a2ea476add33"
|
|
61
61
|
}
|