-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature 8783:Implement rich text links in custom forms (#8972)
* feature-8783: Implement rich text links in custom forms * feature-8783: Implement rich text links in custom forms * feature-8783: Fix git comment * feature-8783: Fix comment * feature-8783: Fix comment * feature-8783: Fix comment * feature-8783: Fix comment * feature-8783: Implement rich text links in custom forms * feature-8783: Fix bug not show title on the screen order * feature-8783: Implement rich text links in custom forms --------- Co-authored-by: lthanhhieu <lthanhhieu@tma.com.vn> Co-authored-by: cweitat <cweitat@gmail.com> Co-authored-by: ntthitrinh <ntthitrinh@tma.com.vn>
- Loading branch information
1 parent
9e4e4ea
commit a0aaced
Showing
15 changed files
with
681 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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
51 changes: 30 additions & 21 deletions
51
app/components/forms/wizard/custom-form-input-translation.hbs
This file contains 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 |
---|---|---|
@@ -1,25 +1,34 @@ | ||
{{#if (not-eq @type "number")}} | ||
<div style="width: 30%"> | ||
<Input type="text" placeholder={{t "Field Name"}} @value={{@data.name}}/> | ||
{{#if (eq @type "number")}} | ||
<div class="rich-text-type-number" > | ||
<Widgets::Forms::RichTextLink | ||
@value={{@data.name}}/> | ||
</div> | ||
{{else}} | ||
<div style="width: 20%"> | ||
<Input type="text" placeholder={{t "Field Name"}} @value={{@data.name}}/> | ||
<div class="rich-text-other" > | ||
<Widgets::Forms::RichTextLink | ||
@value={{@data.name}}/> | ||
</div> | ||
{{/if}} | ||
<UiDropdown class="ui selection dropdown custom-form-dropdown-attendee" | ||
@selected={{@data.selectedLang}} | ||
@onChange={{action 'onChangeLanguage' }}> | ||
<div class="default text"> | ||
{{ @data.selectedLang }} | ||
</div> | ||
<i class="dropdown icon"></i> | ||
<div class="menu"> | ||
{{#each this.languageList as |language|}} | ||
<div class="item" data-value={{language.code}}>{{language.name}}</div> | ||
{{/each}} | ||
</div> | ||
</UiDropdown> | ||
<button style="font-size: 1.1em;" class="ui compact icon negative circular button" data-tooltip="{{t 'Delete'}}" {{action (confirm (t "Are you sure you want to delete this?") (action 'onRemoveForm' ))}}> | ||
<i class="trash box icon"></i> | ||
</button> | ||
<div style="width: 11rem"> | ||
<div class="ui hidden divider wrapper-button"></div> | ||
<UiDropdown class="ui selection dropdown custom-form-dropdown-attendee" | ||
@selected={{@data.selectedLang}} | ||
@onChange={{action 'onChangeLanguage'}} | ||
style="line-height: inherit; min-width: 11rem;"> | ||
<div class="default text"> | ||
{{ @data.selectedLang }} | ||
</div> | ||
<i class="dropdown icon"></i> | ||
<div class="menu"> | ||
{{#each this.languageList as |language|}} | ||
<div class="item" data-value={{language.code}}>{{language.name}}</div> | ||
{{/each}} | ||
</div> | ||
</UiDropdown> | ||
</div> | ||
<div> | ||
<div class="ui hidden divider wrapper-button"></div> | ||
<button class="ui compact icon negative button btn-delele-lang" data-tooltip="{{t 'Delete'}}" {{action (confirm (t "Are you sure you want to delete this?") (action 'onRemoveForm' ))}}> | ||
<i class="trash box icon"></i> | ||
</button> | ||
</div> |
This file contains 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 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,99 @@ | ||
<div class="ui hidden divider"></div> | ||
<div class="ui dividing"> | ||
<i class="checkmark box icon"></i> | ||
<span class="content"> | ||
{{t 'Add Custom Form Field'}} | ||
</span> | ||
</div> | ||
<div class="cf-container"> | ||
<div {{did-update this.updated @field}} class="ui action input main number-text"> | ||
{{#if (eq this.type "number")}} | ||
<div class="number-div"> | ||
<Widgets::Forms::RichTextLink | ||
@value={{this.name}}/> | ||
</div> | ||
{{else}} | ||
<div class="other-div"> | ||
<Widgets::Forms::RichTextLink | ||
@value={{this.name}}/> | ||
</div> | ||
{{/if}} | ||
<div class="lang-dropdown"> | ||
<div class="ui hidden divider lang-dropdown-item"></div> | ||
{{#if (eq @form 'attendee')}} | ||
<UiDropdown | ||
class="ui selection dropdown custom-form-dropdown-attendee item-content" | ||
@selected={{this.mainLanguage}} | ||
@onChange={{action 'onMainLanguageChange'}} | ||
> | ||
<div class="default text"> | ||
{{ this.mainLanguage }} | ||
</div> | ||
<i class="dropdown icon"></i> | ||
<div class="menu"> | ||
{{#each this.languageList as |language|}} | ||
<div class="item" data-value={{language.code}}>{{language.name}}</div> | ||
{{/each}} | ||
</div> | ||
</UiDropdown> | ||
{{/if}} | ||
</div> | ||
<div> | ||
{{#if (eq this.type "number")}} | ||
<div class="ui hidden divider range-box"></div> | ||
<div class="number-wrapper"> | ||
<Input | ||
@type="number" | ||
@name="min_price" | ||
placeholder={{t "Min"}} style="width: 5rem; line-height: 1.7rem" | ||
@value={{this.min}} /> | ||
<Input | ||
@type="number" | ||
@name="max_price" | ||
placeholder={{t "Max"}} style="width: 5rem; line-height: 1.7rem" | ||
@value={{this.max}} /> | ||
</div> | ||
{{/if}} | ||
</div> | ||
<div style="width: 11rem;"> | ||
<div class="ui hidden divider" style="margin: 1.2rem 0rem;"></div> | ||
<UiDropdown | ||
class="ui selection dropdown custom-form-dropdown-attendee" | ||
@selected={{this.type}} | ||
@onChange={{action (mut this.type)}} | ||
style="line-height: inherit; min-width: 11rem"> | ||
<div class="default text"> | ||
{{ this.type }} | ||
</div> | ||
<i class="dropdown icon"></i> | ||
<div class="menu"> | ||
<div class="item" data-value="text">{{t "Short Answer"}}</div> | ||
<div class="item" data-value="paragraph">{{t "Paragraph"}}</div> | ||
<div class="item" data-value="number">{{t "Number"}}</div> | ||
<div class="item" data-value="year">{{t "Year"}}</div> | ||
<div class="item" data-value="boolean">{{t "Yes/No"}}</div> | ||
</div> | ||
</UiDropdown> | ||
</div> | ||
<div> | ||
<div class="ui hidden divider wrapper-button"></div> | ||
{{#if (eq @form 'attendee')}} | ||
<button class="ui button btn-add-translate" {{action 'addTranslation'}} disabled={{this.disableAddTranslation}}>{{t 'Add Translation'}}</button> | ||
{{/if}} | ||
<button class="ui button btn-add-save" {{action 'addFormField'}} disabled={{not this.validIdentifier}}>{{if @field (t 'Save') (t 'Add')}}</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div style="display: flex; flex-direction: column"> | ||
{{#each this.visibleForm as |sub|}} | ||
<div {{did-update this.updated @field}} class="ui action input sub" style="width: inherit; margin-top: 10px"> | ||
{{#unless sub.isDeleted }} | ||
<Forms::Wizard::CustomFormInputTranslation | ||
@data={{sub}} | ||
@type={{this.type}} | ||
@onRemoveTranslation={{action (mut sub.isDeleted) true}} | ||
@onChange={{action 'onChildChangeLanguage'}}/> | ||
{{/unless}} | ||
</div> | ||
{{/each}} | ||
</div> |
Oops, something went wrong.
a0aaced
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.
Successfully deployed to the following URLs:
open-event-frontend – ./
open-event-frontend-git-development-eventyay.vercel.app
open-event-frontend.vercel.app
open-event-frontend-eventyay.vercel.app