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

Feat/contact us page 2 #266

Merged
merged 40 commits into from
Dec 3, 2020
Merged

Conversation

gweiying
Copy link
Contributor

No description provided.

@gweiying gweiying mentioned this pull request Nov 26, 2020
26 tasks
…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
@gweiying gweiying linked an issue Dec 1, 2020 that may be closed by this pull request
Comment on lines 79 to 84
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;
Copy link
Contributor

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

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 idea eb4b82c

@gweiying gweiying requested review from alexanderleegs and kwajiehao and removed request for alexanderleegs December 2, 2020 07:58
@gweiying gweiying marked this pull request as ready for review December 2, 2020 08:26
@gweiying gweiying merged commit 8d967a6 into feat/contact-us-page Dec 3, 2020
@gweiying gweiying deleted the feat/contact-us-page-2 branch December 3, 2020 14:08
Copy link
Contributor

@kwajiehao kwajiehao left a comment

Choose a reason for hiding this comment

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

Lgtm

Couple of nits as discussed offline:

  1. Font size of CMS sidebar changed

After
Screenshot 2020-12-03 at 10 01 19 PM

Before
Screenshot 2020-12-03 at 10 01 32 PM

  1. Reduce the spacing in a multi-line title for each subsection in the EditContactUs layout

Screenshot 2020-12-03 at 9 57 55 PM

gweiying added a commit that referenced this pull request Dec 4, 2020
* 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
gweiying added a commit that referenced this pull request Dec 4, 2020
* 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
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.

EditContactUsPage layout
3 participants