From 69868e732caa932cf9c97aa99fb4e286548e1268 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Fri, 18 Jun 2021 19:46:35 +0100 Subject: [PATCH 01/59] Add a new route --- src/ROUTES.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ROUTES.js b/src/ROUTES.js index 21a8dffbc749..81646a2760ff 100644 --- a/src/ROUTES.js +++ b/src/ROUTES.js @@ -52,6 +52,8 @@ export default { getWorkspaceRoute: policyID => `workspace/${policyID}`, WORKSPACE_INVITE: 'workspace/:policyID/invite', getWorkspaceInviteRoute: policyID => `workspace/${policyID}/invite`, + WORKSPACE_PEOPLE: 'workspace/:policyID/people', + getWorkspacePeopleRoute: policyID => `workspace/${policyID}/people`, /** * @param {String} route From 95a834dc8e5a2c92acf2a3cfb1e123060d88a22e Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Mon, 21 Jun 2021 00:27:29 +0100 Subject: [PATCH 02/59] Update languages --- src/languages/en.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/languages/en.js b/src/languages/en.js index 38d0b6b12d8f..4d45f26945dd 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -48,6 +48,13 @@ export default { whatThis: 'What\'s this?', invite: 'Invite', passwordCannotBeBlank: 'Password cannot be blank', +<<<<<<< HEAD +======= + people: 'People', + here: 'here', + remove: 'Remove', + admin: "Admin", +>>>>>>> ef0267630 (Update languages) }, attachmentPicker: { cameraPermissionRequired: 'Camera Permission Required', From 8a9643f0a23e66a122bb04d0f0f604aa07750e81 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Mon, 21 Jun 2021 01:57:30 +0100 Subject: [PATCH 03/59] Revert merge changes --- .../WorkspaceSettingsDrawerNavigator.js | 29 ++++ .../AppNavigator/baseDrawerNavigator.js | 46 +++++++ src/pages/workspace/WorkspacePeoplePage.js | 129 ++++++++++++++++++ src/pages/workspace/WorkspaceSidebar.js | 84 ++++++++++++ src/styles/styles.js | 10 ++ 5 files changed, 298 insertions(+) create mode 100644 src/libs/Navigation/AppNavigator/WorkspaceSettingsDrawerNavigator.js create mode 100644 src/libs/Navigation/AppNavigator/baseDrawerNavigator.js create mode 100644 src/pages/workspace/WorkspacePeoplePage.js create mode 100644 src/pages/workspace/WorkspaceSidebar.js diff --git a/src/libs/Navigation/AppNavigator/WorkspaceSettingsDrawerNavigator.js b/src/libs/Navigation/AppNavigator/WorkspaceSettingsDrawerNavigator.js new file mode 100644 index 000000000000..2d334587c529 --- /dev/null +++ b/src/libs/Navigation/AppNavigator/WorkspaceSettingsDrawerNavigator.js @@ -0,0 +1,29 @@ +import React from 'react'; + +// Screens +import BaseDrawerNavigator from './baseDrawerNavigator'; +import WorkspaceCardPage from '../../../pages/workspace/WorkspaceCardPage'; +import WorkspacePeoplePage from '../../../pages/workspace/WorkspacePeoplePage'; +import WorkspaceSidebar from '../../../pages/workspace/WorkspaceSidebar'; + +const WorkspaceSettingsDrawerNavigator = () => ( + } + screens={[ + { + name: 'WorkspaceCard', + component: WorkspaceCardPage, + initialParams: {}, + }, + { + name: 'WorkspaceSettings_People', + component: WorkspacePeoplePage, + initialParams: {}, + }, + ]} + /> +); + +WorkspaceSettingsDrawerNavigator.displayName = 'WorkspaceSettingsDrawerNavigator'; + +export default WorkspaceSettingsDrawerNavigator; diff --git a/src/libs/Navigation/AppNavigator/baseDrawerNavigator.js b/src/libs/Navigation/AppNavigator/baseDrawerNavigator.js new file mode 100644 index 000000000000..5d15cea31383 --- /dev/null +++ b/src/libs/Navigation/AppNavigator/baseDrawerNavigator.js @@ -0,0 +1,46 @@ +import React from 'react'; +import _ from 'underscore'; +import PropTypes from 'prop-types'; +import {createDrawerNavigator} from '@react-navigation/drawer'; +import styles, {getNavigationDrawerStyle, getNavigationDrawerType} from '../../../styles/styles'; +import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions'; + +const propTypes = { + screens: PropTypes.arrayOf(PropTypes.object).isRequired, + drawerContent: PropTypes.elementType.isRequired, + + ...windowDimensionsPropTypes, +}; +const Drawer = createDrawerNavigator(); + +const BaseDrawerNavigator = props => ( + + {_.map(props.screens, screen => ( + + ))} + +); + +BaseDrawerNavigator.propTypes = propTypes; +BaseDrawerNavigator.displayName = 'BaseDrawerNavigator'; +export default withWindowDimensions(BaseDrawerNavigator); diff --git a/src/pages/workspace/WorkspacePeoplePage.js b/src/pages/workspace/WorkspacePeoplePage.js new file mode 100644 index 000000000000..31af140ee1f8 --- /dev/null +++ b/src/pages/workspace/WorkspacePeoplePage.js @@ -0,0 +1,129 @@ +import React from 'react'; +import { + View, ScrollView, Image, Text as RNText, Linking, +} from 'react-native'; +import PropTypes from 'prop-types'; +import {withOnyx} from 'react-native-onyx'; +import styles from '../../styles/styles'; +import ONYXKEYS from '../../ONYXKEYS'; +import HeaderWithCloseButton from '../../components/HeaderWithCloseButton'; +import Navigation from '../../libs/Navigation/Navigation'; +import ScreenWrapper from '../../components/ScreenWrapper'; +import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; +import compose from '../../libs/compose'; +import Text from '../../components/Text'; +import Button from '../../components/Button'; +import variables from '../../styles/variables'; +import themeDefault from '../../styles/themes/default'; +import ROUTES from '../../ROUTES'; +import CONFIG from '../../CONFIG'; +import CONST from '../../CONST'; +import TextLink from '../../components/TextLink'; +import personalDetailsPropType from '../personalDetailsPropType'; + +const propTypes = { + ...withLocalizePropTypes, + + /** The personal details of the person who is logged in */ + personalDetails: personalDetailsPropType.isRequired, + + /** The policy passed via the route */ + policy: PropTypes.shape({ + /** The policy name */ + name: PropTypes.string, + }), + + /** URL Route params */ + route: PropTypes.shape({ + /** Params from the URL path */ + params: PropTypes.shape({ + /** policyID passed via route: /workspace/:policyID/people */ + policyID: PropTypes.string, + }), + }).isRequired, +}; + +const defaultProps = { + policy: { + name: '', + }, +}; + +class WorkspacePeoplePage extends React.Component { + constructor(props) { + super(props); + + this.state = { + selectedEmployees: [], + }; + + this.inviteUser = this.inviteUser.bind(this); + this.removeUsers = this.removeUsers.bind(this); + } + + /** + * Open the modal to invite a user + */ + inviteUser() { + Navigation.navigate(ROUTES.getWorkspaceInviteRoute(this.props.route.params.policyID)); + } + + /** + * Remove selected users from the workspace + */ + removeUsers() { + // navigate ro ROUTES.WORKSPACE_INVITE + Navigation.navigate(ROUTES.getWorkspaceInviteRoute(this.props.route.params.policyID)); + } + + render() { + return ( + + Navigation.dismissModal(true)} + /> + + + + {this.props.translate('workspace.people.tagline')} + + +