Skip to content

Commit

Permalink
Change "Users" to "System Users" in UI. (awslabs#475)
Browse files Browse the repository at this point in the history
This change helps reduce confusion about whether
operations on the UI pages affect users of the
SaaS Boost control plane (system users) or the
tenant's end users logging into the SaaS application.

Co-authored-by: PoeppingT <[email protected]>
  • Loading branch information
PoeppingT and PoeppingT authored Feb 7, 2023
1 parent 71a4707 commit ed0255f
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 17 deletions.
5 changes: 3 additions & 2 deletions client/web/src/_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
cilUserPlus,
} from '@coreui/icons'
import { CNavGroup, CNavItem } from '@coreui/react'
import { BaseUserRoute } from './users'

const _nav = [
{
Expand Down Expand Up @@ -87,8 +88,8 @@ const _nav = [
},
{
component: CNavItem,
name: 'Users',
to: '/users',
name: 'System Users',
to: BaseUserRoute,
icon: <CIcon icon={cilPeople} customClassName="nav-icon" />,
},
]
Expand Down
2 changes: 1 addition & 1 deletion client/web/src/users/UserDeleteConfirmationComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function UserDeleteConfirmationComponent(props) {
<Form>
<ModalHeader>Delete User</ModalHeader>
<ModalBody>
<p>Are you sure you want to delete the user &apos;{username}&apos;?</p>
<p>Are you sure you want to delete the system user &apos;{username}&apos;?</p>
<p>Type &apos;delete&apos; to confirm:</p>
<FormGroup>
<SaasBoostInput type="text" name="confirmText" tabIndex="1" />
Expand Down
2 changes: 1 addition & 1 deletion client/web/src/users/UserFormComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const UserFormComponent = ({
<Row>
<Col md={6}>
<Card>
<CardHeader>User Details</CardHeader>
<CardHeader>System User Details</CardHeader>
<CardBody>
<SaasBoostInput
label="Username"
Expand Down
4 changes: 2 additions & 2 deletions client/web/src/users/UserListComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const UserListComponent = ({
</span>
</Button>
<Button color="primary" onClick={handleCreateUser}>
Create User
Create System User
</Button>
</div>
</Col>
Expand All @@ -93,7 +93,7 @@ export const UserListComponent = ({
<Col xl={12}>
<Card>
<CardHeader>
<CIcon icon={cilListRich} /> Users
<CIcon icon={cilListRich} /> System Users
</CardHeader>
<CardBody>{table}</CardBody>
</Card>
Expand Down
5 changes: 3 additions & 2 deletions client/web/src/users/UserListContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { UserListComponent } from './UserListComponent'
import { useDispatch, useSelector } from 'react-redux'
import { fetchUsers, selectAllUsers, dismissError } from './ducks'
import { useHistory } from 'react-router-dom'
import { BaseUserRoute } from '.'

export default function UserListContainer() {
const dispatch = useDispatch()
Expand All @@ -29,15 +30,15 @@ export default function UserListContainer() {
const error = useSelector((state) => state.users.error)

const handleUserClick = (username) => {
history.push(`/users/${username}`)
history.push(`${BaseUserRoute}/${username}`)
}

const handleRefresh = () => {
dispatch(fetchUsers())
}

const handleCreateUser = () => {
history.push(`/users/create`)
history.push(`${BaseUserRoute}/create`)
}

const handleError = () => {
Expand Down
3 changes: 1 addition & 2 deletions client/web/src/users/UserViewComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
CardHeader,
CardBody,
} from 'reactstrap'
import { SBMoment } from '../components/SBMoment'
import Moment from 'react-moment'
import Display from '../components/Display'
import UserDeleteConfirmationComponent from './UserDeleteConfirmationComponent'
Expand Down Expand Up @@ -135,7 +134,7 @@ export class UserViewComponent extends Component {
<Card>
<CardHeader>
<i className="fa fa-info" />
User Details
System User Details
</CardHeader>
<CardBody>
<Row>
Expand Down
3 changes: 2 additions & 1 deletion client/web/src/users/UserViewContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import UserViewComponent from './UserViewComponent'
import { UserFormComponent } from './UserFormComponent'
import { connect } from 'react-redux'
import { withRouter } from 'react-router'
import { BaseUserRoute } from '.'

import {
fetchUser,
Expand Down Expand Up @@ -115,7 +116,7 @@ class UserViewContainer extends Component {
try {
const deletedUserResponse = await deletedUser(username)
if (!deletedUserResponse.error) {
history.push('/users')
history.push(BaseUserRoute)
} else {
toggleDeleteModal()
setSubmitting(false)
Expand Down
14 changes: 8 additions & 6 deletions client/web/src/users/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,25 @@ const UserListContainer = lazy(() => import('./UserListContainer'))
const UserViewContainer = lazy(() => import('./UserViewContainer'))
const UserCreateContainer = lazy(() => import('./UserCreateContainer'))

export const BaseUserRoute = '/sysusers'

export const UserRoutes = [
{
path: '/users',
path: BaseUserRoute,
exact: true,
name: 'Users',
name: 'System Users',
component: UserListContainer,
},
{
path: '/users/create',
path: BaseUserRoute + '/create',
exact: true,
name: 'Create a new User',
name: 'Create a new System User',
component: UserCreateContainer,
},
{
path: '/users/:username',
path: BaseUserRoute + '/:username',
exact: true,
name: 'User Detail',
name: 'System User Detail',
component: UserViewContainer,
},
]

0 comments on commit ed0255f

Please sign in to comment.