@giteeteam/apps-team-components 1.0.37 → 1.0.39
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.
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
export const getFullName = (value) => {
|
|
2
|
+
const fullPath = getFullPath(value);
|
|
3
|
+
if (!fullPath)
|
|
4
|
+
return value === null || value === void 0 ? void 0 : value.name;
|
|
5
|
+
return `${fullPath}/${value === null || value === void 0 ? void 0 : value.name}`;
|
|
6
|
+
};
|
|
1
7
|
export const formatDisplayValue = (value) => {
|
|
2
|
-
const values = (Array.isArray(value) ? value : [value]).map(item => item
|
|
8
|
+
const values = (Array.isArray(value) ? value : [value]).map(item => getFullName(item)).filter(Boolean);
|
|
3
9
|
return values.join('、');
|
|
4
10
|
};
|
|
11
|
+
export const getFullPath = (value) => {
|
|
12
|
+
const { repo, path } = value || {};
|
|
13
|
+
let fullPath = repo;
|
|
14
|
+
if (path) {
|
|
15
|
+
fullPath += '/' + path;
|
|
16
|
+
}
|
|
17
|
+
return fullPath;
|
|
18
|
+
};
|
|
@@ -17,7 +17,7 @@ export const workflowContentStyle = `
|
|
|
17
17
|
text-align: left;
|
|
18
18
|
`;
|
|
19
19
|
export const statePopoverStyle = (antPrefix) => `
|
|
20
|
-
z-index:
|
|
20
|
+
z-index: 1000 !important;
|
|
21
21
|
|
|
22
22
|
div.${antPrefix}-popover-inner-content, div.${antPrefix}-popover-inner {
|
|
23
23
|
padding: 0;
|
package/dist/lib/workflow.js
CHANGED
|
@@ -167,10 +167,21 @@ export function checkUserPermission({ transition, userId, roleIds, groupIds, ite
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
if (hasUserFields) {
|
|
170
|
-
const
|
|
170
|
+
const fieldKeys = authUserFields.map(field => field.value || field.key);
|
|
171
|
+
const userFieldObj = pick(values, fieldKeys);
|
|
171
172
|
let hasAuth = false;
|
|
172
173
|
const keys = Object.keys(userFieldObj);
|
|
174
|
+
if (fieldKeys.includes(ItemFieldType.reporter)) {
|
|
175
|
+
keys.push(ItemFieldType.reporter);
|
|
176
|
+
}
|
|
173
177
|
for (let i = 0; i < keys.length; i++) {
|
|
178
|
+
if (keys[i] === ItemFieldType.reporter) {
|
|
179
|
+
const reporter = item[ItemFieldType.reporter] || {};
|
|
180
|
+
if (reporter.objectId === userId) {
|
|
181
|
+
hasAuth = true;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
174
185
|
const fieldObj = userFieldObj[keys[i]];
|
|
175
186
|
if (fieldObj && fieldObj.length) {
|
|
176
187
|
hasAuth = fieldObj.map(user => user.value).includes(userId);
|