@steedos-labs/content-compliance 1.0.3 → 1.0.5
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/bypassApproval.js +38 -36
- package/lib/actions/bypassApproval.js.map +1 -1
- package/lib/actions/terminate.js +1 -1
- package/lib/actions/terminate.js.map +1 -1
- package/lib/methods/__tests__/attachment.test.d.ts +1 -0
- package/lib/methods/__tests__/attachment.test.js +31 -0
- package/lib/methods/__tests__/attachment.test.js.map +1 -0
- package/lib/methods/__tests__/contentHubTagSync.test.js +41 -1
- package/lib/methods/__tests__/contentHubTagSync.test.js.map +1 -1
- package/lib/methods/__tests__/productPicklist.test.d.ts +1 -0
- package/lib/methods/__tests__/productPicklist.test.js +98 -0
- package/lib/methods/__tests__/productPicklist.test.js.map +1 -0
- package/lib/methods/__tests__/spaceUserAgencyFieldsMetadata.test.d.ts +1 -0
- package/lib/methods/__tests__/spaceUserAgencyFieldsMetadata.test.js +109 -0
- package/lib/methods/__tests__/spaceUserAgencyFieldsMetadata.test.js.map +1 -0
- package/lib/methods/__tests__/terminateBypassAttachments.test.d.ts +1 -0
- package/lib/methods/__tests__/terminateBypassAttachments.test.js +163 -0
- package/lib/methods/__tests__/terminateBypassAttachments.test.js.map +1 -0
- package/lib/methods/approval_engine.d.ts +1 -1
- package/lib/methods/approval_engine.js +69 -43
- package/lib/methods/approval_engine.js.map +1 -1
- package/lib/methods/attachment.d.ts +2 -0
- package/lib/methods/attachment.js +21 -0
- package/lib/methods/attachment.js.map +1 -0
- package/lib/methods/content_hub.js +3 -3
- package/lib/methods/content_hub.js.map +1 -1
- package/lib/methods/content_hub_material_group_rule.js +2 -2
- package/lib/methods/content_hub_material_group_rule.js.map +1 -1
- package/lib/methods/content_hub_tag.d.ts +4 -0
- package/lib/methods/content_hub_tag.js +10 -3
- package/lib/methods/content_hub_tag.js.map +1 -1
- package/lib/methods/dashboard_sync_data.js +34 -30
- package/lib/methods/dashboard_sync_data.js.map +1 -1
- package/lib/methods/product_picklist.d.ts +4 -0
- package/lib/methods/product_picklist.js +10 -0
- package/lib/methods/product_picklist.js.map +1 -0
- package/lib/methods/tag_label.d.ts +2 -0
- package/lib/methods/tag_label.js +4 -3
- package/lib/methods/tag_label.js.map +1 -1
- package/main/default/objects/pepsico_approval_process/fields/attachments.field.yml +11 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/product.field.yml +4 -2
- package/main/default/objects/pepsico_material_approval/buttons/pepsico_bypass_approval.button.yml +24 -1
- package/main/default/objects/pepsico_material_approval/buttons/pepsico_terminate.button.yml +24 -1
- package/main/default/objects/pepsico_material_approval/fields/ch_sync_rule_check.field.yml +4 -8
- package/main/default/objects/pepsico_material_approval/fields/product.field.yml +16 -3
- package/main/default/objects/pepsico_reviewer/fields/product.field.yml +11 -2
- package/main/default/triggers/pepsico_material_approval_changName.trigger.yml +3 -1
- package/main/default/triggers/pepsico_material_approval_tag_label.trigger.yml +6 -3
- package/package.json +2 -2
- package/public/account-apply/ccs-agency-application.docx +0 -0
- package/public/account-apply/ccs-employee-application.docx +0 -0
- package/public/dynamic.css +85 -0
- package/public/dynamic.js +96 -0
package/public/dynamic.css
CHANGED
|
@@ -118,6 +118,91 @@ input{
|
|
|
118
118
|
font-size: 14px !important;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
.account-apply-btn{
|
|
122
|
+
z-index: 999;
|
|
123
|
+
position: absolute;
|
|
124
|
+
right: 2.5rem;
|
|
125
|
+
bottom: 34px;
|
|
126
|
+
padding: 2px 12px;
|
|
127
|
+
font-size: 12px;
|
|
128
|
+
line-height: 20px;
|
|
129
|
+
color: rgb(2 53 90);
|
|
130
|
+
background: #ffffff;
|
|
131
|
+
border: solid 1px rgb(2 53 90);
|
|
132
|
+
border-radius: 4px;
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.account-apply-btn:hover{
|
|
137
|
+
background: rgb(2 53 90 / 8%);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.account-apply-modal{
|
|
141
|
+
display: none;
|
|
142
|
+
position: fixed;
|
|
143
|
+
inset: 0;
|
|
144
|
+
z-index: 10000;
|
|
145
|
+
align-items: center;
|
|
146
|
+
justify-content: center;
|
|
147
|
+
background: rgb(0 0 0 / 45%);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.account-apply-modal.show{
|
|
151
|
+
display: flex;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.account-apply-dialog{
|
|
155
|
+
width: 560px;
|
|
156
|
+
max-width: calc(100vw - 32px);
|
|
157
|
+
padding: 28px 32px 24px;
|
|
158
|
+
background: #ffffff;
|
|
159
|
+
border-radius: 8px;
|
|
160
|
+
box-shadow: 0 10px 30px rgb(0 0 0 / 20%);
|
|
161
|
+
color: #1f2937;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.account-apply-title{
|
|
165
|
+
font-size: 18px;
|
|
166
|
+
font-weight: bold;
|
|
167
|
+
margin-bottom: 12px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.account-apply-content{
|
|
171
|
+
font-size: 14px;
|
|
172
|
+
line-height: 24px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.account-apply-content p{
|
|
176
|
+
margin: 0 0 8px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.account-apply-content ul{
|
|
180
|
+
margin: 0 0 8px;
|
|
181
|
+
padding-left: 20px;
|
|
182
|
+
list-style: disc;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.account-apply-content a{
|
|
186
|
+
color: #2563eb;
|
|
187
|
+
text-decoration-line: underline;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.account-apply-footer{
|
|
191
|
+
display: flex;
|
|
192
|
+
justify-content: flex-end;
|
|
193
|
+
margin-top: 20px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.account-apply-footer button{
|
|
197
|
+
padding: 6px 20px;
|
|
198
|
+
font-size: 14px;
|
|
199
|
+
color: #ffffff;
|
|
200
|
+
background: rgb(2 53 90);
|
|
201
|
+
border: none;
|
|
202
|
+
border-radius: 4px;
|
|
203
|
+
cursor: pointer;
|
|
204
|
+
}
|
|
205
|
+
|
|
121
206
|
@keyframes shake {
|
|
122
207
|
0%, 100% { transform: translateX(0); }
|
|
123
208
|
25% { transform: translateX(-5px); }
|
package/public/dynamic.js
CHANGED
|
@@ -12,6 +12,99 @@ document.title = "内容审核";
|
|
|
12
12
|
|
|
13
13
|
// document.head.appendChild(link);
|
|
14
14
|
|
|
15
|
+
// 账号申请:申请表放在 public/account-apply/ 下,文件名固定,扩展名兼容 .docx / .xlsx(优先 .docx)
|
|
16
|
+
const ACCOUNT_APPLY_CONTACT = 'sweet.tian@pepsico.com';
|
|
17
|
+
const ACCOUNT_APPLY_FORMS = {
|
|
18
|
+
employee: { name: '百事食品审核系统内部员工申请表', path: '/account-apply/ccs-employee-application' },
|
|
19
|
+
agency: { name: '百事食品审核系统Agency申请表', path: '/account-apply/ccs-agency-application' }
|
|
20
|
+
};
|
|
21
|
+
const ACCOUNT_APPLY_EXTENSIONS = ['.docx', '.xlsx'];
|
|
22
|
+
|
|
23
|
+
// 依次探测各扩展名的文件是否存在,返回第一个存在的地址
|
|
24
|
+
async function resolveAccountApplyFormUrl(form) {
|
|
25
|
+
for (const ext of ACCOUNT_APPLY_EXTENSIONS) {
|
|
26
|
+
const url = form.path + ext;
|
|
27
|
+
try {
|
|
28
|
+
const res = await fetch(url, { method: 'HEAD', cache: 'no-store' });
|
|
29
|
+
const contentType = res.headers.get('content-type') || '';
|
|
30
|
+
// 排除不存在的路径被回退成 html 页面的情况
|
|
31
|
+
if (res.ok && contentType.indexOf('text/html') === -1) {
|
|
32
|
+
return { url: url, ext: ext };
|
|
33
|
+
}
|
|
34
|
+
} catch (e) {
|
|
35
|
+
// 忽略,继续探测下一个扩展名
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function downloadAccountApplyForm(key) {
|
|
42
|
+
const form = ACCOUNT_APPLY_FORMS[key];
|
|
43
|
+
const file = await resolveAccountApplyFormUrl(form);
|
|
44
|
+
if (!file) {
|
|
45
|
+
alert('申请表暂未提供,请联系 ' + ACCOUNT_APPLY_CONTACT);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const a = document.createElement('a');
|
|
49
|
+
a.href = file.url;
|
|
50
|
+
a.download = form.name + file.ext;
|
|
51
|
+
document.body.appendChild(a);
|
|
52
|
+
a.click();
|
|
53
|
+
document.body.removeChild(a);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function createAccountApplyModal() {
|
|
57
|
+
if (document.getElementById('accountApplyModal')) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const modal = document.createElement('div');
|
|
61
|
+
modal.id = 'accountApplyModal';
|
|
62
|
+
modal.classList.add('account-apply-modal');
|
|
63
|
+
modal.innerHTML =
|
|
64
|
+
'<div class="account-apply-dialog" role="dialog" aria-modal="true">' +
|
|
65
|
+
'<div class="account-apply-title">账号申请</div>' +
|
|
66
|
+
'<div class="account-apply-content">' +
|
|
67
|
+
'<p>如需开通百事食品审核系统账号,请下载对应的申请表,审核通过后开通:</p>' +
|
|
68
|
+
'<ul>' +
|
|
69
|
+
'<li>百事食品内部员工:<a href="#" data-form="employee">【百事食品审核系统内部员工申请表】</a></li>' +
|
|
70
|
+
'<li>百事食品 Agency 成员:<a href="#" data-form="agency">【百事食品审核系统 Agency 申请表】</a></li>' +
|
|
71
|
+
'</ul>' +
|
|
72
|
+
'<p>申请表填写完成后,内部员工请线下获取 Line manager 的邮件审批,Agency 成员请线下获取百事内部对接人的邮件审批;' +
|
|
73
|
+
'审批通过后,请附上审批邮件联系 Sweet Tian(<a href="mailto:' + ACCOUNT_APPLY_CONTACT + '">' + ACCOUNT_APPLY_CONTACT + '</a>)开通账号。</p>' +
|
|
74
|
+
'</div>' +
|
|
75
|
+
'<div class="account-apply-footer"><button type="button" class="account-apply-ok">知道了</button></div>' +
|
|
76
|
+
'</div>';
|
|
77
|
+
|
|
78
|
+
modal.addEventListener('click', function (event) {
|
|
79
|
+
const formLink = event.target.closest('a[data-form]');
|
|
80
|
+
if (formLink) {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
downloadAccountApplyForm(formLink.getAttribute('data-form'));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (event.target === modal || event.target.classList.contains('account-apply-ok')) {
|
|
86
|
+
modal.classList.remove('show');
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
document.body.appendChild(modal);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function appendAccountApplyButton(element) {
|
|
93
|
+
if (element.querySelector('.account-apply-btn')) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const button = document.createElement('button');
|
|
97
|
+
button.type = 'button';
|
|
98
|
+
button.classList.add('account-apply-btn');
|
|
99
|
+
button.textContent = '账号申请';
|
|
100
|
+
button.addEventListener('click', function (event) {
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
createAccountApplyModal();
|
|
103
|
+
document.getElementById('accountApplyModal').classList.add('show');
|
|
104
|
+
});
|
|
105
|
+
element.appendChild(button);
|
|
106
|
+
}
|
|
107
|
+
|
|
15
108
|
|
|
16
109
|
function appendAgreement() {
|
|
17
110
|
const element = document.querySelector('.relative.rounded.p-10.sm\\:shadow-md.bg-white.w-screen.max-w-md');
|
|
@@ -73,6 +166,9 @@ function appendAgreement() {
|
|
|
73
166
|
// 在提交按钮前插入容器
|
|
74
167
|
element.appendChild(container);
|
|
75
168
|
|
|
169
|
+
// 登录框右下角:账号申请按钮
|
|
170
|
+
appendAccountApplyButton(element);
|
|
171
|
+
|
|
76
172
|
const ssoBtn = document.querySelector('.w-full.border.border-gray-300.justify-center.hover\\:bg-gray-50.text-gray-800.py-2.px-4.rounded.inline-flex.items-center')
|
|
77
173
|
|
|
78
174
|
if(ssoBtn){
|