@steedos-labs/content-compliance 0.8.36 → 1.0.1
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/dist/index.js +1 -1
- package/lib/actions/contentHubMaterialGroups.d.ts +19 -0
- package/lib/actions/contentHubMaterialGroups.js +70 -0
- package/lib/actions/contentHubMaterialGroups.js.map +1 -0
- package/lib/actions/contentHubSyncPreview.d.ts +21 -0
- package/lib/actions/contentHubSyncPreview.js +51 -0
- package/lib/actions/contentHubSyncPreview.js.map +1 -0
- package/lib/actions/contentHubTagValues.d.ts +12 -0
- package/lib/actions/contentHubTagValues.js +70 -0
- package/lib/actions/contentHubTagValues.js.map +1 -0
- package/lib/actions/index.d.ts +3 -0
- package/lib/actions/index.js +3 -0
- package/lib/actions/index.js.map +1 -1
- package/lib/actions/sendToContentHub.js +1 -1
- package/lib/actions/sendToContentHub.js.map +1 -1
- package/lib/actions/spotCheckMaterial.js +2 -1
- package/lib/actions/spotCheckMaterial.js.map +1 -1
- package/lib/index.js +173 -30
- package/lib/index.js.map +1 -1
- package/lib/methods/__tests__/contentHubMaterialGroup.test.d.ts +1 -0
- package/lib/methods/__tests__/contentHubMaterialGroup.test.js +97 -0
- package/lib/methods/__tests__/contentHubMaterialGroup.test.js.map +1 -0
- package/lib/methods/__tests__/contentHubMaterialGroupRule.test.d.ts +1 -0
- package/lib/methods/__tests__/contentHubMaterialGroupRule.test.js +168 -0
- package/lib/methods/__tests__/contentHubMaterialGroupRule.test.js.map +1 -0
- package/lib/methods/__tests__/contentHubPush.test.d.ts +1 -0
- package/lib/methods/__tests__/contentHubPush.test.js +568 -0
- package/lib/methods/__tests__/contentHubPush.test.js.map +1 -0
- package/lib/methods/__tests__/contentHubSyncRule.test.d.ts +1 -0
- package/lib/methods/__tests__/contentHubSyncRule.test.js +130 -0
- package/lib/methods/__tests__/contentHubSyncRule.test.js.map +1 -0
- package/lib/methods/__tests__/contentHubTagSync.test.d.ts +1 -0
- package/lib/methods/__tests__/contentHubTagSync.test.js +743 -0
- package/lib/methods/__tests__/contentHubTagSync.test.js.map +1 -0
- package/lib/methods/__tests__/tagLabel.test.d.ts +1 -0
- package/lib/methods/__tests__/tagLabel.test.js +136 -0
- package/lib/methods/__tests__/tagLabel.test.js.map +1 -0
- package/lib/methods/approval_engine.js +10 -7
- package/lib/methods/approval_engine.js.map +1 -1
- package/lib/methods/consts.d.ts +4 -0
- package/lib/methods/consts.js.map +1 -1
- package/lib/methods/content_hub.d.ts +8 -1
- package/lib/methods/content_hub.js +278 -27
- package/lib/methods/content_hub.js.map +1 -1
- package/lib/methods/content_hub_copyright.d.ts +15 -0
- package/lib/methods/content_hub_copyright.js +223 -0
- package/lib/methods/content_hub_copyright.js.map +1 -0
- package/lib/methods/content_hub_material_group.d.ts +29 -0
- package/lib/methods/content_hub_material_group.js +268 -0
- package/lib/methods/content_hub_material_group.js.map +1 -0
- package/lib/methods/content_hub_material_group_rule.d.ts +23 -0
- package/lib/methods/content_hub_material_group_rule.js +58 -0
- package/lib/methods/content_hub_material_group_rule.js.map +1 -0
- package/lib/methods/content_hub_sync_rule.d.ts +51 -0
- package/lib/methods/content_hub_sync_rule.js +122 -0
- package/lib/methods/content_hub_sync_rule.js.map +1 -0
- package/lib/methods/content_hub_tag.d.ts +57 -0
- package/lib/methods/content_hub_tag.js +830 -0
- package/lib/methods/content_hub_tag.js.map +1 -0
- package/lib/methods/pls.d.ts +4 -1
- package/lib/methods/pls.js +60 -51
- package/lib/methods/pls.js.map +1 -1
- package/lib/methods/tag_label.d.ts +19 -0
- package/lib/methods/tag_label.js +192 -0
- package/lib/methods/tag_label.js.map +1 -0
- package/main/default/applications/pepsico_content_setting.app.yml +8 -0
- package/main/default/objects/pepesio_ch__c/fields/media_type.field.yml +2 -0
- package/main/default/objects/pepesio_ch__c/fields/pepsico_material_approval.field.yml +6 -0
- package/main/default/objects/pepesio_ch__c/fields/push_status.field.yml +11 -0
- package/main/default/objects/pepesio_ch__c/fields/type.field.yml +48 -8
- package/main/default/objects/pepesio_ch__c/listviews/all.listview.yml +2 -0
- package/main/default/objects/pepsico_ch_material_group_rule/fields/active.field.yml +6 -0
- package/main/default/objects/pepsico_ch_material_group_rule/fields/classification.field.yml +73 -0
- package/main/default/objects/pepsico_ch_material_group_rule/fields/name.field.yml +9 -0
- package/main/default/objects/pepsico_ch_material_group_rule/fields/orgs.field.yml +10 -0
- package/main/default/objects/pepsico_ch_material_group_rule/fields/priority.field.yml +10 -0
- package/main/default/objects/pepsico_ch_material_group_rule/fields/query_mode.field.yml +12 -0
- package/main/default/objects/pepsico_ch_material_group_rule/fields/remark.field.yml +7 -0
- package/main/default/objects/pepsico_ch_material_group_rule/listviews/all.listview.yml +20 -0
- package/main/default/objects/pepsico_ch_material_group_rule/pepsico_ch_material_group_rule.object.yml +19 -0
- package/main/default/objects/pepsico_ch_material_group_rule/permissions/admin.permission.yml +15 -0
- package/main/default/objects/pepsico_ch_material_group_rule/permissions/user.permission.yml +14 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/active.field.yml +6 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/classification.field.yml +73 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/kol_classification.field.yml +67 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/name.field.yml +9 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/need_sync.field.yml +11 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/orgs.field.yml +10 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/priority.field.yml +10 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/product.field.yml +65 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/remark.field.yml +7 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/spot_check.field.yml +12 -0
- package/main/default/objects/pepsico_ch_sync_rule/listviews/all.listview.yml +24 -0
- package/main/default/objects/pepsico_ch_sync_rule/pepsico_ch_sync_rule.object.yml +19 -0
- package/main/default/objects/pepsico_ch_sync_rule/permissions/admin.permission.yml +15 -0
- package/main/default/objects/pepsico_ch_sync_rule/permissions/user.permission.yml +14 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/action.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/changed_at.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/duration.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/error_code.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/error_msg.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/expired_date.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/name.field.yml +7 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/parent_tag_val_id.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/request_id.field.yml +7 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/result.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/source_ip.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/space.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/tag_id.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/tag_val_id.field.yml +7 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/tag_val_name.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/listviews/all.listview.yml +21 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/pepsico_ch_tag_sync_log.object.yml +16 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/permissions/admin.permission.yml +15 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/permissions/user.permission.yml +14 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/changed_at.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/duration.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/expired_date.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/item_count.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/name.field.yml +7 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/request_id.field.yml +7 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/response.field.yml +9 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/result_code.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/source_ip.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/space.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/tag_id.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/tag_label.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/listviews/all.listview.yml +19 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/pepsico_ch_tag_sync_request.object.yml +16 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/permissions/admin.permission.yml +15 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/permissions/user.permission.yml +14 -0
- package/main/default/objects/pepsico_material/fields/material_type_label.field.yml +10 -0
- package/main/default/objects/pepsico_material_approval/buttons/pepsico_confirm_online.button.yml +78 -1
- package/main/default/objects/pepsico_material_approval/buttons/pepsico_modify_pls.button.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/available_channels.field.yml +2 -0
- package/main/default/objects/pepsico_material_approval/fields/available_channels_label.field.yml +10 -0
- package/main/default/objects/pepsico_material_approval/fields/ch_material_group.field.yml +56 -0
- package/main/default/objects/pepsico_material_approval/fields/ch_material_group_path.field.yml +14 -0
- package/main/default/objects/pepsico_material_approval/fields/ch_sync_enabled.field.yml +11 -0
- package/main/default/objects/pepsico_material_approval/fields/ch_sync_rule_check.field.yml +55 -0
- package/main/default/objects/pepsico_material_approval/fields/content_rule.field.yml +2 -0
- package/main/default/objects/pepsico_material_approval/fields/content_rule_label.field.yml +10 -0
- package/main/default/objects/pepsico_material_approval/fields/ec_check_food_name.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_ingredients.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_net_content.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_producer_address.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_producer_name.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_shelf_life.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_standard_code.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_storage_condition.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_has_detail_page.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/ec_producers.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/ec_qc_production_email.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_related_approval.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/effective_date.field.yml +2 -0
- package/main/default/objects/pepsico_material_approval/fields/expiry_date.field.yml +2 -0
- package/main/default/objects/pepsico_material_approval/fields/form_version.field.yml +6 -2
- package/main/default/objects/pepsico_material_approval/fields/has_nutrition_table.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/material_editable.field.yml +78 -0
- package/main/default/objects/pepsico_material_approval/fields/material_type.field.yml +2 -0
- package/main/default/objects/pepsico_material_approval/fields/material_type_label.field.yml +10 -0
- package/main/default/objects/pepsico_material_approval/fields/pls_file.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/pls_km_files.field.yml +2 -5
- package/main/default/objects/pepsico_material_approval/fields/pls_upload_files.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/product_label.field.yml +10 -0
- package/main/default/objects/pepsico_material_approval_data/fields/guding_pass.field.yml +9 -1
- package/main/default/objects/pepsico_material_data/fields/guding_pass.field.yml +9 -1
- package/main/default/objects/picklist_options/fields/ch_changed_at.field.yml +8 -0
- package/main/default/objects/picklist_options/picklist_options.object.yml +7 -0
- package/main/default/tabs/object_pepsico_ch_material_group_rule.tab.yml +8 -0
- package/main/default/tabs/object_pepsico_ch_sync_rule.tab.yml +8 -0
- package/main/default/triggers/pepsico_material_approval_tag_label.trigger.yml +80 -0
- package/main/default/triggers/pepsico_material_tag_label.trigger.yml +77 -0
- package/package.json +1 -1
- package/scripts/audit-legacy-tags.js +246 -0
- package/scripts/probe-content-hub-tags.js +134 -0
- package/main/default/objects/pepsico_material_approval/fields/has_detail_page.field.yml +0 -18
|
@@ -11,8 +11,8 @@ amis:
|
|
|
11
11
|
multiple: false
|
|
12
12
|
requiredOn: >-
|
|
13
13
|
${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
|
|
14
|
-
form_version == 'v2' && ec_has_detail_page == 'yes'}
|
|
14
|
+
(form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
|
|
15
15
|
options:
|
|
16
16
|
- label: 已自查
|
|
17
17
|
value: 'yes'
|
|
18
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
|
|
18
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
|
package/main/default/objects/pepsico_material_approval/fields/ec_check_ingredients.field.yml
CHANGED
|
@@ -11,8 +11,8 @@ amis:
|
|
|
11
11
|
multiple: false
|
|
12
12
|
requiredOn: >-
|
|
13
13
|
${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
|
|
14
|
-
form_version == 'v2' && ec_has_detail_page == 'yes'}
|
|
14
|
+
(form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
|
|
15
15
|
options:
|
|
16
16
|
- label: 已自查
|
|
17
17
|
value: 'yes'
|
|
18
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
|
|
18
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
|
package/main/default/objects/pepsico_material_approval/fields/ec_check_net_content.field.yml
CHANGED
|
@@ -11,8 +11,8 @@ amis:
|
|
|
11
11
|
multiple: false
|
|
12
12
|
requiredOn: >-
|
|
13
13
|
${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
|
|
14
|
-
form_version == 'v2' && ec_has_detail_page == 'yes'}
|
|
14
|
+
(form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
|
|
15
15
|
options:
|
|
16
16
|
- label: 已自查
|
|
17
17
|
value: 'yes'
|
|
18
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
|
|
18
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
|
package/main/default/objects/pepsico_material_approval/fields/ec_check_producer_address.field.yml
CHANGED
|
@@ -11,8 +11,8 @@ amis:
|
|
|
11
11
|
multiple: false
|
|
12
12
|
requiredOn: >-
|
|
13
13
|
${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
|
|
14
|
-
form_version == 'v2' && ec_has_detail_page == 'yes'}
|
|
14
|
+
(form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
|
|
15
15
|
options:
|
|
16
16
|
- label: 已自查
|
|
17
17
|
value: 'yes'
|
|
18
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
|
|
18
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
|
package/main/default/objects/pepsico_material_approval/fields/ec_check_producer_name.field.yml
CHANGED
|
@@ -11,8 +11,8 @@ amis:
|
|
|
11
11
|
multiple: false
|
|
12
12
|
requiredOn: >-
|
|
13
13
|
${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
|
|
14
|
-
form_version == 'v2' && ec_has_detail_page == 'yes'}
|
|
14
|
+
(form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
|
|
15
15
|
options:
|
|
16
16
|
- label: 已自查
|
|
17
17
|
value: 'yes'
|
|
18
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
|
|
18
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
|
|
@@ -11,8 +11,8 @@ amis:
|
|
|
11
11
|
multiple: false
|
|
12
12
|
requiredOn: >-
|
|
13
13
|
${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
|
|
14
|
-
form_version == 'v2' && ec_has_detail_page == 'yes'}
|
|
14
|
+
(form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
|
|
15
15
|
options:
|
|
16
16
|
- label: 已自查
|
|
17
17
|
value: 'yes'
|
|
18
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
|
|
18
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
|
package/main/default/objects/pepsico_material_approval/fields/ec_check_standard_code.field.yml
CHANGED
|
@@ -11,8 +11,8 @@ amis:
|
|
|
11
11
|
multiple: false
|
|
12
12
|
requiredOn: >-
|
|
13
13
|
${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
|
|
14
|
-
form_version == 'v2' && ec_has_detail_page == 'yes'}
|
|
14
|
+
(form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
|
|
15
15
|
options:
|
|
16
16
|
- label: 已自查
|
|
17
17
|
value: 'yes'
|
|
18
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
|
|
18
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
|
package/main/default/objects/pepsico_material_approval/fields/ec_check_storage_condition.field.yml
CHANGED
|
@@ -11,8 +11,8 @@ amis:
|
|
|
11
11
|
multiple: false
|
|
12
12
|
requiredOn: >-
|
|
13
13
|
${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
|
|
14
|
-
form_version == 'v2' && ec_has_detail_page == 'yes'}
|
|
14
|
+
(form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
|
|
15
15
|
options:
|
|
16
16
|
- label: 已自查
|
|
17
17
|
value: 'yes'
|
|
18
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
|
|
18
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
|
|
@@ -15,4 +15,4 @@ options:
|
|
|
15
15
|
value: 'yes'
|
|
16
16
|
- label: 否
|
|
17
17
|
value: 'no'
|
|
18
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2'
|
|
18
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3')
|
|
@@ -16,4 +16,4 @@ group: 电商合规自查
|
|
|
16
16
|
sort_no: 1276
|
|
17
17
|
is_wide: true
|
|
18
18
|
required: true
|
|
19
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_check_producer_name == 'yes' && ec_check_producer_address == 'yes' && ec_has_detail_page == 'yes'
|
|
19
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_check_producer_name == 'yes' && ec_check_producer_address == 'yes' && ec_has_detail_page == 'yes'
|
package/main/default/objects/pepsico_material_approval/fields/ec_qc_production_email.field.yml
CHANGED
|
@@ -12,5 +12,5 @@ amis:
|
|
|
12
12
|
accept: image/*,.pdf
|
|
13
13
|
requiredOn: >-
|
|
14
14
|
${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
|
|
15
|
-
form_version == 'v2' && ec_has_detail_page == 'yes'}
|
|
16
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
|
|
15
|
+
(form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
|
|
16
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
|
|
@@ -6,4 +6,4 @@ group: 电商合规自查
|
|
|
6
6
|
sort_no: 1259
|
|
7
7
|
is_wide: true
|
|
8
8
|
required: true
|
|
9
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'no'
|
|
9
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'no'
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
name: form_version
|
|
2
|
+
# 只在界面上藏起来, 字段仍渲染在表单里: 多个字段的 visible_on 引用 form_version,
|
|
3
|
+
# 新建时的默认值 v1 也要靠表单写入; 用 visible_on 置 false 会把它从表单数据里拿掉
|
|
4
|
+
amis:
|
|
5
|
+
className: hidden
|
|
2
6
|
label: 表单版本
|
|
3
7
|
type: text
|
|
4
8
|
data_type: text
|
|
5
9
|
group: 系统信息
|
|
6
|
-
inlineHelpText: v1=PLS知识库关联;v2=增加电商合规自查与QC
|
|
10
|
+
inlineHelpText: v1=PLS知识库关联;v2=增加电商合规自查与QC审核;v3=Content Hub 改版(含 v1、v2 全部功能, 另加同步规则、同步开关、素材组)
|
|
7
11
|
sort_no: 100000
|
|
8
12
|
is_wide: false
|
|
9
13
|
readonly: true
|
|
10
|
-
defaultValue: '
|
|
14
|
+
defaultValue: 'v3'
|
|
@@ -15,4 +15,4 @@ options:
|
|
|
15
15
|
value: 'yes'
|
|
16
16
|
- label: 否
|
|
17
17
|
value: 'no'
|
|
18
|
-
visible_on: (classification == 'MD-SC1-SC16' || classification == 'MD-SC1-SC16-SC161' || classification == 'MD-SC1-SC16-SC162' || classification == 'MD-SC1-SC112' || classification == 'SLS-SC2-SC26' || classification == 'SLS-SC2-SC26-SC261' || classification == 'SLS-SC2-SC26-SC262' || classification == 'SLS-SC2-SC212') && form_version == 'v2'
|
|
18
|
+
visible_on: (classification == 'MD-SC1-SC16' || classification == 'MD-SC1-SC16-SC161' || classification == 'MD-SC1-SC16-SC162' || classification == 'MD-SC1-SC112' || classification == 'SLS-SC2-SC26' || classification == 'SLS-SC2-SC26-SC261' || classification == 'SLS-SC2-SC26-SC262' || classification == 'SLS-SC2-SC212') && (form_version == 'v2' || form_version == 'v3')
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
name: material_editable
|
|
2
|
+
# 选项与素材授权规则(content_rule)相同, 动态读取 picklist 223321022150011 的启用选项
|
|
3
|
+
amis:
|
|
4
|
+
id: 'u:material_editable'
|
|
5
|
+
type: tree-select
|
|
6
|
+
label: 是否可以进行素材编辑
|
|
7
|
+
multiple: false
|
|
8
|
+
enableNodePath: true
|
|
9
|
+
showIcon: true
|
|
10
|
+
initiallyOpen: false
|
|
11
|
+
hideRoot: true
|
|
12
|
+
clearable: true
|
|
13
|
+
onlyLeaf: true
|
|
14
|
+
searchable: true
|
|
15
|
+
autoCheckChildren: true
|
|
16
|
+
joinValues: true
|
|
17
|
+
delimiter: 、
|
|
18
|
+
source:
|
|
19
|
+
url: /graphql
|
|
20
|
+
method: post
|
|
21
|
+
requestAdaptor: |-
|
|
22
|
+
api.data = { query:`
|
|
23
|
+
query{
|
|
24
|
+
picklists(filters: [["code", "=", "223321022150011"]]){
|
|
25
|
+
options: _related_picklist_options_picklist(filters: [["enable", "=", true]], sort: "sort_no desc"){
|
|
26
|
+
label: name, value, , parent: parent__expand{ value }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`}
|
|
31
|
+
adaptor: |+
|
|
32
|
+
const pOptions = payload.data.picklists[0].options;
|
|
33
|
+
let depth = 0;
|
|
34
|
+
function getChildren(value) {
|
|
35
|
+
depth++;
|
|
36
|
+
// 控制递归次数;
|
|
37
|
+
if (depth > 2000) {
|
|
38
|
+
console.log('递归次数过多,请检查数据:', depth, pOptions)
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
return _.map(_.filter(pOptions, (op) => {
|
|
42
|
+
if (value == null) {
|
|
43
|
+
return op.parent == null
|
|
44
|
+
}
|
|
45
|
+
return op.parent && op.parent.value === value;
|
|
46
|
+
}), item => {
|
|
47
|
+
return {
|
|
48
|
+
...item,
|
|
49
|
+
children: getChildren(item.value || item.label)
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const options = getChildren(null);
|
|
54
|
+
return { options }
|
|
55
|
+
|
|
56
|
+
messages: {}
|
|
57
|
+
sendOn: ''
|
|
58
|
+
cache: 86400000
|
|
59
|
+
showOutline: false
|
|
60
|
+
cascade: true
|
|
61
|
+
description: ''
|
|
62
|
+
pathSeparator: '-'
|
|
63
|
+
unfoldedLevel: 2
|
|
64
|
+
data_type: text
|
|
65
|
+
description: ''
|
|
66
|
+
enable_thousands: true
|
|
67
|
+
group: 素材标签
|
|
68
|
+
inlineHelpText: ''
|
|
69
|
+
is_wide: true
|
|
70
|
+
label: 是否可以进行素材编辑
|
|
71
|
+
options:
|
|
72
|
+
- label: '1'
|
|
73
|
+
value: '1'
|
|
74
|
+
required: true
|
|
75
|
+
sort_no: 1625
|
|
76
|
+
type: select
|
|
77
|
+
# 只在 Content Hub 改版后的新版表单(v3)且勾选「同步到 Content Hub」时显示, 存量 v1/v2 单据不受影响
|
|
78
|
+
visible_on: form_version == 'v3' && ch_sync_enabled == true
|
|
@@ -8,4 +8,4 @@ multiple: true
|
|
|
8
8
|
required: false
|
|
9
9
|
sort_no: 800
|
|
10
10
|
type: file
|
|
11
|
-
visible_on: '${(classification == ''MD-PO1-PO15'') && form_version != ''v2'' && form_version != ''v1''}'
|
|
11
|
+
visible_on: '${(classification == ''MD-PO1-PO15'') && form_version != ''v2'' && form_version != ''v1'' && form_version != ''v3''}'
|
|
@@ -22,10 +22,7 @@ amis:
|
|
|
22
22
|
className: pepsico-pls-files-field m-1 border-b
|
|
23
23
|
# requiredOn: >-
|
|
24
24
|
# ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' ||
|
|
25
|
-
# has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2') && (!pls_upload_files ||
|
|
25
|
+
# has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2' || form_version == 'v3') && (!pls_upload_files ||
|
|
26
26
|
# pls_upload_files.length === 0)}
|
|
27
|
-
# 过渡规则: 素材包含商品详情页(过渡字段 has_detail_page)且未上传本地PLS文件时必填
|
|
28
|
-
requiredOn: >-
|
|
29
|
-
${has_detail_page == 'yes' && (!pls_upload_files || pls_upload_files.length === 0)}
|
|
30
27
|
placeholder: 请选择PLS文件
|
|
31
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' || has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2')
|
|
28
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' || has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2' || form_version == 'v3')
|
|
@@ -6,7 +6,7 @@ group: 基本信息
|
|
|
6
6
|
sort_no: 1241
|
|
7
7
|
is_wide: false
|
|
8
8
|
required: false
|
|
9
|
-
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' || has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2')
|
|
9
|
+
visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' || has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2' || form_version == 'v3')
|
|
10
10
|
amis:
|
|
11
11
|
accept: .pdf
|
|
12
12
|
btnLabel: 上传本地PLS文件
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: pepsico_material_approval_tag_label
|
|
2
|
+
listenTo: pepsico_material_approval
|
|
3
|
+
when:
|
|
4
|
+
- beforeInsert
|
|
5
|
+
- beforeUpdate
|
|
6
|
+
isEnabled: true
|
|
7
|
+
handler: |-
|
|
8
|
+
const { _ } = global;
|
|
9
|
+
const { doc } = ctx.params;
|
|
10
|
+
const isInsert = ctx.params.isInsert === true;
|
|
11
|
+
|
|
12
|
+
// 标签名称快照: 选中标签时把名称存到 *_label, 之后标签在 Content Hub 改名 / 停用都不回刷,
|
|
13
|
+
// 历史单据不会因为选项停用而只剩一串 ID。
|
|
14
|
+
// 解析规则与 src/methods/tag_label.ts 一致(那边供存量回填与单测), 改一处要同步改另一处。
|
|
15
|
+
const OBJECT_NAME = 'pepsico_material_approval';
|
|
16
|
+
const FIELDS = [
|
|
17
|
+
{ field: 'product', labelField: 'product_label', tagId: '223321001114213' },
|
|
18
|
+
{ field: 'material_type', labelField: 'material_type_label', tagId: '223321001114222' },
|
|
19
|
+
{ field: 'available_channels', labelField: 'available_channels_label', tagId: '223321001114944' },
|
|
20
|
+
{ field: 'content_rule', labelField: 'content_rule_label', tagId: '223321022150011' }
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
// 字段值 → 路径列表(各级 tagValId); 值可能是字符串或数组, 多个路径可能用 、 或 , 连接
|
|
24
|
+
const parsePaths = (value) => _.compact(
|
|
25
|
+
_.flatMap(_.castArray(value), (v) => _.isString(v) ? v.split(/[,、]/) : []).map((entry) => {
|
|
26
|
+
const ids = _.compact(entry.split('-').map((id) => id.trim()));
|
|
27
|
+
return ids.length > 0 ? ids : null;
|
|
28
|
+
})
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const touched = _.filter(FIELDS, (conf) => _.has(doc, conf.field));
|
|
32
|
+
if(touched.length === 0){
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// beforeUpdate 的 doc 可能带着没改的字段原样回传; 值没变就不重算, 否则标签改名后
|
|
37
|
+
// 随便保存一次历史单据就会把快照刷成新名称
|
|
38
|
+
// 快照只是附加信息, 任何异常都不能挡住单据保存(系统已上线, 存量单据照常可改)
|
|
39
|
+
try {
|
|
40
|
+
let previousDoc = null;
|
|
41
|
+
if(!isInsert && ctx.params.id){
|
|
42
|
+
const prevRows = await ctx.getObject(OBJECT_NAME).directFind({
|
|
43
|
+
filters: [['_id', '=', ctx.params.id]],
|
|
44
|
+
fields: _.flatMap(FIELDS, (conf) => [conf.field, conf.labelField]),
|
|
45
|
+
top: 1
|
|
46
|
+
});
|
|
47
|
+
previousDoc = prevRows && prevRows.length > 0 ? prevRows[0] : null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
for(const conf of touched){
|
|
51
|
+
const paths = parsePaths(doc[conf.field]);
|
|
52
|
+
if(previousDoc && previousDoc[conf.labelField]
|
|
53
|
+
&& _.isEqual(paths, parsePaths(previousDoc[conf.field]))){
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if(paths.length === 0){
|
|
57
|
+
doc[conf.labelField] = null;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
let nameByValue = {};
|
|
61
|
+
const picklists = await ctx.getObject('picklists').directFind({
|
|
62
|
+
filters: [['code', '=', conf.tagId]], fields: ['_id'], top: 1
|
|
63
|
+
});
|
|
64
|
+
if(picklists.length > 0){
|
|
65
|
+
// 不过滤 enable: 已停用的选项也要能还原名称
|
|
66
|
+
const options = await ctx.getObject('picklist_options').directFind({
|
|
67
|
+
filters: [['picklist', '=', picklists[0]._id], ['value', 'in', _.uniq(_.flatten(paths))]],
|
|
68
|
+
fields: ['value', 'name']
|
|
69
|
+
});
|
|
70
|
+
nameByValue = _.fromPairs(_.map(options, (op) => [op.value, op.name]));
|
|
71
|
+
}
|
|
72
|
+
// 查不到名称的那一级保留原 ID, 不留空
|
|
73
|
+
doc[conf.labelField] = _.map(paths, (ids) => _.map(ids, (id) => nameByValue[id] || id).join('-')).join('、');
|
|
74
|
+
}
|
|
75
|
+
} catch (e) {
|
|
76
|
+
console.error('[标签名称快照]计算失败, 不影响保存', ctx.params && ctx.params.id, e && e.message);
|
|
77
|
+
}
|
|
78
|
+
authentication_type: none
|
|
79
|
+
locked: false
|
|
80
|
+
type: code
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: pepsico_material_tag_label
|
|
2
|
+
listenTo: pepsico_material
|
|
3
|
+
when:
|
|
4
|
+
- beforeInsert
|
|
5
|
+
- beforeUpdate
|
|
6
|
+
isEnabled: true
|
|
7
|
+
handler: |-
|
|
8
|
+
const { _ } = global;
|
|
9
|
+
const { doc } = ctx.params;
|
|
10
|
+
const isInsert = ctx.params.isInsert === true;
|
|
11
|
+
|
|
12
|
+
// 标签名称快照: 选中标签时把名称存到 *_label, 之后标签在 Content Hub 改名 / 停用都不回刷,
|
|
13
|
+
// 历史单据不会因为选项停用而只剩一串 ID。
|
|
14
|
+
// 解析规则与 src/methods/tag_label.ts 一致(那边供存量回填与单测), 改一处要同步改另一处。
|
|
15
|
+
const OBJECT_NAME = 'pepsico_material';
|
|
16
|
+
const FIELDS = [
|
|
17
|
+
{ field: 'material_type', labelField: 'material_type_label', tagId: '223321001114222' }
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
// 字段值 → 路径列表(各级 tagValId); 值可能是字符串或数组, 多个路径可能用 、 或 , 连接
|
|
21
|
+
const parsePaths = (value) => _.compact(
|
|
22
|
+
_.flatMap(_.castArray(value), (v) => _.isString(v) ? v.split(/[,、]/) : []).map((entry) => {
|
|
23
|
+
const ids = _.compact(entry.split('-').map((id) => id.trim()));
|
|
24
|
+
return ids.length > 0 ? ids : null;
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const touched = _.filter(FIELDS, (conf) => _.has(doc, conf.field));
|
|
29
|
+
if(touched.length === 0){
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// beforeUpdate 的 doc 可能带着没改的字段原样回传; 值没变就不重算, 否则标签改名后
|
|
34
|
+
// 随便保存一次历史单据就会把快照刷成新名称
|
|
35
|
+
// 快照只是附加信息, 任何异常都不能挡住单据保存(系统已上线, 存量单据照常可改)
|
|
36
|
+
try {
|
|
37
|
+
let previousDoc = null;
|
|
38
|
+
if(!isInsert && ctx.params.id){
|
|
39
|
+
const prevRows = await ctx.getObject(OBJECT_NAME).directFind({
|
|
40
|
+
filters: [['_id', '=', ctx.params.id]],
|
|
41
|
+
fields: _.flatMap(FIELDS, (conf) => [conf.field, conf.labelField]),
|
|
42
|
+
top: 1
|
|
43
|
+
});
|
|
44
|
+
previousDoc = prevRows && prevRows.length > 0 ? prevRows[0] : null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
for(const conf of touched){
|
|
48
|
+
const paths = parsePaths(doc[conf.field]);
|
|
49
|
+
if(previousDoc && previousDoc[conf.labelField]
|
|
50
|
+
&& _.isEqual(paths, parsePaths(previousDoc[conf.field]))){
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if(paths.length === 0){
|
|
54
|
+
doc[conf.labelField] = null;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
let nameByValue = {};
|
|
58
|
+
const picklists = await ctx.getObject('picklists').directFind({
|
|
59
|
+
filters: [['code', '=', conf.tagId]], fields: ['_id'], top: 1
|
|
60
|
+
});
|
|
61
|
+
if(picklists.length > 0){
|
|
62
|
+
// 不过滤 enable: 已停用的选项也要能还原名称
|
|
63
|
+
const options = await ctx.getObject('picklist_options').directFind({
|
|
64
|
+
filters: [['picklist', '=', picklists[0]._id], ['value', 'in', _.uniq(_.flatten(paths))]],
|
|
65
|
+
fields: ['value', 'name']
|
|
66
|
+
});
|
|
67
|
+
nameByValue = _.fromPairs(_.map(options, (op) => [op.value, op.name]));
|
|
68
|
+
}
|
|
69
|
+
// 查不到名称的那一级保留原 ID, 不留空
|
|
70
|
+
doc[conf.labelField] = _.map(paths, (ids) => _.map(ids, (id) => nameByValue[id] || id).join('-')).join('、');
|
|
71
|
+
}
|
|
72
|
+
} catch (e) {
|
|
73
|
+
console.error('[标签名称快照]计算失败, 不影响保存', ctx.params && ctx.params.id, e && e.message);
|
|
74
|
+
}
|
|
75
|
+
authentication_type: none
|
|
76
|
+
locked: false
|
|
77
|
+
type: code
|