Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 4 additions & 1 deletion app/components/forms/orders/order-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,10 @@ export default Component.extend(FormMixin, {
},

allFields: computed('fields', function() {
return groupBy(this.fields.toArray(), field => field.get('form'));
const requiredFixed = this.fields.toArray().slice(0, 3);
Copy link
Member

Choose a reason for hiding this comment

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

There is no guarantee that only first three fields are fixed fields, the logic is flawed

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 is for firstName, lastName and email. They are always at top?

Copy link
Member

Choose a reason for hiding this comment

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

But they'll not always be 3

const customFields = orderBy(this.fields.toArray().slice(3), ['isComplex', 'name'], ['asc', 'asc']);
Copy link
Member

Choose a reason for hiding this comment

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

by default all values are sorted in ascending order

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no they are not in a way in attendee form.

Copy link
Member

Choose a reason for hiding this comment

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

I mean orderBy funtion by default I think sort all values in ascending order so no need to pass ['asc', 'asc']

const finalFields = requiredFixed.concat(customFields);
return groupBy(finalFields, field => field.get('form'));
}),

genders : orderBy(genders, 'name'),
Expand Down
2 changes: 1 addition & 1 deletion app/models/social-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default ModelBase.extend({
}),

buttonColor: computed('normalizedName', function() {
return buttonColor[this.normalizedName] ;
return buttonColor[this.normalizedName];
})

});