Skip to content

Modular logistics and supply chain operating system (LSOS)

file export

Doljinsuren Enkhbayar9fc53de9fe1f
diff --git a/console/app/controllers/console/admin/organizations/index.js b/console/app/controllers/console/admin/organizations/index.js
index 899fae8b..cce62cec 100644
--- a/console/app/controllers/console/admin/organizations/index.js
+++ b/console/app/controllers/console/admin/organizations/index.js
@@ -40,6 +40,13 @@ export default class ConsoleAdminOrganizationsController extends Controller {
*/
@service filters;
+ /**
+ * Inject the `crud` service
+ *
+ * @var {Service}
+ */
+ @service crud;
+
/**
* The search query param value.
*
@@ -166,4 +173,14 @@ export default class ConsoleAdminOrganizationsController extends Controller {
@action goToCompany(company) {
this.router.transitionTo('console.admin.organizations.index.users', company.public_id);
}
-}
+
+ /**
+ * Toggles dialog to export `drivers`
+ *
+ * @void
+ */
+ @action exportOrganization() {
+ const selections = this.table.selectedRows.map((_) => _.id);
+ this.crud.export('companies', { params: { selections } });
+ }
+}
\ No newline at end of file
diff --git a/console/app/templates/console/admin/organizations/index.hbs b/console/app/templates/console/admin/organizations/index.hbs
index 4b8b5160..86e2a536 100644
--- a/console/app/templates/console/admin/organizations/index.hbs
+++ b/console/app/templates/console/admin/organizations/index.hbs
@@ -1,13 +1,15 @@
{{page-title (t "console.admin.organizations.index.title")}}
-{{!-- template-lint-disable no-unbound --}}
-<Layout::Section::Header @title={{t "console.admin.organizations.index.title"}} @searchQuery={{unbound this.query}} @onSearch={{this.search}} />
+{{! template-lint-disable no-unbound }}
+<Layout::Section::Header @title={{t "console.admin.organizations.index.title"}} @searchQuery={{unbound this.query}} @onSearch={{this.search}}>
+ <Button @icon="long-arrow-up" @iconClass="rotate-icon-45" @text={{t "fleet-ops.common.export"}} @wrapperClass="hidden md:flex" @onClick={{this.exportOrganization}} />
+</Layout::Section::Header>
<Layout::Section::Body>
<Table
@rows={{@model}}
@columns={{this.columns}}
- @selectable={{false}}
- @canSelectAll={{false}}
+ @selectable={{true}}
+ @canSelectAll={{true}}
@onSetup={{fn (mut this.table)}}
@pagination={{true}}
@paginationMeta={{@model.meta}}