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

Implements the Verification System #458

Merged
merged 12 commits into from
Jul 24, 2024
Merged

Implements the Verification System #458

merged 12 commits into from
Jul 24, 2024

Conversation

vontell
Copy link
Contributor

@vontell vontell commented Jun 22, 2024

Implements a temporary verification system that allows users to verify and un-verify resources. Please message a PHLASK convener for the password.

Also does the following:

  • Attaches an id to resources within the UI for mapping back to Firebase.
  • Updates the regex for website submissions to allow for more website types.
  • Updates the verification data schema type.
Screenshot 2024-06-22 at 4 02 05 PM Screenshot 2024-06-22 at 4 03 30 PM Screenshot 2024-06-22 at 4 03 37 PM

@vontell vontell requested review from RNR1 and gcardonag June 23, 2024 18:52
@tomporvaz tomporvaz linked an issue Jun 25, 2024 that may be closed by this pull request
Copy link
Contributor

@RNR1 RNR1 left a comment

Choose a reason for hiding this comment

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

First pass!

@@ -54,6 +61,13 @@ export const pushNewResource = newResource => ({
newResource
});

// Handles the case where an existing resource is updated from the submission form
export const UPDATE_EXISTING_RESOURCE = 'UPDATE_EXISTING_RESOURCE';
export const updateExistingResource = updatedResource => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const updateExistingResource = updatedResource => ({
export const updateExistingResource = createAction('UPDATE_EXISTING_RESOURCE');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -97,6 +97,16 @@ export default (state = initialState, act) => {
allResources: [...state.allResources, act.newResource]
};

case actions.UPDATE_EXISTING_RESOURCE:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
case actions.UPDATE_EXISTING_RESOURCE:
case actions.updateExistingResource.type:
allResources: state.allResources.map(resource =>
resource.id === act.payload.id
? act.payload
: resource
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

<p>Your change has been recorded. Thanks!</p>
<Button
onClick={closeModal}
style={{
Copy link
Contributor

Choose a reason for hiding this comment

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

use sx with MUI components

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

width: '100%'
}}
>
CLOSE
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: MUI buttons by default are uppercase - but I'm not sure if we overridden this in the theme

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

width: '100%'
}}
>
CANCEL
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: MUI buttons by default are uppercase - but I'm not sure if we overridden this in the theme

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

width: '100%'
}}
>
MARK AS INACTIVE
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: MUI buttons by default are uppercase - but I'm not sure if we overridden this in the theme

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

width: '100%'
}}
>
MARK AS UNVERIFIED
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: MUI buttons by default are uppercase - but I'm not sure if we overridden this in the theme

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it - fixed.

</Button>
<Button
onClick={markAsInactive}
style={{
Copy link
Contributor

Choose a reason for hiding this comment

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

sx for MUI components

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

<Input
placeholder="The admin password"
style={{ width: '100%', marginBottom: '10px' }}
type="text"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use type="password"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

</Button>
<Button
onClick={() => {
if (btoa(password) == PASSWORD) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use ===

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, fixed!

Copy link
Contributor Author

@vontell vontell left a comment

Choose a reason for hiding this comment

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

@RNR1 back to you!

</Button>
<Button
onClick={markAsInactive}
style={{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

width: '100%'
}}
>
MARK AS INACTIVE
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

</Button>
<Button
onClick={closeModal}
style={{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

width: '100%'
}}
>
CANCEL
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

<p>Your change has been recorded. Thanks!</p>
<Button
onClick={closeModal}
style={{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

width: '100%'
}}
>
CLOSE
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -97,6 +97,16 @@ export default (state = initialState, act) => {
allResources: [...state.allResources, act.newResource]
};

case actions.UPDATE_EXISTING_RESOURCE:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -48,6 +53,10 @@ export const pushNewResource = newResource => ({
newResource
});

// Handles the case where an existing resource is updated from the submission form
export const UPDATE_EXISTING_RESOURCE = 'UPDATE_EXISTING_RESOURCE';
Copy link
Contributor

Choose a reason for hiding this comment

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

The action type is not necessary anymore! You can use

updateExistingResource.type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

Copy link
Contributor

@gcardonag gcardonag left a comment

Choose a reason for hiding this comment

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

A few minor changes that should not impact functionality and this will be good to go!

</p>
<Input
placeholder="Your name"
style={{ width: '100%', marginBottom: '10px' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to other mui components, we should use the sx attribute here in place of style

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

/>
<Input
placeholder="The admin password"
style={{ width: '100%', marginBottom: '10px' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to other mui components, we should use the sx attribute here in place of style

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

Comment on lines 160 to 166
style={{
flex: 1,
backgroundColor: 'gray',
color: 'white',
borderRadius: '4px',
padding: '4px'
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to other mui components, we should use the sx attribute here in place of style

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

Comment on lines 178 to 184
style={{
flex: 1,
backgroundColor: 'blue',
color: 'white',
borderRadius: '4px',
padding: '4px'
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to other mui components, we should use the sx attribute here in place of style

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

Copy link
Contributor

@gcardonag gcardonag left a comment

Choose a reason for hiding this comment

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

Approved, thanks for making all of those changes! ✅

Copy link
Contributor

@gcardonag gcardonag left a comment

Choose a reason for hiding this comment

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

🧹

@gcardonag gcardonag merged commit b813345 into develop Jul 24, 2024
4 checks passed
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.

Add temporary ability to verify resources
3 participants