Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directly create a workspace and add the Edit Workspace page #4310

Merged
merged 17 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,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