From 4b0da9292401d8539971712caf5eb1d1e46fdd26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 22 Feb 2023 17:50:05 -0600 Subject: [PATCH 01/17] add leaveRoom action --- src/libs/actions/Policy.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index c269accf6ae1..b571a25642fa 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -1000,6 +1000,38 @@ function openWorkspaceInvitePage(policyID, clientMemberEmails) { }); } +/** + * + * @param {String} reportID + */ +function leaveRoom(reportID) { + API.write('LeaveRoom', { + reportID, + }, { + optimisticData: [ + { + onyxMethod: CONST.ONYX.METHOD.SET, + key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, + value: { + stateNum: CONST.REPORT.STATE_NUM.SUBMITTED, + statusNum: CONST.REPORT.STATUS.CLOSED, + }, + }, + ], + failureData: [ + { + onyxMethod: CONST.ONYX.METHOD.SET, + key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, + value: { + stateNum: CONST.REPORT.STATE_NUM.OPEN, + statusNum: CONST.REPORT.STATUS.OPEN, + }, + }, + ], + }); + Navigation.dismissModal(); +} + export { removeMembers, addMembersToWorkspace, @@ -1027,4 +1059,5 @@ export { openWorkspaceMembersPage, openWorkspaceInvitePage, removeWorkspace, + leaveRoom, }; From 60dccf3c6432abb3d2012c2a79849a83bd2f0f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 22 Feb 2023 17:52:10 -0600 Subject: [PATCH 02/17] hook up leaveRoom action to Leave room button --- src/pages/ReportDetailsPage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 688b691fb62c..3a3cdfce1ddb 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -15,6 +15,7 @@ import styles from '../styles/styles'; import DisplayNames from '../components/DisplayNames'; import * as OptionsListUtils from '../libs/OptionsListUtils'; import * as ReportUtils from '../libs/ReportUtils'; +import * as Policy from '../libs/actions/Policy'; import participantPropTypes from '../components/participantPropTypes'; import * as Expensicons from '../components/Icon/Expensicons'; import ROUTES from '../ROUTES'; @@ -91,7 +92,7 @@ class ReportDetailsPage extends Component { key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, translationKey: 'common.leaveRoom', icon: Expensicons.Exit, - action: () => { /* Placeholder for when leaving rooms is built in */ }, + action: () => Policy.leaveRoom(this.props.report), }); } return menuItems; From 60f200232043bec5cf07967901c91436ecee6df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 22 Feb 2023 18:04:51 -0600 Subject: [PATCH 03/17] add new visibility values --- src/CONST.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CONST.js b/src/CONST.js index 1677e3d1663b..c8a9368f5461 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -352,6 +352,12 @@ const CONST = { ALWAYS: 'always', }, VISIBILITY: { + PUBLIC: 'public', + POLICY_ANNOUNCE: 'policy_announce', + POLICY_ADMINS: 'policy_admins', + POLICY: 'policy', + DOMAIN: 'domain', + DM: 'dm', RESTRICTED: 'restricted', PRIVATE: 'private', }, From 3c49baa1b811f4d57e186e81ce2e3a06504a491b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 22 Feb 2023 18:18:30 -0600 Subject: [PATCH 04/17] add missing visibility value --- src/CONST.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index c8a9368f5461..f3af31c03de8 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -353,13 +353,14 @@ const CONST = { }, VISIBILITY: { PUBLIC: 'public', - POLICY_ANNOUNCE: 'policy_announce', + PUBLIC_ANNOUNCE: 'public_announce', POLICY_ADMINS: 'policy_admins', + POLICY_ANNOUNCE: 'policy_announce', POLICY: 'policy', DOMAIN: 'domain', DM: 'dm', - RESTRICTED: 'restricted', PRIVATE: 'private', + RESTRICTED: 'restricted', }, RESERVED_ROOM_NAMES: ['#admins', '#announce'], MAX_PREVIEW_AVATARS: 4, From 6760e66cb390373d3b14f31fba577d7d836a7066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 22 Feb 2023 18:19:49 -0600 Subject: [PATCH 05/17] add canLeaveRoom function --- src/libs/ReportUtils.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index c3fbddf5c33a..a229d03a9109 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -1518,12 +1518,37 @@ function getIOUOptions(report, reportParticipants, betas) { ]; } +/** + * + * @param {String} visibility + * @param {Boolean} isPolicyMember + * @returns {Boolean} + */ +function canLeaveRoom(visibility, isPolicyMember) { + if (!_.find(CONST.REPORT.VISIBILITY, value => value === visibility)) { + return false; + } + if (visibility === CONST.REPORT.VISIBILITY.PUBLIC + || visibility === CONST.REPORT.VISIBILITY.PRIVATE + || visibility === CONST.REPORT.VISIBILITY.POLICY) { + return true; + } + if (visibility === CONST.REPORT.VISIBILITY.PUBLIC_ANNOUNCE) { + // Only non-policy members can leave + if (!isPolicyMember) { + return true; + } + } + return false; +} + export { getReportParticipantsTitle, isReportMessageAttachment, findLastAccessedReport, canEditReportAction, canDeleteReportAction, + canLeaveRoom, sortReportsByLastRead, isDefaultRoom, isAdminRoom, From f4885e638a49865eb5ffa17e8868ba2397e3d696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 22 Feb 2023 18:34:38 -0600 Subject: [PATCH 06/17] hide the Leave room button if use cannot leave --- src/pages/ReportDetailsPage.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 3a3cdfce1ddb..44594a745ec1 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -87,13 +87,18 @@ class ReportDetailsPage extends Component { translationKey: 'common.invite', icon: Expensicons.Plus, action: () => { /* Placeholder for when inviting other users is built in */ }, - }, - { - key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, - translationKey: 'common.leaveRoom', - icon: Expensicons.Exit, - action: () => Policy.leaveRoom(this.props.report), }); + + const policy = this.props.policies[`${ONYXKEYS.COLLECTION.POLICY}${this.props.report.policyID}`]; + const isPolicyMember = policy && _.find(policy.employeeList.emails, email => email === this.props.session.email); + if (ReportUtils.canLeaveRoom(this.props.report.visibility, isPolicyMember)) { + menuItems.push({ + key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, + translationKey: 'common.leaveRoom', + icon: Expensicons.Exit, + action: () => Policy.leaveRoom(this.props.report), + }); + } } return menuItems; } From 85f93a18916210c452e834cc0e61035310d52afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 22 Feb 2023 18:35:19 -0600 Subject: [PATCH 07/17] add comment --- src/pages/ReportDetailsPage.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 44594a745ec1..fe57742e588f 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -89,6 +89,7 @@ class ReportDetailsPage extends Component { action: () => { /* Placeholder for when inviting other users is built in */ }, }); + // Only show the leave room option if the user can leave the room const policy = this.props.policies[`${ONYXKEYS.COLLECTION.POLICY}${this.props.report.policyID}`]; const isPolicyMember = policy && _.find(policy.employeeList.emails, email => email === this.props.session.email); if (ReportUtils.canLeaveRoom(this.props.report.visibility, isPolicyMember)) { From 4fec5ff363e5669c44c9944d344057e62c9a81e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 1 Mar 2023 17:34:54 -0600 Subject: [PATCH 08/17] include only public and public_announce values --- src/CONST.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index 0a822710ae47..4de4c746e99e 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -354,11 +354,6 @@ const CONST = { VISIBILITY: { PUBLIC: 'public', PUBLIC_ANNOUNCE: 'public_announce', - POLICY_ADMINS: 'policy_admins', - POLICY_ANNOUNCE: 'policy_announce', - POLICY: 'policy', - DOMAIN: 'domain', - DM: 'dm', PRIVATE: 'private', RESTRICTED: 'restricted', }, From a48c312b340d35abeab77b7626a75106f8ebb3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 1 Mar 2023 17:35:10 -0600 Subject: [PATCH 09/17] fix Policy.leaveRoom --- src/pages/ReportDetailsPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index ef79770c4132..0c729f1a3759 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -97,7 +97,7 @@ class ReportDetailsPage extends Component { key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, translationKey: 'common.leaveRoom', icon: Expensicons.Exit, - action: () => Policy.leaveRoom(this.props.report), + action: () => Policy.leaveRoom(this.props.report.reportID), }); } } From d3a7f2441d0496026593cf7ef05928e451c6fca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 1 Mar 2023 17:38:42 -0600 Subject: [PATCH 10/17] fix New Room page --- src/pages/workspace/WorkspaceNewRoomPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceNewRoomPage.js b/src/pages/workspace/WorkspaceNewRoomPage.js index 0cc96e7ce33a..2616ce3770b0 100644 --- a/src/pages/workspace/WorkspaceNewRoomPage.js +++ b/src/pages/workspace/WorkspaceNewRoomPage.js @@ -117,7 +117,7 @@ class WorkspaceNewRoomPage extends React.Component { policy => ({label: policy.name, key: policy.id, value: policy.id}), ); - const visibilityOptions = _.map(_.values(CONST.REPORT.VISIBILITY), visibilityOption => ({ + const visibilityOptions = _.map([CONST.REPORT.VISIBILITY.PRIVATE, CONST.REPORT.VISIBILITY.RESTRICTED], visibilityOption => ({ label: this.props.translate(`newRoomPage.visibilityOptions.${visibilityOption}`), value: visibilityOption, description: this.props.translate(`newRoomPage.${visibilityOption}Description`), From 9dcc676da7207d48554fe694d53d892435939673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 1 Mar 2023 18:28:18 -0600 Subject: [PATCH 11/17] update canLeaveRoom logic --- src/libs/ReportUtils.js | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index be268cbb7b5c..2a227702fff6 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -1527,25 +1527,32 @@ function getIOUOptions(report, reportParticipants, betas) { } /** + * Allows a user to leave a policy room according to the following conditions of the visibility or chatType rNVP: + * `public` - Anyone can leave (because anybody can join) + * `public_announce` - Only non-policy members can leave (it's auto-shared with policy members) + * `policy_admins` - Nobody can leave (it's auto-shared with all policy admins) + * `policy_announce` - Nobody can leave (it's auto-shared with all policy members) + * `policy` - Anyone can leave (though only policy members can join) + * `domain` - Nobody can leave (it's auto-shared with domain members) + * `dm` - Nobody can leave (it's auto-shared with users) + * `private` - Anybody can leave (though you can only be invited to join) * - * @param {String} visibility + * @param {Object} report + * @param {String} report.visibility + * @param {String} report.chatType * @param {Boolean} isPolicyMember * @returns {Boolean} */ -function canLeaveRoom(visibility, isPolicyMember) { - if (!_.find(CONST.REPORT.VISIBILITY, value => value === visibility)) { - return false; - } - if (visibility === CONST.REPORT.VISIBILITY.PUBLIC - || visibility === CONST.REPORT.VISIBILITY.PRIVATE - || visibility === CONST.REPORT.VISIBILITY.POLICY) { - return true; - } - if (visibility === CONST.REPORT.VISIBILITY.PUBLIC_ANNOUNCE) { - // Only non-policy members can leave - if (!isPolicyMember) { - return true; +function canLeaveRoom(report, isPolicyMember) { + if (_.isEmpty(report.visibility)) { + if (report.chatType === CONST.REPORT.CHAT_TYPE.POLICY_ADMINS + || report.chatType === CONST.REPORT.CHAT_TYPE.POLICY_ANNOUNCE + || report.chatType === CONST.REPORT.CHAT_TYPE.DOMAIN_ALL + || _.isEmpty(report.chatType)) { // DM chats don't have a chatType + return false; } + } else if (report.visibility === CONST.REPORT.VISIBILITY.PUBLIC_ANNOUNCE && isPolicyMember) { + return false; } return false; } From d1ce25d2431f05b44deb863f191331725949df15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 1 Mar 2023 18:29:28 -0600 Subject: [PATCH 12/17] add new visibilityOptions --- src/languages/en.js | 2 ++ src/languages/es.js | 2 ++ src/pages/workspace/WorkspaceNewRoomPage.js | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/languages/en.js b/src/languages/en.js index 26d165afc8bf..02f78b254d2b 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -1110,6 +1110,8 @@ export default { visibilityOptions: { restricted: 'Restricted', private: 'Private', + public: 'Public', + public_announce: 'Public Announce', }, }, statementPage: { diff --git a/src/languages/es.js b/src/languages/es.js index 6c87c1088e3c..9b47322101f3 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -1112,6 +1112,8 @@ export default { visibilityOptions: { restricted: 'Restringida', private: 'Privada', + public: 'Público', + public_announce: 'Anuncio Público', }, }, statementPage: { diff --git a/src/pages/workspace/WorkspaceNewRoomPage.js b/src/pages/workspace/WorkspaceNewRoomPage.js index 2616ce3770b0..0cc96e7ce33a 100644 --- a/src/pages/workspace/WorkspaceNewRoomPage.js +++ b/src/pages/workspace/WorkspaceNewRoomPage.js @@ -117,7 +117,7 @@ class WorkspaceNewRoomPage extends React.Component { policy => ({label: policy.name, key: policy.id, value: policy.id}), ); - const visibilityOptions = _.map([CONST.REPORT.VISIBILITY.PRIVATE, CONST.REPORT.VISIBILITY.RESTRICTED], visibilityOption => ({ + const visibilityOptions = _.map(_.values(CONST.REPORT.VISIBILITY), visibilityOption => ({ label: this.props.translate(`newRoomPage.visibilityOptions.${visibilityOption}`), value: visibilityOption, description: this.props.translate(`newRoomPage.${visibilityOption}Description`), From 48cf798eb2f30bc3e9f8d1dc5b1e8c4a50e28ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 1 Mar 2023 18:59:50 -0600 Subject: [PATCH 13/17] open concierge when user leaves room --- src/libs/ReportUtils.js | 2 +- src/libs/actions/Policy.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 2a227702fff6..20e8f2a4e313 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -1554,7 +1554,7 @@ function canLeaveRoom(report, isPolicyMember) { } else if (report.visibility === CONST.REPORT.VISIBILITY.PUBLIC_ANNOUNCE && isPolicyMember) { return false; } - return false; + return true; } export { diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index b571a25642fa..86a587ed448c 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -14,6 +14,7 @@ import * as OptionsListUtils from '../OptionsListUtils'; import DateUtils from '../DateUtils'; import * as ReportUtils from '../ReportUtils'; import Log from '../Log'; +import * as Report from './Report'; const allPolicies = {}; Onyx.connect({ @@ -1029,7 +1030,7 @@ function leaveRoom(reportID) { }, ], }); - Navigation.dismissModal(); + Report.navigateToConciergeChat(); } export { From aced8a89bd67b10d2db10f98b3bda80200d708d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 1 Mar 2023 19:00:32 -0600 Subject: [PATCH 14/17] update logic to show Leave Room button --- src/pages/ReportDetailsPage.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 0c729f1a3759..a2ebfcf0d674 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -88,19 +88,19 @@ class ReportDetailsPage extends Component { icon: Expensicons.Plus, action: () => { /* Placeholder for when inviting other users is built in */ }, }); + } - // Only show the leave room option if the user can leave the room - const policy = this.props.policies[`${ONYXKEYS.COLLECTION.POLICY}${this.props.report.policyID}`]; - const isPolicyMember = policy && _.find(policy.employeeList.emails, email => email === this.props.session.email); - if (ReportUtils.canLeaveRoom(this.props.report.visibility, isPolicyMember)) { - menuItems.push({ - key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, - translationKey: 'common.leaveRoom', - icon: Expensicons.Exit, - action: () => Policy.leaveRoom(this.props.report.reportID), - }); - } + const policy = this.props.policies[`${ONYXKEYS.COLLECTION.POLICY}${this.props.report.policyID}`]; + const isPolicyMember = policy && _.find(policy.employeeList.emails, email => email === this.props.session.email); + if (ReportUtils.isUserCreatedPolicyRoom(this.props.report) || ReportUtils.canLeaveRoom(this.props.report, isPolicyMember)) { + menuItems.push({ + key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, + translationKey: 'common.leaveRoom', + icon: Expensicons.Exit, + action: () => Policy.leaveRoom(this.props.report.reportID), + }); } + return menuItems; } From 7e4c64b7c5134407234fa8f831c531dc7b3a3f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 1 Mar 2023 19:58:09 -0600 Subject: [PATCH 15/17] check if policy exists for the user --- src/pages/ReportDetailsPage.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index a2ebfcf0d674..5089b87c2742 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -91,8 +91,7 @@ class ReportDetailsPage extends Component { } const policy = this.props.policies[`${ONYXKEYS.COLLECTION.POLICY}${this.props.report.policyID}`]; - const isPolicyMember = policy && _.find(policy.employeeList.emails, email => email === this.props.session.email); - if (ReportUtils.isUserCreatedPolicyRoom(this.props.report) || ReportUtils.canLeaveRoom(this.props.report, isPolicyMember)) { + if (ReportUtils.isUserCreatedPolicyRoom(this.props.report) || ReportUtils.canLeaveRoom(this.props.report, !_.isEmpty(policy))) { menuItems.push({ key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, translationKey: 'common.leaveRoom', From 817168d4721eb553ad4a1c8110093b019e4523a6 Mon Sep 17 00:00:00 2001 From: Jasper Huang Date: Mon, 6 Mar 2023 11:26:56 -0800 Subject: [PATCH 16/17] filter visibility options, add visibility descriptions --- src/languages/en.js | 2 ++ src/languages/es.js | 1 + src/pages/workspace/WorkspaceNewRoomPage.js | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/languages/en.js b/src/languages/en.js index 02f78b254d2b..96a94caaa906 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -1097,6 +1097,8 @@ export default { visibility: 'Visibility', restrictedDescription: 'People in your workspace can find this room', privateDescription: 'People invited to this room can find it', + publicDescription: 'Anyone can find it', + public_announceDescription: 'Anyone can find it', createRoom: 'Create room', roomAlreadyExistsError: 'A room with this name already exists', roomNameReservedError: 'A room on this workspace already uses this name', diff --git a/src/languages/es.js b/src/languages/es.js index 9b47322101f3..aa4c1be56b7c 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -1099,6 +1099,7 @@ export default { visibility: 'Visibilidad', restrictedDescription: 'Sólo las personas en tu espacio de trabajo pueden encontrar esta sala', privateDescription: 'Sólo las personas que están invitadas a esta sala pueden encontrarla', + publicDescription: 'Cualquiera puede encontrarlo', createRoom: 'Crea una sala de chat', roomAlreadyExistsError: 'Ya existe una sala con este nombre', roomNameReservedError: 'Una sala en este espacio de trabajo ya usa este nombre', diff --git a/src/pages/workspace/WorkspaceNewRoomPage.js b/src/pages/workspace/WorkspaceNewRoomPage.js index 0cc96e7ce33a..4db4670ac63e 100644 --- a/src/pages/workspace/WorkspaceNewRoomPage.js +++ b/src/pages/workspace/WorkspaceNewRoomPage.js @@ -117,7 +117,7 @@ class WorkspaceNewRoomPage extends React.Component { policy => ({label: policy.name, key: policy.id, value: policy.id}), ); - const visibilityOptions = _.map(_.values(CONST.REPORT.VISIBILITY), visibilityOption => ({ + const visibilityOptions = _.map(_.filter(_.values(CONST.REPORT.VISIBILITY), visibilityOption => visibilityOption !== CONST.REPORT.VISIBILITY.PUBLIC_ANNOUNCE), visibilityOption => ({ label: this.props.translate(`newRoomPage.visibilityOptions.${visibilityOption}`), value: visibilityOption, description: this.props.translate(`newRoomPage.${visibilityOption}Description`), From e7790de3a774492ca514d70c34cd1091664ec934 Mon Sep 17 00:00:00 2001 From: Jasper Huang Date: Mon, 6 Mar 2023 11:27:44 -0800 Subject: [PATCH 17/17] remove unused --- src/languages/en.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/languages/en.js b/src/languages/en.js index 96a94caaa906..ed172125461e 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -1098,7 +1098,6 @@ export default { restrictedDescription: 'People in your workspace can find this room', privateDescription: 'People invited to this room can find it', publicDescription: 'Anyone can find it', - public_announceDescription: 'Anyone can find it', createRoom: 'Create room', roomAlreadyExistsError: 'A room with this name already exists', roomNameReservedError: 'A room on this workspace already uses this name',