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

Administrator Login #12

Open
joycesin opened this issue Apr 24, 2020 · 3 comments
Open

Administrator Login #12

joycesin opened this issue Apr 24, 2020 · 3 comments
Labels
enhancement New feature or request long-term Stretch goal for the long term

Comments

@joycesin
Copy link
Collaborator

Stretch goal:

We would like to implement an admin login in the long term to allow quick EDIT and DELETE functions for listings. (currently we are planning to lock the edit access and instead set up email requests for edit and delete) We have some considerations:

  • Security with storing email and password
  • Design considerations, we are thinking if you are logged in as admin the edit/delete button will have a different function, deleting directly or bringing directly to edit page. Suggestions welcome!
@joycesin joycesin added enhancement New feature or request help wanted Extra attention is needed long-term Stretch goal for the long term and removed help wanted Extra attention is needed labels Apr 24, 2020
@joycesin
Copy link
Collaborator Author

joycesin commented May 9, 2020

update: started a github Project to manage this more easily

@wenruiliau
Copy link

How are EDIT and DELETE functions currently handled in INFO.js? Are the functions nested around lines 614 to 632 of INFO.js?

@limyifan1
Copy link
Owner

Hi Wenrui, sorry for the late reply :) When edits and deletes are made, an email is sent to [email protected] with a request so that we can manually make the changes. ListForm.js is the main component through which Edits are made while DeleteModel.js is the component where Deletes are made.

When the edit button is pressed, it triggers the Modal in Popup.js, which in turn holds ListForm.js. In ListForm.js, when an edit is made and submitted, it triggers the function handleSubmit (lines 420 to 447), in turn triggering handleData (lines 458 to 519). In handleData, an email is sent using the helper function sendEmailToUpdateListing from helpers.js (in the Helpers folder). Once submitted, it will trigger showReviewEditMessage in Info.js which will show an info dialog to the user for 10 seconds (lines 742 to 744).

When the delete button is pressed, it triggers the DeleteModal in Popup.js, which will ask for the user's confirmation in DeleteModal.js. When confirmed, handleSubmitDelete is run which runs sendDeleteEmail which in turns runs the helper function sendEmailToUpdateListing. This again sends an email to us to notify us of the changes. Again, in Info.js, the showReviewDeleteMessage function is triggered which shows the delete info dialog to the user for 10 seconds (lines 748 to 749).

Hope this helps! Let us know if you have any more questions :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request long-term Stretch goal for the long term
Projects
None yet
Development

No branches or pull requests

3 participants