-
Notifications
You must be signed in to change notification settings - Fork 3
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
Modal to recruit user (airtable) #30
Conversation
552c427
to
5504677
Compare
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.
Once the changes are implemented, we need to ask Jorge to add the two new env keys to the servers.
|
||
const Step1 = ({ onClick, userData, handleUserData, user }) => ( | ||
<section> | ||
<h4 className="mb-4">Can you tell us a bit about yourself?</h4> |
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 should be an h1
. If you want the h4
style, you can use the class .h4
.
<h4 className="mb-4">Can you tell us a bit about yourself?</h4> | |
<h1 className="h4 mb-4">Can you tell us a bit about yourself?</h1> |
const Step1 = ({ onClick, userData, handleUserData, user }) => ( | ||
<section> | ||
<h4 className="mb-4">Can you tell us a bit about yourself?</h4> | ||
<h5 className="mt-4"> |
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.
I don't think this needs to be a title at all. Feel free to use the class .h5
if you want to reuse the style.
map_usage_description: PropTypes.string, | ||
email: PropTypes.string, | ||
}), | ||
user: PropTypes.string.isRequired, |
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 default value is null
, so if you mark it as required, you get an error in the console.
</h5> | ||
<div className="form-group user-modal-radio-input-container"> | ||
{userTypeOptions.map(option => ( | ||
<> |
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.
There's an error in the console because this element doesn't have a key. Use:
<> | |
<Fragment key={option.slug}> |
instead and remove the key from the <Radio />
component.
))} | ||
</div> | ||
|
||
<h5 className="mt-4"> |
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.
You probably want something like this:
<h5 className="mt-4"> | |
<p className="h5 mt-4"> |
<label aria-label="hidden" className="visually-hidden"> | ||
jmap usage description | ||
</label> |
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.
🚮
<label aria-label="hidden" className="visually-hidden"> | |
jmap usage description | |
</label> |
components/user-modal/component.js
Outdated
}); | ||
|
||
const handleCreateUser = async () => { | ||
const user = await createUserEntry({ ...userData }); |
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.
createUserEntry
can reject. Put a try/catch around it.
It'd be great if you could display an error message in the UI if this fails.
components/user-modal/component.js
Outdated
}; | ||
|
||
const handleUpdateUser = () => { | ||
updateUserEntry(userId, userData); |
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.
Same here: put a try/catch, and adding an error message in the UI would be nice.
components/explore/component.js
Outdated
// User data modal, prevent modal to appear again after first visit | ||
const myStorage = typeof window !== 'undefined' ? window.localStorage : null; | ||
const modalStatus = typeof window !== 'undefined' && myStorage.getItem('modal'); | ||
const [userModalOpen, setUserModalOpen] = useState(modalStatus === null); |
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.
Can you use a more descriptive name? In a few months, we won't remember what “modal” is.
components/explore/component.js
Outdated
const [userModalOpen, setUserModalOpen] = useState(modalStatus === null); | ||
|
||
const handleModalClose = () => { | ||
myStorage.setItem('modal', 'filled'); |
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.
Same here: 'modal'
could be named something else like 'userResearchModal'
.
Hi @jorgejesus, This PR contains the new user research modal that will be displayed on the map page. María added two new environment variables:
Could you add them to the configuration of the staging and production server? You should have received some shared credentials from LastPass with the values in there. |
Hi @jorgejesus, |
Yes I will. It will be done tomorrow morning. |
Ground control to Majors @mluena @clementprdhomme:
Can I merge to develop ?! |
|
This is ISRIC ground control to Majours @mluena and @clementprdhomme automatic merge and automatic deployment has been successful with a perfect landing on |
* Dockerfile/K8s implementation, prod/dev run (#24) * Delete the GitHub Actions The app will now be built with ISRIC's Google Cloud account * google search verification file added (#31) * Modal to recruit user (airtable) (#30) * Modal to recruit user (airtable) * airtable: prevent giving a description if 'other' field is not selected * mobile fixes * updates in user recruitment modal * Updated env variable structure * cloudbuild configuration - automatic deployment Co-authored-by: Jorge S. Mendes de Jesus <jorge.mendesdejesus@isric.org> * Typo on .dockerignore * Feat/modal check (#35) * Modal to recruit user (airtable) * airtable: prevent giving a description if 'other' field is not selected * updates in user recruitment modal * user modal local storage function Co-authored-by: Jorge Samuel Mendes de Jesus <jorge.jesus@gmail.com> Co-authored-by: Clément Prod'homme <contact@clementprodhomme.fr> Co-authored-by: Jorge S. Mendes de Jesus <jorge.mendesdejesus@isric.org>
* Modal to recruit user (airtable) * airtable: prevent giving a description if 'other' field is not selected * mobile fixes * updates in user recruitment modal * Updated env variable structure * cloudbuild configuration - automatic deployment Co-authored-by: Jorge S. Mendes de Jesus <jorge.mendesdejesus@isric.org>
* Dockerfile/K8s implementation, prod/dev run (#24) * Modal to recruit user (airtable) (#30) * Modal to recruit user (airtable) * airtable: prevent giving a description if 'other' field is not selected * mobile fixes * updates in user recruitment modal * Updated env variable structure * cloudbuild configuration - automatic deployment Co-authored-by: Jorge S. Mendes de Jesus <jorge.mendesdejesus@isric.org> * Feat/modal check (#35) * Modal to recruit user (airtable) * airtable: prevent giving a description if 'other' field is not selected * updates in user recruitment modal * user modal local storage function * airtable modal removed (#39) * | missing * Update docker to bullseye #45 Co-authored-by: Jorge Samuel Mendes de Jesus <jorge.jesus@gmail.com> Co-authored-by: Jorge S. Mendes de Jesus <jorge.mendesdejesus@isric.org>
* Dockerfile/K8s implementation, prod/dev run (#24) * Modal to recruit user (airtable) (#30) * Modal to recruit user (airtable) * airtable: prevent giving a description if 'other' field is not selected * mobile fixes * updates in user recruitment modal * Updated env variable structure * cloudbuild configuration - automatic deployment Co-authored-by: Jorge S. Mendes de Jesus <jorge.mendesdejesus@isric.org> * Feat/modal check (#35) * Modal to recruit user (airtable) * airtable: prevent giving a description if 'other' field is not selected * updates in user recruitment modal * user modal local storage function * airtable modal removed (#39) * | missing * Update docker to bullseye #45 * Modal Join us (#44) * Add 'Join us' modal * Add action button 'Join us' to top and bottom of Homepage * Add link 'Join us' in footer menu Co-authored-by: Jorge Samuel Mendes de Jesus <jorge.mendesdejesus@isric.org> Co-authored-by: María Luena Rodríguez <maluenarod@gmail.com> Co-authored-by: Sidney Gijzen <sidneygijzen@users.noreply.github.com>
* Dockerfile/K8s implementation, prod/dev run (#24) * Modal to recruit user (airtable) (#30) * Modal to recruit user (airtable) * airtable: prevent giving a description if 'other' field is not selected * mobile fixes * updates in user recruitment modal * Updated env variable structure * cloudbuild configuration - automatic deployment Co-authored-by: Jorge S. Mendes de Jesus <jorge.mendesdejesus@isric.org> * Feat/modal check (#35) * Modal to recruit user (airtable) * airtable: prevent giving a description if 'other' field is not selected * updates in user recruitment modal * user modal local storage function * airtable modal removed (#39) * | missing * Update docker to bullseye #45 * Modal Join us (#44) * Add 'Join us' modal * Add action button 'Join us' to top and bottom of Homepage * Add link 'Join us' in footer menu Co-authored-by: Jorge Samuel Mendes de Jesus <jorge.mendesdejesus@isric.org> * add Inrae to About Us modal (#59) * Fix: new cluster name and env for cluster name * Fix: Possible fix for google clould build variable * Update: Rool back to fix k8s name The implementation of google env variable from cloud build is tricky, no time to look into it * Triggering a google build --------- Co-authored-by: María Luena Rodríguez <maluenarod@gmail.com> Co-authored-by: Sidney Gijzen <sidneygijzen@users.noreply.github.com>
This PR adds a modal to recruit users through airtable. It includes: