Skip to content

Commit

Permalink
feat: add closedBy on apps-engine (#33048)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored Aug 22, 2024
1 parent 10baefd commit d9dd2c4
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 25 deletions.
20 changes: 17 additions & 3 deletions apps/meteor/app/apps/server/converters/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export class AppRoomsConverter {
return Object.assign(newRoom, room._unmappedProperties_);
}

async convertRoom(room) {
if (!room) {
async convertRoom(originalRoom) {
if (!originalRoom) {
return undefined;
}

Expand All @@ -134,6 +134,7 @@ export class AppRoomsConverter {
_USERNAMES: '_USERNAMES',
description: 'description',
source: 'source',
closer: 'closer',
isDefault: (room) => {
const result = !!room.default;
delete room.default;
Expand Down Expand Up @@ -210,6 +211,19 @@ export class AppRoomsConverter {

return this.orch.getConverters().get('departments').convertById(departmentId);
},
closedBy: async (room) => {
const { closedBy } = room;

if (!closedBy) {
return undefined;
}

delete room.closedBy;
if (originalRoom.closer === 'user') {
return this.orch.getConverters().get('users').convertById(closedBy._id);
}
return this.orch.getConverters().get('visitors').convertById(closedBy._id);
},
servedBy: async (room) => {
const { servedBy } = room;

Expand Down Expand Up @@ -245,7 +259,7 @@ export class AppRoomsConverter {
},
};

return transformMappedData(room, map);
return transformMappedData(originalRoom, map);
}

_convertTypeToApp(typeChar) {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/ee/server/services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"author": "Rocket.Chat",
"license": "MIT",
"dependencies": {
"@rocket.chat/apps-engine": "1.45.0-alpha.864",
"@rocket.chat/apps-engine": "1.45.0-alpha.866",
"@rocket.chat/core-services": "workspace:^",
"@rocket.chat/core-typings": "workspace:^",
"@rocket.chat/emitter": "~0.31.25",
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
"@rocket.chat/agenda": "workspace:^",
"@rocket.chat/api-client": "workspace:^",
"@rocket.chat/apps": "workspace:^",
"@rocket.chat/apps-engine": "1.45.0-alpha.864",
"@rocket.chat/apps-engine": "1.45.0-alpha.866",
"@rocket.chat/base64": "workspace:^",
"@rocket.chat/cas-validate": "workspace:^",
"@rocket.chat/core-services": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion ee/apps/ddp-streamer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"author": "Rocket.Chat",
"dependencies": {
"@rocket.chat/apps-engine": "1.45.0-alpha.864",
"@rocket.chat/apps-engine": "1.45.0-alpha.866",
"@rocket.chat/core-services": "workspace:^",
"@rocket.chat/core-typings": "workspace:^",
"@rocket.chat/emitter": "~0.31.25",
Expand Down
2 changes: 1 addition & 1 deletion ee/packages/presence/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@babel/core": "~7.22.20",
"@babel/preset-env": "~7.22.20",
"@babel/preset-typescript": "~7.22.15",
"@rocket.chat/apps-engine": "1.45.0-alpha.864",
"@rocket.chat/apps-engine": "1.45.0-alpha.866",
"@rocket.chat/eslint-config": "workspace:^",
"@rocket.chat/rest-typings": "workspace:^",
"@types/node": "^14.18.63",
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"/dist"
],
"dependencies": {
"@rocket.chat/apps-engine": "1.45.0-alpha.864",
"@rocket.chat/apps-engine": "1.45.0-alpha.866",
"@rocket.chat/core-typings": "workspace:^",
"@rocket.chat/model-typings": "workspace:^"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core-services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"extends": "../../package.json"
},
"dependencies": {
"@rocket.chat/apps-engine": "1.45.0-alpha.864",
"@rocket.chat/apps-engine": "1.45.0-alpha.866",
"@rocket.chat/core-typings": "workspace:^",
"@rocket.chat/icons": "~0.38.0",
"@rocket.chat/message-parser": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/core-typings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"/dist"
],
"dependencies": {
"@rocket.chat/apps-engine": "1.45.0-alpha.864",
"@rocket.chat/apps-engine": "1.45.0-alpha.866",
"@rocket.chat/icons": "~0.38.0",
"@rocket.chat/message-parser": "workspace:^",
"@rocket.chat/ui-kit": "workspace:~"
Expand Down
2 changes: 1 addition & 1 deletion packages/fuselage-ui-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@babel/preset-env": "~7.22.20",
"@babel/preset-react": "~7.22.15",
"@babel/preset-typescript": "~7.22.15",
"@rocket.chat/apps-engine": "1.45.0-alpha.864",
"@rocket.chat/apps-engine": "1.45.0-alpha.866",
"@rocket.chat/core-typings": "workspace:^",
"@rocket.chat/eslint-config": "workspace:^",
"@rocket.chat/fuselage": "^0.57.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/rest-typings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"/dist"
],
"dependencies": {
"@rocket.chat/apps-engine": "1.45.0-alpha.864",
"@rocket.chat/apps-engine": "1.45.0-alpha.866",
"@rocket.chat/core-typings": "workspace:^",
"@rocket.chat/message-parser": "workspace:^",
"@rocket.chat/ui-kit": "workspace:~",
Expand Down
26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8483,9 +8483,9 @@ __metadata:
languageName: unknown
linkType: soft

"@rocket.chat/apps-engine@npm:1.45.0-alpha.864":
version: 1.45.0-alpha.864
resolution: "@rocket.chat/apps-engine@npm:1.45.0-alpha.864"
"@rocket.chat/apps-engine@npm:1.45.0-alpha.866":
version: 1.45.0-alpha.866
resolution: "@rocket.chat/apps-engine@npm:1.45.0-alpha.866"
dependencies:
"@msgpack/msgpack": 3.0.0-beta2
adm-zip: ^0.5.9
Expand All @@ -8501,15 +8501,15 @@ __metadata:
uuid: ~8.3.2
peerDependencies:
"@rocket.chat/ui-kit": "*"
checksum: 4f223dd0671d920e4eaafa465fe87584473f3295061252d1020c0d0e1c076c3b74ee98af1ee5aedfeb72b042e38c3f381d10a151b3a2abcf33a7de8ac6146fa1
checksum: 04abb4f712fcca206c6791322b52e2a3d97f3db06f606cd1f58fdda4e63d2123d7004bb445ad7582c52808c3ec4433d465d8855e24f3ab2f8457dafa6b017c5b
languageName: node
linkType: hard

"@rocket.chat/apps@workspace:^, @rocket.chat/apps@workspace:packages/apps":
version: 0.0.0-use.local
resolution: "@rocket.chat/apps@workspace:packages/apps"
dependencies:
"@rocket.chat/apps-engine": 1.45.0-alpha.864
"@rocket.chat/apps-engine": 1.45.0-alpha.866
"@rocket.chat/core-typings": "workspace:^"
"@rocket.chat/model-typings": "workspace:^"
eslint: ~8.45.0
Expand Down Expand Up @@ -8582,7 +8582,7 @@ __metadata:
"@babel/core": ~7.22.20
"@babel/preset-env": ~7.22.20
"@babel/preset-typescript": ~7.22.15
"@rocket.chat/apps-engine": 1.45.0-alpha.864
"@rocket.chat/apps-engine": 1.45.0-alpha.866
"@rocket.chat/core-typings": "workspace:^"
"@rocket.chat/eslint-config": "workspace:^"
"@rocket.chat/icons": ~0.38.0
Expand All @@ -8609,7 +8609,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@rocket.chat/core-typings@workspace:packages/core-typings"
dependencies:
"@rocket.chat/apps-engine": 1.45.0-alpha.864
"@rocket.chat/apps-engine": 1.45.0-alpha.866
"@rocket.chat/eslint-config": "workspace:^"
"@rocket.chat/icons": ~0.38.0
"@rocket.chat/message-parser": "workspace:^"
Expand Down Expand Up @@ -8681,7 +8681,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@rocket.chat/ddp-streamer@workspace:ee/apps/ddp-streamer"
dependencies:
"@rocket.chat/apps-engine": 1.45.0-alpha.864
"@rocket.chat/apps-engine": 1.45.0-alpha.866
"@rocket.chat/core-services": "workspace:^"
"@rocket.chat/core-typings": "workspace:^"
"@rocket.chat/ddp-client": "workspace:~"
Expand Down Expand Up @@ -8879,7 +8879,7 @@ __metadata:
"@babel/preset-env": ~7.22.20
"@babel/preset-react": ~7.22.15
"@babel/preset-typescript": ~7.22.15
"@rocket.chat/apps-engine": 1.45.0-alpha.864
"@rocket.chat/apps-engine": 1.45.0-alpha.866
"@rocket.chat/core-typings": "workspace:^"
"@rocket.chat/eslint-config": "workspace:^"
"@rocket.chat/fuselage": ^0.57.0
Expand Down Expand Up @@ -9329,7 +9329,7 @@ __metadata:
"@rocket.chat/agenda": "workspace:^"
"@rocket.chat/api-client": "workspace:^"
"@rocket.chat/apps": "workspace:^"
"@rocket.chat/apps-engine": 1.45.0-alpha.864
"@rocket.chat/apps-engine": 1.45.0-alpha.866
"@rocket.chat/base64": "workspace:^"
"@rocket.chat/cas-validate": "workspace:^"
"@rocket.chat/core-services": "workspace:^"
Expand Down Expand Up @@ -9952,7 +9952,7 @@ __metadata:
"@babel/core": ~7.22.20
"@babel/preset-env": ~7.22.20
"@babel/preset-typescript": ~7.22.15
"@rocket.chat/apps-engine": 1.45.0-alpha.864
"@rocket.chat/apps-engine": 1.45.0-alpha.866
"@rocket.chat/core-services": "workspace:^"
"@rocket.chat/core-typings": "workspace:^"
"@rocket.chat/eslint-config": "workspace:^"
Expand Down Expand Up @@ -10066,7 +10066,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@rocket.chat/rest-typings@workspace:packages/rest-typings"
dependencies:
"@rocket.chat/apps-engine": 1.45.0-alpha.864
"@rocket.chat/apps-engine": 1.45.0-alpha.866
"@rocket.chat/core-typings": "workspace:^"
"@rocket.chat/eslint-config": "workspace:~"
"@rocket.chat/message-parser": "workspace:^"
Expand Down Expand Up @@ -36694,7 +36694,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "rocketchat-services@workspace:apps/meteor/ee/server/services"
dependencies:
"@rocket.chat/apps-engine": 1.45.0-alpha.864
"@rocket.chat/apps-engine": 1.45.0-alpha.866
"@rocket.chat/core-services": "workspace:^"
"@rocket.chat/core-typings": "workspace:^"
"@rocket.chat/emitter": ~0.31.25
Expand Down

0 comments on commit d9dd2c4

Please sign in to comment.