Skip to content

Commit c06b8bb

Browse files
authored
fix:retrieve correctly the renamed space - EXO-61820 (#253)
Prior to this fix, we could not attach files nor create forms for a process that is managed by a renamed space because the group Id of the space was calculated based on the remoteId which changes when the space is renamed. This fix retrieves correctly the space by calling Space Rest API instead of calculating the group of the space based on its remoteId
1 parent d8dfc8a commit c06b8bb

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,6 @@ build
5252
npm-debug.log
5353
node_modules
5454
/bin/
55+
56+
# vscode
57+
.vscode/

processes-webapp/src/main/webapp/vue-app/processes/components/WorkFlowSuggesterSpace.vue

+7-11
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,16 @@ export default {
7272
watch: {
7373
workFlowOwner() {
7474
this.resetCustomValidity();
75-
if (this.workFlowOwner) {
76-
this.workflow.parentSpace = {
77-
id: this.workFlowOwner.spaceId,
78-
displayName: this.workFlowOwner.profile.fullName,
79-
groupId: `/spaces/${this.workFlowOwner.remoteId}`,
80-
name: this.workFlowOwner.remoteId,
81-
prettyName: this.workFlowOwner.remoteId,
82-
url: this.workFlowOwner.remoteId,
83-
avatarUrl: this.workFlowOwner.profile.avatar,
84-
};
75+
if (this.workFlowOwner && this.workFlowOwner.spaceId) {
76+
this.$spaceService.getSpaceById(this.workFlowOwner.spaceId)
77+
.then(space => {
78+
this.workflow.parentSpace = space;
79+
this.$emit('initialized');
80+
});
8581
} else {
8682
this.workflow.parentSpace = null;
83+
this.$emit('initialized');
8784
}
88-
this.$emit('initialized');
8985
},
9086
},
9187
methods: {

processes-webapp/src/main/webapp/vue-app/processes/components/attachments-integration/ProcessesAttachments.vue

+10-11
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,22 @@ export default {
131131
attachmentsLength() {
132132
return this.attachments && this.attachments.length > 0 ? `(${this.attachments.length})` : '';
133133
},
134-
drive() {
135-
if (this.workflowParentSpace) {
136-
const spaceGroupId = this.workflowParentSpace.groupId.split('/spaces/')[1];
137-
return {
138-
name: `.spaces.${spaceGroupId}`,
139-
title: this.workflowParentSpace.prettyName,
140-
isSelected: true
141-
};
142-
}
143-
return null;
144-
},
145134
isMobileDevice() {
146135
return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
147136
}
148137
},
149138
created() {
150139
this.initEntityAttachmentsList();
140+
if (this.workflowParentSpace) {
141+
this.$spaceService.getSpaceByPrettyName(this.workflowParentSpace.prettyName)
142+
.then(space => {
143+
this.drive = {
144+
name: `${space.groupId.replaceAll('/', '.')}`,
145+
title: space.displayName,
146+
isSelected: true
147+
};
148+
});
149+
}
151150
document.addEventListener('attachment-added', event => {
152151
if (this.editMode) {
153152
this.initEntityAttachmentsList();

0 commit comments

Comments
 (0)