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

XSelect: Remove dependency & replace usage #202

Merged
merged 1 commit into from
Mar 8, 2024
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
51 changes: 4 additions & 47 deletions addon/components/hyper-table/cell-renderers/money.hbs
Original file line number Diff line number Diff line change
@@ -1,52 +1,9 @@
{{#if (and this.emptyValue (or (not this.editStatus.status) this.isSuccess))}}
{{#if this.column.upsertable}}
<span {{action "toggleEditing"}}>
{{or this.column.field.emptyPlaceholder "Add value"}}
</span>
{{else}}
{{or this.column.field.emptyState "β€”"}}
{{/if}}
{{or this.column.field.emptyState "β€”"}}
{{else}}
<div class="editing-input">
{{#if (and this.editStatus.status (not this.isSuccess))}}
<div class={{if this.isError "is-invalid"}}>
{{#x-select
class="editing-input__field editing-input__field--select form-control"
value=this.item.currency
on-change=(action "updateCurrency")
as |xs|
}}
{{#each this.manager.options.currencies as |code|}}
{{#xs.option value=code}}{{code}}{{/xs.option}}
{{/each}}
{{/x-select}}
{{input
type="number"
insert-newline=(action "toggleEditing" this.editableValue)
value=this.value
class="editing-input__field form-control"
}}
</div>
{{else}}
<div class="text-value" {{enable-tooltip title=(format-money this.amount this.item.currency) placement="bottom"}}>
{{if this.emptyValue (or this.column.field.emptyState "β€”") (format-money this.amount this.currency)}}
</div>
{{/if}}
</div>
{{/if}}

{{! TODO: Extract to component }}
{{#if this.column.upsertable}}
<div class="status-container margin-left-x-sm text-color-default-lighter">
{{#if this.isSuccess}}
<OSS::Icon @icon="fa-pencil" class="cell-edition delayed" {{action "toggleEditing"}} />
<OSS::Icon @icon="fa-check" class="font-size-lg font-color-success-500" />
{{else if (or this.isEditing this.isError)}}
<OSS::Icon @icon="fa-save" {{action "toggleEditing" this.editableValue}} />
{{else if this.isSaving}}
<LoadingState />
{{else}}
<OSS::Icon @icon="fa-pencil" class="cell-edition" {{action "toggleEditing"}} />
{{/if}}
<div class="text-value" {{enable-tooltip title=(format-money this.amount this.item.currency) placement="bottom"}}>
{{if this.emptyValue (or this.column.field.emptyState "β€”") (format-money this.amount this.currency)}}
</div>
</div>
{{/if}}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"ember-named-blocks-polyfill": "^0.2.5",
"ember-sortable": "4.0.0",
"ember-truth-helpers": "^3.1.1",
"emberx-select": "^3.1.1",
"moment": "^2.29.4",
"tether": "^1.4.7"
},
Expand Down
Loading
Loading