-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
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.
First pass!
src/actions/actions.js
Outdated
@@ -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 => ({ |
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.
export const updateExistingResource = updatedResource => ({ | |
export const updateExistingResource = createAction('UPDATE_EXISTING_RESOURCE'); |
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.
Fixed
src/reducers/filterMarkers.js
Outdated
@@ -97,6 +97,16 @@ export default (state = initialState, act) => { | |||
allResources: [...state.allResources, act.newResource] | |||
}; | |||
|
|||
case actions.UPDATE_EXISTING_RESOURCE: |
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.
case actions.UPDATE_EXISTING_RESOURCE: | |
case actions.updateExistingResource.type: | |
allResources: state.allResources.map(resource => | |
resource.id === act.payload.id | |
? act.payload | |
: resource | |
) |
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.
Fixed
<p>Your change has been recorded. Thanks!</p> | ||
<Button | ||
onClick={closeModal} | ||
style={{ |
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.
use sx
with MUI components
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.
Fixed
width: '100%' | ||
}} | ||
> | ||
CLOSE |
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.
nit: MUI buttons by default are uppercase - but I'm not sure if we overridden this in the theme
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.
Fixed
width: '100%' | ||
}} | ||
> | ||
CANCEL |
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.
nit: MUI buttons by default are uppercase - but I'm not sure if we overridden this in the theme
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.
Fixed
width: '100%' | ||
}} | ||
> | ||
MARK AS INACTIVE |
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.
nit: MUI buttons by default are uppercase - but I'm not sure if we overridden this in the theme
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.
Fixed
width: '100%' | ||
}} | ||
> | ||
MARK AS UNVERIFIED |
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.
nit: MUI buttons by default are uppercase - but I'm not sure if we overridden this in the theme
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.
Got it - fixed.
</Button> | ||
<Button | ||
onClick={markAsInactive} | ||
style={{ |
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.
sx for MUI components
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.
Fixed
<Input | ||
placeholder="The admin password" | ||
style={{ width: '100%', marginBottom: '10px' }} | ||
type="text" |
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.
nit: use type="password"
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.
Fixed.
</Button> | ||
<Button | ||
onClick={() => { | ||
if (btoa(password) == PASSWORD) { |
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.
nit: use ===
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.
Good catch, fixed!
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.
@RNR1 back to you!
</Button> | ||
<Button | ||
onClick={markAsInactive} | ||
style={{ |
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.
Fixed
width: '100%' | ||
}} | ||
> | ||
MARK AS INACTIVE |
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.
Fixed
</Button> | ||
<Button | ||
onClick={closeModal} | ||
style={{ |
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.
Fixed
width: '100%' | ||
}} | ||
> | ||
CANCEL |
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.
Fixed
<p>Your change has been recorded. Thanks!</p> | ||
<Button | ||
onClick={closeModal} | ||
style={{ |
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.
Fixed
width: '100%' | ||
}} | ||
> | ||
CLOSE |
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.
Fixed
src/reducers/filterMarkers.js
Outdated
@@ -97,6 +97,16 @@ export default (state = initialState, act) => { | |||
allResources: [...state.allResources, act.newResource] | |||
}; | |||
|
|||
case actions.UPDATE_EXISTING_RESOURCE: |
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.
Fixed
src/actions/actions.js
Outdated
@@ -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'; |
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.
The action type is not necessary anymore! You can use
updateExistingResource.type
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.
Fixed!
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.
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' }} |
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.
Similar to other mui components, we should use the sx
attribute here in place of style
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.
Fixed!
/> | ||
<Input | ||
placeholder="The admin password" | ||
style={{ width: '100%', marginBottom: '10px' }} |
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.
Similar to other mui components, we should use the sx
attribute here in place of style
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.
Fixed!
style={{ | ||
flex: 1, | ||
backgroundColor: 'gray', | ||
color: 'white', | ||
borderRadius: '4px', | ||
padding: '4px' | ||
}} |
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.
Similar to other mui components, we should use the sx
attribute here in place of style
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.
Fixed!
style={{ | ||
flex: 1, | ||
backgroundColor: 'blue', | ||
color: 'white', | ||
borderRadius: '4px', | ||
padding: '4px' | ||
}} |
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.
Similar to other mui components, we should use the sx
attribute here in place of style
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.
Fixed!
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.
Approved, thanks for making all of those changes! ✅
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.
🧹
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:
id
to resources within the UI for mapping back to Firebase.