Skip to content

fix: removing ticket group, some extra line and adding a popup #5084

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

Merged
merged 8 commits into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/components/widgets/forms/ticket-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ export default class TicketInput extends Component {
super.willDestroyElement(...arguments);
$('.icon.buttons', this.element).find('.button').popup('destroy');
}

@action
hideTicket() {
this.toggleProperty('ishidden');
}

}
7 changes: 6 additions & 1 deletion app/helpers/confirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ export default Helper.extend({

compute(params) {
return () => {
if (params.length >= 2) {
if (params.length >= 6) {
this.confirm.prompt('Are You Sure?', { 'denyText': params[2], 'approveText': params[3], 'denyColor': params[4], 'approveColor': params[5], 'extra': params[0] })
.then(() => {
params[1]();
});
} else if (params.length >= 2) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain please what is happening here. Looks very confusing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this.confirm.prompt('Are You Sure?', { 'denyText': params[2], 'approveText': params[3], 'denyColor': params[4], 'approveColor': params[5], 'extra': params[0] })

the options are from service/confirm.js. In confirm-moda.js these are props (denyText, approveText...). in confirm modal helper i am using those and in component passing them.

this.confirm.prompt(params[0])
.then(() => {
params[1]();
Expand Down
13 changes: 5 additions & 8 deletions app/templates/components/forms/wizard/basic-details-step.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
@value={{this.data.event.ownerDescription}} />
</div>
{{/if}}
<div class="ui section divider"></div>
<div class="ui section divider"></div>
<div class="field">
<label class="required">{{t 'Ticketing System'}}</label>
Expand Down Expand Up @@ -200,7 +199,8 @@
@canMoveDown={{not-eq ticket.position (dec this.data.event.tickets.length)}}
@moveTicketUp={{action "moveTicket" ticket "up"}}
@moveTicketDown={{action "moveTicket" ticket "down"}}
@removeTicket={{confirm "Are you sure you wish to delete this ticket ?" (action "removeTicket" ticket)}} />
@removeTicket={{confirm "Are you sure you wish to delete this ticket ?" (action "removeTicket" ticket)}}
@ishidden = {{false}} />
{{/each}}
{{else}}
<h3 class="text muted weight-500">
Expand Down Expand Up @@ -273,8 +273,7 @@
{{/if}}
</div>
--}}

<div class="ui section divider"></div>
<br>
<div class="field">
<h4>{{t 'Add Payment Details'}}</h4>
<div class="two fields">
Expand Down Expand Up @@ -328,7 +327,7 @@
</div>
</div>
</div>
<div class="ui section divider"></div>
<br>
<div class="field">
<h4>{{t 'Choose payment methods'}}</h4>
{{#if this.canAcceptPayPal}}
Expand Down Expand Up @@ -529,9 +528,7 @@
/>
</div>
{{/if}}

<div class="ui section divider"></div>

<br>
<div class="field">
{{#if this.data.event.isTaxEnabled}}
<div class="ui card">
Expand Down
25 changes: 4 additions & 21 deletions app/templates/components/widgets/forms/ticket-input.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
{{#if this.isExpanded}}
<div class="one column row">
<div class="column">
<h4>Settings</h4>
<div class="field">
<label for="ticket_description">{{t 'Ticket Description'}}</label>
<Textarea
Expand All @@ -102,14 +101,14 @@
</div>
</div>
<div class="field">
<div class="ui checkbox">
<div class="ui checkbox" onClick={{if (not this.ishidden) (confirm 'To sell hidden tickets you need to set up an access code under Event Dashboard > Tickets Tab > Access Code.' (action 'hideTicket') 'Ok' 'Cancel' 'green' 'red')}}>
<Input
@type="checkbox"
@checked={{this.ticket.isHidden}}
@name="ticket_hidden" />
@checked={{this.ishidden}}
@name="ticket_hidden"/>
<label for="description_visible">
{{t 'Hide Ticket from the Public Events page'}}<br>
<span class="text muted">{{t 'Ticket would still be available for sale to Organizers.'}}</span>
<span class="text muted">{{t 'To sell hidden tickets you need to set up an access code under Event Dashboard > Tickets Tab > Access Code.'}}</span>
</label>
</div>
</div>
Expand Down Expand Up @@ -194,22 +193,6 @@
</div>
</div>

<div class="{{unless this.device.isMobile 'six wide'}} field">
<label for="code_groups">{{t 'Ticket Code Group'}}</label>
<UiDropdown
@class="fluid multiple search selection"
@allowAdditions={{true}}>
<Input
@type="hidden"
@name="ticket_code_groups"
@value={{this.ticket.groups}} />
<div class="default text">{{t 'Add Code Groups'}}</div>
<div class="menu">
</div>
</UiDropdown>
<span class="text muted">({{t 'comma separated groups'}})</span>
</div>


</div>
</div>
Expand Down