Skip to content

Commit

Permalink
Merge pull request #4310 from Expensify/jasper-editWorkspacePage
Browse files Browse the repository at this point in the history
Directly create a workspace and add the Edit Workspace page
  • Loading branch information
mountiny authored Aug 3, 2021
2 parents 96cd6ba + 2d70658 commit d15beee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,11 @@ export default {
workspace: 'Espacio de trabajo',
},
new: {
newWorkspace: 'Nuevo Workspace',
newWorkspace: 'Nuevo Espacio de trabajo',
getTheExpensifyCardAndMore: 'Consigue la Expensify Card y más',
welcome: 'Bienvenido/a',
chooseAName: 'Elige un nombre',
helpText: '¡Dale un nombre a tu Workspace antes de activar tus Expensify Cards!',
helpText: 'Elige un nombre para el espacio de trabajo antes de activar las tarjetas Expensify',
getStarted: '¡Empezar!',
genericFailureMessage: 'Se ha producido un error al intentar crear el Workspace. Por favor, inténtalo de nuevo.',
},
Expand Down
5 changes: 3 additions & 2 deletions src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ function invite(logins, welcomeNote, policyID) {
/**
* Merges the passed in login into the specified policy
*
* @param {String} name
* @param {String} [name]
*/
function create(name) {
function create(name = '') {
API.Policy_Create({type: CONST.POLICY.TYPE.FREE, policyName: name})
.then((response) => {
if (response.jsonCode !== 200) {
Expand All @@ -203,6 +203,7 @@ function create(name) {
});
Navigation.dismissModal();
Navigation.navigate(ROUTES.getWorkspaceCardRoute(response.policyID));
Growl.success(translateLocal('workspace.new.successMessage'));
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/pages/home/sidebar/SidebarScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
import Permissions from '../../../libs/Permissions';
import ONYXKEYS from '../../../ONYXKEYS';
import Firebase from '../../../libs/Firebase';
import {create} from '../../../libs/actions/Policy';

const propTypes = {
/** Beta features list */
Expand Down Expand Up @@ -147,7 +148,7 @@ class SidebarScreen extends Component {
iconHeight: 40,
text: this.props.translate('workspace.new.newWorkspace'),
description: this.props.translate('workspace.new.getTheExpensifyCardAndMore'),
onSelected: () => Navigation.navigate(ROUTES.WORKSPACE_NEW),
onSelected: () => create(),
},
] : []),
]}
Expand Down

0 comments on commit d15beee

Please sign in to comment.