-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Add Admin user and catalog management with password change flow #54
base: main
Are you sure you want to change the base?
Conversation
|
||
const dispatch = useDispatch(); | ||
|
||
const tempHandleAdd = (event: React.FormEvent<HTMLFormElement>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain the name of this variable?
userName: string; | ||
realName: string; | ||
djName: string; | ||
isAdmin: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something that we might need to revisit later. It's possible that we'll have a variety of roles in the system and we'll need something more complex than a boolean. This is fine for now, though.
}); | ||
|
||
const credentials = await credentialsProvider(); | ||
return credentials; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just return the value without an intermediate variable?
@@ -0,0 +1,207 @@ | |||
import { convertUserToDJResult } from "@/lib/services/admin/conversions"; | |||
import { AdminAddUserToGroupCommand, AdminAddUserToGroupCommandInput, AdminCreateUserCommand, AdminCreateUserCommandInput, AdminDeleteUserCommand, AdminDeleteUserCommandInput, AdminRemoveUserFromGroupCommand, AdminRemoveUserFromGroupCommandInput, AdminResetUserPasswordCommand, AdminResetUserPasswordCommandInput, CognitoIdentityProviderClient, ListUsersCommand, ListUsersCommandInput, ListUsersInGroupCommand, ListUsersInGroupCommandInput, VerifyUserAttributeCommandInput } from "@aws-sdk/client-cognito-identity-provider"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you separate these onto multiple lines?
* @param {string} [props.style] - The style of the popup. Defaults to the success color. | ||
* | ||
* @returns {JSX.Element} The AddDJsPopup component. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation is great. Could you please add docs in other places? A lot of the code I'm left reverse engineering what the intent is.
Fixes no issue
Summary
This PR introduces the administrative dashboard pages, in three sections: the catalog, the roster, and the schedule, the latter of which is currently closed in the V1 implementation.
The catalog allows admins to edit entries in the music library and add new ones as necessary, with a helpful search capability to verify whether a new entry might already exist in the database.
The roster allows admins to add and remove users, and appoint others to administrative positions. It also grants the ability to reset passwords so that users can always access the system. It implements user adding and reset password flows using the new version of the AWS JavaScript SDK.
It also introduces the Rotation layer of catalog results and the administrative ability to track and edit the rotation entries. Necessary types have been modified for this purpose.
Testing
To test this branch, pull it down, remove lines 4 through 8 of next.config.mjs (leave only reactStrictMode:false behind), and run
npm run dev
, and visit localhost. Building should complete once it is merged with main.Test results incoming...