-
Notifications
You must be signed in to change notification settings - Fork 10
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/contact us page 2 #266
Conversation
…, simplifies indexing updates for OnDragEnd, createHandler, deleteHandler, displayHandler
…y is empty, if empty the key-value pair is removed and not saved
…es to templates, also updates scroll behavior for onFieldChange, onDragEnd, deleteHandler, createHandler and displayHandler
…arning accordingly
…s that can use masked input styling, for example dates, phone numbers and so on
…ng for the Phone Number field, uses Dropdown to set state
…input provides user cues for length of phone number already
…et by default to inherit parent font-size
…View Map link to open in a new page
…rors, border is only highlighted when section/card is minimized
src/utils/validators.js
Outdated
const CONTACT_TITLE_MIN_LENGTH = 0; | ||
const CONTACT_TITLE_MAX_LENGTH = 30; | ||
const CONTACT_DESCRIPTION_MAX_LENGTH = 400; | ||
|
||
// Locations | ||
const LOCATION_TITLE_MIN_LENGTH = 2; | ||
const LOCATION_TITLE_MIN_LENGTH = 0; |
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: I feel like these should be min_length 1 and the checks left as value.length < CONTACT_TITLE_MIN_LENGTH
so that the wording is clearer
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 idea eb4b82c
…ct and Location not contacts and locations
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.
* fix: suppresses dropdown for Contact Us Folder Card dropdown options * fix: removes hardcoded sectionId, passing sectionId as argument * fix: updates displaySections to use locations, contacts as key values, simplifies indexing updates for OnDragEnd, createHandler, deleteHandler, displayHandler * fix: adds check if frontMatter.contacts or frontMatter.locations array is empty, if empty the key-value pair is removed and not saved * fix: updates templates to use forwarded react references * fix: updates scrollRefs to use React.createRef() and forward references to templates, also updates scroll behavior for onFieldChange, onDragEnd, deleteHandler, createHandler and displayHandler * fix: fixes error in operatingHours validation, adds case for validating map links * fix: clean up comments, whitespace * fix: checks whether content has been edited and shows navigate away warning accordingly * fix: uses deep cloning to sanitise frontMatter * fix: sets background color for contactUs edit preview * fix: buffs up email validation * fix: add packages for DOMPurify * fix: uses DOMPurify to prevent XSS scripts from rendering on Contacts descriptions * fix: fixes paragraph stylistic formatting on Contacts description * fix: fixes form field width for operating hours to not resize with error length * fix: resolves stylistic differences in links and span text * fix: adds parent style around links in ContactSection Templates * fix: cleans up scrollIntoView * fix: adds key to dropdown options to resolve unique id warning * install: adds packages for react-input-mask * feat: creates InputMaskFormField using react-input-mask for FormFields that can use masked input styling, for example dates, phone numbers and so on * feat: adds state hook to Contact Fields to support masked input styling for the Phone Number field, uses Dropdown to set state * fix: simplifies validation for Contact Fields phone number as masked input provides user cues for length of phone number already * fix: rectifies relative imports * fix: cleans up warning errors in validation * fix: fix initialized state in state hook * fix: filters dropdown before mapping to remove arrow function warning * fix: sets font size for error and info messages since span has been set by default to inherit parent font-size * fix: uses info message style for notes * fix: removes extraneous terms from automated url generation and sets View Map link to open in a new page * fix: adds Delete modal for each Location and Contact * feat: add styling for error cards * feat: uses red border to highlight sections and cards that contain errors, border is only highlighted when section/card is minimized * fix: fix title overflow bug * fix: removes default value if user does not select phone number field * fix: clean up dataSanitisers and add initial values for maps_links and titles * fix: removes min length for title * fix: sets min length of titles to 1 * fix: change Add button to singular form instead of plural as in Contact and Location not contacts and locations
* feat: add template components for contact-us page (Contact, Location, Feedback Sections) * feat: refactors Breadcrumb into a separate component for reuse in contact-us template page, renames old Breadcrumb as PageHeader and updates Breadcrumb references in LeftNavPage and SimplePage as well as isomer-template.scss * feat: adds Contact Us button to Workspace, changes page type booleans isHomepage and isCollection to a single page type string as there are 4 different page types to consider now, updates references to isHomepage and isCollection in Workspace, FolderCard and Resources, adds contact-us route to App * feat: refactors Dropdown into a separate component for reuse, originally intended for reuse in contact contents; updates NewSectionCreator to use Dropdown component * fix: makes FormField title non-compulsory so that component can be reused as a series of fields without each having a title such as the address fields in Contact Us * feat: add editor components for Contact Us page (LocationCards, ContactCards, Section, Fields) * feat: add util functions for contact us * feat: add contact us editor page * feat: add data sanitisers for contact us * fix: show/hides Contact Us button from Workspace depending on if contact-us.md file exists * fix: loop through contacts, locations arrays only if arrays are defined * fix: fix typo in dataSanitisers equality check * fix: updates AgencyName to use theme color * fix: fix class warning error, changes class to className * fix: removes empty operating hours objects upon saving * fix: changes contact-us templates structure to be consistent with homepage templates structure * fix: fixes class warning errors, replaces class with className * feat: adds validation and error checking to edit contact us page * Feat/contact us page 2 (#266) * fix: suppresses dropdown for Contact Us Folder Card dropdown options * fix: removes hardcoded sectionId, passing sectionId as argument * fix: updates displaySections to use locations, contacts as key values, simplifies indexing updates for OnDragEnd, createHandler, deleteHandler, displayHandler * fix: adds check if frontMatter.contacts or frontMatter.locations array is empty, if empty the key-value pair is removed and not saved * fix: updates templates to use forwarded react references * fix: updates scrollRefs to use React.createRef() and forward references to templates, also updates scroll behavior for onFieldChange, onDragEnd, deleteHandler, createHandler and displayHandler * fix: fixes error in operatingHours validation, adds case for validating map links * fix: clean up comments, whitespace * fix: checks whether content has been edited and shows navigate away warning accordingly * fix: uses deep cloning to sanitise frontMatter * fix: sets background color for contactUs edit preview * fix: buffs up email validation * fix: add packages for DOMPurify * fix: uses DOMPurify to prevent XSS scripts from rendering on Contacts descriptions * fix: fixes paragraph stylistic formatting on Contacts description * fix: fixes form field width for operating hours to not resize with error length * fix: resolves stylistic differences in links and span text * fix: adds parent style around links in ContactSection Templates * fix: cleans up scrollIntoView * fix: adds key to dropdown options to resolve unique id warning * install: adds packages for react-input-mask * feat: creates InputMaskFormField using react-input-mask for FormFields that can use masked input styling, for example dates, phone numbers and so on * feat: adds state hook to Contact Fields to support masked input styling for the Phone Number field, uses Dropdown to set state * fix: simplifies validation for Contact Fields phone number as masked input provides user cues for length of phone number already * fix: rectifies relative imports * fix: cleans up warning errors in validation * fix: fix initialized state in state hook * fix: filters dropdown before mapping to remove arrow function warning * fix: sets font size for error and info messages since span has been set by default to inherit parent font-size * fix: uses info message style for notes * fix: removes extraneous terms from automated url generation and sets View Map link to open in a new page * fix: adds Delete modal for each Location and Contact * feat: add styling for error cards * feat: uses red border to highlight sections and cards that contain errors, border is only highlighted when section/card is minimized * fix: fix title overflow bug * fix: removes default value if user does not select phone number field * fix: clean up dataSanitisers and add initial values for maps_links and titles * fix: removes min length for title * fix: sets min length of titles to 1 * fix: change Add button to singular form instead of plural as in Contact and Location not contacts and locations * fix: fixes link size on sidebar * fix: line height for card header overflow * fix: fix page type on foldercard
No description provided.