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

feat: Add Admin user and catalog management with password change flow #54

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

JacksonMeade
Copy link
Collaborator

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...

@JacksonMeade JacksonMeade self-assigned this Jun 19, 2024
@JacksonMeade JacksonMeade marked this pull request as ready for review July 29, 2024 00:14

const dispatch = useDispatch();

const tempHandleAdd = (event: React.FormEvent<HTMLFormElement>) => {
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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";
Copy link
Member

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.
*/
Copy link
Member

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.

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.

2 participants