Skip to content

Commit

Permalink
Merge pull request #11 from fleetbase/feature/file-export
Browse files Browse the repository at this point in the history
file export
  • Loading branch information
roncodes authored May 17, 2024
2 parents 4d868d9 + 9c046cd commit b7006b4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion addon/controllers/users/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ export default class UsersIndexController extends Controller {
* @void
*/
@action exportUsers() {
this.crud.export('user');
const selections = this.table.selectedRows.map((_) => _.id);
this.crud.export('users', { params: { selections } });
}

/**
Expand Down
16 changes: 14 additions & 2 deletions addon/templates/users/index.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Layout::Section::Header @title={{t "iam.common.user"}} @searchQuery={{this.query}} @onSearch={{perform this.search}}>
{{#if (safe-has this.table "selectedRows")}}
{{#if (safe-has this.table "selectedRows")}}
<DropdownButton @icon="layer-group" @text={{t "iam.common.bulk-action"}} @type="magic" @size="sm" @buttonWrapperClass="mr-2" @contentClass="dropdown-menu" as |dd|>
<div class="next-dd-menu mt-2 mx-0">
<div class="px-1">
Expand All @@ -15,7 +15,19 @@
</Layout::Section::Header>

<Layout::Section::Body>
<Table @rows={{@model}} @columns={{this.columns}} @selectable={{true}} @canSelectAll={{true}} @onSetup={{fn (mut this.table)}} @pagination={{true}} @paginationMeta={{@model.meta}} @page={{this.page}} @onPageChange={{fn (mut this.page)}} @tfootVerticalOffset="53" @tfootVerticalOffsetElements=".next-view-section-subheader" />
<Table
@rows={{@model}}
@columns={{this.columns}}
@selectable={{true}}
@canSelectAll={{true}}
@onSetup={{fn (mut this.table)}}
@pagination={{true}}
@paginationMeta={{@model.meta}}
@page={{this.page}}
@onPageChange={{fn (mut this.page)}}
@tfootVerticalOffset="53"
@tfootVerticalOffsetElements=".next-view-section-subheader"
/>
</Layout::Section::Body>

{{outlet}}

0 comments on commit b7006b4

Please sign in to comment.