@contrail/flexplm 1.8.0-alpha.7427c41 → 1.8.0-alpha.95a3ea2
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/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Core model for contrail, which establishes the base peristence services (without
|
|
|
5
5
|
|
|
6
6
|
| Item | Default |
|
|
7
7
|
|---|---|
|
|
8
|
-
| VibeIQ type path | `custom-entity:country` (case-
|
|
8
|
+
| VibeIQ type path | `custom-entity:country` (exact, lowercase; matched case-sensitively in both directions) |
|
|
9
9
|
| FlexPLM class / type path | `LCSCountry` / `Country` |
|
|
10
10
|
| Identifier property | `vibeIQIdentifier` (same key in both systems; no rekey runs without a mapping) |
|
|
11
11
|
| Informational property | `name` |
|
|
@@ -20,7 +20,7 @@ export declare class TypeDefaults {
|
|
|
20
20
|
static applyConfig(config: any): void;
|
|
21
21
|
static isPropertyTrue(value: any): boolean;
|
|
22
22
|
/** True when the VibeIQ entity is a Country: a custom-entity whose typePath is
|
|
23
|
-
* 'custom-entity:country' (compared case-
|
|
23
|
+
* exactly 'custom-entity:country' (compared case-sensitively, as on inbound).
|
|
24
24
|
*
|
|
25
25
|
* @param entity VibeIQ entity
|
|
26
26
|
* @returns boolean
|
|
@@ -19,14 +19,14 @@ class TypeDefaults {
|
|
|
19
19
|
return value === true || (typeof value === 'string' && value.toLowerCase() === 'true');
|
|
20
20
|
}
|
|
21
21
|
/** True when the VibeIQ entity is a Country: a custom-entity whose typePath is
|
|
22
|
-
* 'custom-entity:country' (compared case-
|
|
22
|
+
* exactly 'custom-entity:country' (compared case-sensitively, as on inbound).
|
|
23
23
|
*
|
|
24
24
|
* @param entity VibeIQ entity
|
|
25
25
|
* @returns boolean
|
|
26
26
|
*/
|
|
27
27
|
static isCountryEntity(entity) {
|
|
28
28
|
const typePath = entity?.['typePath'];
|
|
29
|
-
return typeof typePath === 'string' && typePath
|
|
29
|
+
return typeof typePath === 'string' && typePath === TypeDefaults.COUNTRY_VIBE_TYPE_PATH;
|
|
30
30
|
}
|
|
31
31
|
/**Takes in full entity and returs the default FlexPLM
|
|
32
32
|
* object class.
|
|
@@ -50,12 +50,12 @@ describe('Type Defaults', () => {
|
|
|
50
50
|
const objectClass = type_defaults_1.TypeDefaults.getDefaultObjectClass(newData);
|
|
51
51
|
expect(objectClass).toEqual('LCSCountry');
|
|
52
52
|
});
|
|
53
|
-
it('should return
|
|
53
|
+
it('should return LCSRevisableEntity when the Country typePath uses different casing', () => {
|
|
54
54
|
const newData = {
|
|
55
55
|
entityType: 'custom-entity',
|
|
56
56
|
typePath: 'custom-entity:Country'
|
|
57
57
|
};
|
|
58
|
-
expect(type_defaults_1.TypeDefaults.getDefaultObjectClass(newData)).toEqual('
|
|
58
|
+
expect(type_defaults_1.TypeDefaults.getDefaultObjectClass(newData)).toEqual('LCSRevisableEntity');
|
|
59
59
|
});
|
|
60
60
|
it('should return LCSRevisableEntity for a custom entity that is not a Country', () => {
|
|
61
61
|
const newData = {
|
|
@@ -347,6 +347,9 @@ describe('Type Defaults', () => {
|
|
|
347
347
|
it('should return true for the custom-entity:country type path', () => {
|
|
348
348
|
expect(type_defaults_1.TypeDefaults.isCountryEntity({ typePath: 'custom-entity:country' })).toBe(true);
|
|
349
349
|
});
|
|
350
|
+
it('should return false when the typePath differs only in casing', () => {
|
|
351
|
+
expect(type_defaults_1.TypeDefaults.isCountryEntity({ typePath: 'custom-entity:Country' })).toBe(false);
|
|
352
|
+
});
|
|
350
353
|
it('should return false for another subtype, a missing typePath, or an undefined entity', () => {
|
|
351
354
|
expect(type_defaults_1.TypeDefaults.isCountryEntity({ typePath: 'custom-entity:other' })).toBe(false);
|
|
352
355
|
expect(type_defaults_1.TypeDefaults.isCountryEntity({})).toBe(false);
|