Skip to content

feat: ability to activate suspended users #2344

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

Merged
merged 4 commits into from
Jun 15, 2022

Conversation

Kira-Pilot
Copy link
Member

resolves #2254
Kapture 2022-06-15 at 11 25 46

@Kira-Pilot Kira-Pilot requested a review from a team as a code owner June 15, 2022 15:28
@@ -13,15 +13,20 @@ export const Language = {
suspendDialogTitle: "Suspend user",
suspendDialogAction: "Suspend",
suspendDialogMessagePrefix: "Do you want to suspend the user",
activateDialogTitle: "Activate user",
activateDialogAction: "Activate",
activateDialogMessagePrefix: "Do you want to active the user",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be activate in place of active?

suspendUserError: "Error on suspending the user.",
suspendUserError: "Error suspending user.",
activateUserSuccess: "Successfully activated the user",
activateUserError: "Error activating user",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Add periods (.).

@@ -99,6 +107,25 @@ export const UsersPage: React.FC = () => {
}
/>

<ConfirmDialog
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a success type for ConfirmDialog which uses the green button. Maybe we can use that for this use case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea!

@Kira-Pilot Kira-Pilot merged commit a6a06d4 into main Jun 15, 2022
@Kira-Pilot Kira-Pilot deleted the ability-to-activate/kira-pilot branch June 15, 2022 17:29
}

export const UsersPage: React.FC = () => {
const xServices = useContext(XServiceContext)
const [usersState, usersSend] = useActor(xServices.usersXService)
const [rolesState, rolesSend] = useActor(xServices.siteRolesXService)
const { users, getUsersError, userIdToSuspend, userIdToResetPassword, newUserPassword } = usersState.context
const { users, getUsersError, userIdToSuspend, userIdToActivate, userIdToResetPassword, newUserPassword } =
usersState.context
Copy link
Contributor

@AbhineetJain AbhineetJain Jun 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering what the ideal linting should be here. Something like:

const {
    users,
    getUsersError,
    userIdToSuspend,
    userIdToActivate, 
    userIdToResetPassword, 
    newUserPassword,
} = usersState.context

Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry I missed this! I agree, that is nicer. I left it up to the formatter and it didn't print it as clearly. I can update on my next UI PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed it in my initial review too. Next PR sounds good! I wonder if we can add something to the formatter though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah, just tried it out and we'd have to adjust the prettier rule. I think the default is 80 and we've got it set to 120. This would be a good thing to chat about in FE variety if you'd like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot activate a suspended user in the dashboard
2 participants