This repository was archived by the owner on Jun 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 222
[NEW] Add Feedback form #415
Open
murtaza98
wants to merge
21
commits into
RocketChat:develop
Choose a base branch
from
murtaza98:survey-feedback-new
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
ef79c82
feedback-form module imported from PR#104
murtaza98 4d9be0f
feedback-form update
murtaza98 c465beb
rendered colorful emojis in feedback form
murtaza98 d43b82c
modified title of feedback panel
murtaza98 ea7eb16
update stories for feedback-form
murtaza98 5ff0d20
Merge pull request #1 from RocketChat/develop
murtaza98 087412d
Merge branch 'develop' into survey-feedback-new
murtaza98 7336ff3
feedback survey page validations
murtaza98 0fd1d44
feedback form update
murtaza98 5a2c3ac
feedback/survey form update
murtaza98 db93e91
apply theme/color to Survey Feedback Page
murtaza98 5f98384
removed emoji-mart dependency from survey/feedback form
murtaza98 7737571
feedback form update - re-configured survey payload
murtaza98 bdf6743
feedback form - attach action to `No Thanks` Button
murtaza98 d3c6175
feedback form update
murtaza98 7fbf5c7
feedback survey update - updated validations
murtaza98 717c0c8
removed console.log statements
murtaza98 57d384c
connected LC with feedback-form config setting
murtaza98 39bc80c
[FIX] send feedback comment to the server
antkaz 5ea2146
Merge pull request #2 from antkaz/survey-feedback-new
murtaza98 f298356
Merge branch 'develop' into survey-feedback-new
murtaza98 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import { Component } from 'preact'; | ||
| import styles from './style'; | ||
| import { createClassName } from '../../helpers'; | ||
| import { Emoji } from 'emoji-mart'; | ||
|
|
||
| const ExperienceRatingItem = ({ value, label, description, checked, onChange }) => ( | ||
| <div className={createClassName(styles, 'form__input-experience-rating__item')}> | ||
| <div className={createClassName(styles, 'form__input-experience-rating__input-container', { checked })}> | ||
| <input | ||
| type="radio" | ||
| name="experience-rating" | ||
| id={value} | ||
| value={value} | ||
| className={createClassName(styles, 'form__input-experience-rating__input')} | ||
| checked={checked} | ||
| onChange={onChange} | ||
| /> | ||
| <label className={createClassName(styles, 'form__input-experience-rating__label')} for={value}> | ||
| {label} | ||
| </label> | ||
| </div> | ||
| {checked && <span className={createClassName(styles, 'form__input-experience-rating__description')}>{description}</span>} | ||
| </div> | ||
| ); | ||
|
|
||
| export class ExperienceRating extends Component { | ||
| state = { | ||
| value: this.props.value, | ||
| } | ||
|
|
||
| handleChange = (event) => { | ||
| const { onChange } = this.props; | ||
| onChange && onChange(event); | ||
| this.setState({ value: event.target.value }); | ||
| } | ||
|
|
||
| isChecked = (itemValue) => { | ||
| const { value } = this.state; | ||
| return value === itemValue; | ||
| } | ||
|
|
||
| renderEmoji = (emojiShortName) => { | ||
| return Emoji({ | ||
| set: 'apple', | ||
| emoji: emojiShortName, | ||
| size: 32, | ||
| sheetSize: 64, | ||
| }) | ||
| } | ||
|
|
||
| render() { | ||
| return ( | ||
| <div | ||
| className={[ | ||
| createClassName(styles, 'form__input'), | ||
| createClassName(styles, 'form__input-experience-rating'), | ||
| ].join(' ')} | ||
| > | ||
| <ExperienceRatingItem value="1" label={this.renderEmoji('white_frowning_face')} description="Very bad" onChange={this.handleChange} checked={this.isChecked('1')} /> | ||
| <ExperienceRatingItem value="2" label={this.renderEmoji('slightly_frowning_face')} description="Bad" onChange={this.handleChange} checked={this.isChecked('2')} /> | ||
| <ExperienceRatingItem value="3" label={this.renderEmoji('neutral_face')} description="Ok" onChange={this.handleChange} checked={this.isChecked('3')} /> | ||
| <ExperienceRatingItem value="4" label={this.renderEmoji('slightly_smiling_face')} description="Good" onChange={this.handleChange} checked={this.isChecked('4')} /> | ||
| <ExperienceRatingItem value="5" label={this.renderEmoji('smile')} description="Awesome" onChange={this.handleChange} checked={this.isChecked('5')} /> | ||
| </div> | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,294 @@ | ||
| @import '~styles/colors'; | ||
|
murtaza98 marked this conversation as resolved.
|
||
| @import '~styles/variables'; | ||
|
|
||
|
|
||
| $form-item-margin-bottom: $default-gap; | ||
| $form-item-inline-margin-left: $default-gap; | ||
|
|
||
| $form-label-margin: ($default-gap / 3) 0; | ||
|
|
||
| $form-label-color: $color-text-dark; | ||
| $form-label-error-color: $color-red; | ||
|
|
||
| $form-label-font-size: 0.75rem; | ||
| $form-label-font-weight: 600; | ||
| $form-label-line-height: 1rem; | ||
|
|
||
| $form-description-margin: ($default-gap / 2) 0 0; | ||
|
|
||
| $form-description-color: $color-text-grey; | ||
| $form-description-error-color: $color-red; | ||
|
|
||
| $form-description-font-size: 0.75rem; | ||
| $form-description-font-weight: 500; | ||
| $form-description-line-height: 1rem; | ||
|
|
||
| $form-input-border-width: $default-border; | ||
| $form-input-border-radius: $default-border-radius; | ||
| $form-input-padding: (0.75 * $default-gap - $default-border); | ||
| $form-input-small-padding: (0.25 * $default-gap - $default-border / 2) (0.75 * $default-gap - $default-border); | ||
|
|
||
| $form-input-color: $color-text-dark; | ||
| $form-input-placeholder-color: $color-text-light; | ||
| $form-input-background-color: $bg-color-white; | ||
| $form-input-border-color: $bg-color-grey; | ||
| $form-input-focus-border-color: $color-text-dark; | ||
| $form-input-hover-border-color: $color-text-light; | ||
| $form-input-disabled-background-color: $bg-color-grey; | ||
| $form-input-disabled-color: $color-text-light; | ||
| $form-input-error-color: $color-red; | ||
| $form-input-error-border-color: $color-red; | ||
|
|
||
| $form-input-font-family: $font-family; | ||
| $form-input-font-size: 0.875rem; | ||
| $form-input-font-weight: 500; | ||
| $form-input-line-height: 1.25rem; | ||
|
|
||
| $form-input-disabled-opacity: $disabled-opacity; | ||
|
|
||
| $form-input-select-arrow-size: $form-input-padding; | ||
| $form-input-select-arrow-padding: $form-input-padding; | ||
|
|
||
| $form-input-select-arrow-color: $color-text-light; | ||
|
|
||
| .form__item { | ||
| display: flex; | ||
| flex-direction: column; | ||
|
|
||
| width: 100%; | ||
| margin-bottom: $form-item-margin-bottom; | ||
|
|
||
| &--inline { | ||
| flex-direction: row; | ||
| flex-wrap: wrap; | ||
| justify-content: flex-end; | ||
| align-items: center; | ||
|
|
||
| .form__label { | ||
| flex: 1 25%; | ||
| } | ||
|
|
||
| .form__label + .form__input { | ||
| flex: 3 75%; | ||
| } | ||
|
|
||
| .form__description { | ||
| flex: 0 75%; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .form__label { | ||
| margin: $form-label-margin; | ||
|
|
||
| color: $form-label-color; | ||
|
|
||
| font-size: $form-label-font-size; | ||
| font-weight: $form-label-font-weight; | ||
| text-align: left; | ||
| letter-spacing: 0; | ||
| line-height: $form-label-line-height; | ||
| white-space: nowrap; | ||
| text-overflow: ellipsis; | ||
|
|
||
| transition: color $default-time-animation; | ||
|
|
||
| &--error { | ||
| color: $form-label-error-color; | ||
| } | ||
| } | ||
|
|
||
| .form__description { | ||
| margin: $form-description-margin; | ||
|
|
||
| color: $form-description-color; | ||
|
|
||
| font-size: $form-description-font-size; | ||
| font-weight: $form-description-font-weight; | ||
| line-height: $form-description-line-height; | ||
|
|
||
| transition: color $default-time-animation; | ||
|
|
||
| &--error { | ||
| color: $form-description-error-color; | ||
| } | ||
| } | ||
|
|
||
| @mixin form__input-box { | ||
| border: $form-input-border-width solid $form-input-border-color; | ||
| border-radius: $form-input-border-radius; | ||
| padding: $form-input-padding; | ||
|
|
||
| color: $form-input-color; | ||
| background-color: $form-input-background-color; | ||
| outline: none; | ||
|
|
||
| font-family: $form-input-font-family; | ||
| font-size: $form-input-font-size; | ||
| font-weight: $form-input-font-weight; | ||
| line-height: $form-input-line-height; | ||
|
|
||
| transition: border-color $default-time-animation, | ||
| color $default-time-animation, | ||
| background-color $default-time-animation, | ||
| trasform $default-time-animation; | ||
|
|
||
| &:focus { | ||
| border-color: $form-input-focus-border-color; | ||
| } | ||
|
|
||
| &:hover { | ||
| border-color: $form-input-hover-border-color; | ||
| } | ||
|
|
||
| &--small { | ||
| padding: $form-input-small-padding; | ||
| } | ||
|
|
||
| &--disabled { | ||
| color: $form-input-disabled-color; | ||
| background-color: $form-input-disabled-background-color; | ||
| border-color: $form-input-border-color; | ||
|
|
||
| opacity: $form-input-disabled-opacity; | ||
| cursor: not-allowed; | ||
| } | ||
|
|
||
| &--error, | ||
| &--error:focus, | ||
| &--error:hover { | ||
| border-color: $form-input-error-border-color; | ||
| color: $form-input-error-color; | ||
| } | ||
| } | ||
|
|
||
| .form__input { | ||
| &-text, | ||
| &-password, | ||
| &-file { | ||
| @include form__input-box; | ||
|
|
||
| &::placeholder { | ||
| color: $form-input-placeholder-color; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .form__input-file { | ||
| &--hidden { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| textarea.form__input-text { | ||
| resize: none; | ||
| } | ||
|
|
||
| .form__input-select { | ||
| position: relative; | ||
| display: flex; | ||
| flex: 1; | ||
|
|
||
| &__select { | ||
| @include form__input-box; | ||
|
|
||
| flex: 1; | ||
|
|
||
| padding-right: (3 * $form-input-select-arrow-padding + $form-input-select-arrow-size); | ||
|
|
||
| color: $form-input-color; | ||
|
|
||
| -webkit-appearance: none; | ||
| -moz-appearance: none; | ||
| appearance: none; | ||
|
|
||
| &::-ms-expand { | ||
| display: none; | ||
| } | ||
|
|
||
| &--placeholder { | ||
| color: $form-input-placeholder-color; | ||
| } | ||
|
|
||
| &--small { | ||
| padding-right: (3 * $form-input-select-arrow-padding + $form-input-select-arrow-size); | ||
| } | ||
| } | ||
|
|
||
| &__option { | ||
| color: $form-input-color; | ||
| } | ||
|
|
||
| &__arrow { | ||
| position: absolute; | ||
| right: $form-input-select-arrow-padding; | ||
| top: 50%; | ||
|
|
||
| width: $form-input-select-arrow-size; | ||
| height: $form-input-select-arrow-size; | ||
|
|
||
| color: $form-input-select-arrow-color; | ||
|
|
||
| transform: translateY(-50%) translateY(2px); | ||
| pointer-events: none; | ||
| } | ||
| } | ||
|
|
||
| .form__input-experience-rating { | ||
| display: flex; | ||
| flex: 1; | ||
| flex-direction: row; | ||
| align-items: flex-start; | ||
| margin-bottom: $form-item-margin-bottom; | ||
|
|
||
| &__item { | ||
| display: flex; | ||
| flex: 1; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| justify-content: center; | ||
| text-align: center; | ||
| } | ||
|
|
||
| &__input-container { | ||
| width: 48px; | ||
| height: 48px; | ||
| text-align: center; | ||
| line-height: 66px; | ||
| border-radius: 50%; | ||
| margin-bottom: 4px; | ||
| transition: background $default-time-animation; | ||
|
|
||
| &--checked { | ||
| background: #E1E5E8; | ||
| } | ||
| } | ||
|
|
||
| &__input { | ||
| display: none; | ||
| } | ||
|
|
||
| &__label { | ||
| width: 36px; | ||
| height: 36px; | ||
| color: #2F343D; | ||
| font-size: 36px; | ||
| text-align: center; | ||
| letter-spacing: 0; | ||
| line-height: 36px; | ||
| cursor: pointer; | ||
| user-select: none; | ||
|
|
||
| &:hover { | ||
| opacity: 0.9; | ||
| } | ||
| } | ||
|
|
||
| &__description { | ||
| color: #9EA2A8; | ||
| font-size: 10px; | ||
| font-weight: bold; | ||
| letter-spacing: 0.2px; | ||
| line-height: 16px; | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.