-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed inventory,sales-order,purchase-order, and product small issues
created basic structure for product category page
- Loading branch information
1 parent
2a959e9
commit ab42a92
Showing
36 changed files
with
421 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{yield}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Component from '@glimmer/component'; | ||
|
||
export default class AdminProductCategoryComponent extends Component {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<ContentPanel @title="Visibility Controls" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800"> | ||
<p class="mb-4 dark:text-white text-gray-800">Visibility controls allow you to disable sections of Pallet. Toggle the checkbox to enable or disable sections to hide in Pallet</p> | ||
{{#each this.visibilitySettings as |visibilityControl|}} | ||
<InputGroup @wrapperClass="mb-1i"> | ||
<Checkbox @value={{visibilityControl.visible}} @label={{concat visibilityControl.name " Visible"}} @onToggle={{fn (mut visibilityControl.visible)}} @helpText="Enable or disable visibility for this section in Pallet." /> | ||
</InputGroup> | ||
{{/each}} | ||
</ContentPanel> | ||
|
||
<div class="mt-3 flex items-center justify-end"> | ||
<Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.saveVisibilitySettings}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { inject as service } from '@ember/service'; | ||
import { action } from '@ember/object'; | ||
import { isArray } from '@ember/array'; | ||
|
||
export default class AdminVisibilityControlsComponent extends Component { | ||
@service fetch; | ||
@tracked visibilitySettings = [ | ||
// { name: 'Dashboard', route: 'operations.orders', visible: true }, | ||
{ name: 'Products', route: 'products', visible: true }, | ||
{ name: 'Warehouses', route: 'warehouses', visible: true }, | ||
{ name: 'Suppliers', route: 'suppliers', visible: true }, | ||
{ name: 'Inventory', route: 'inventory', visible: true }, | ||
{ name: 'Sales Orders', route: 'sales-orders', visible: true }, | ||
{ name: 'Purchase Orders', route: 'purchase-orders', visible: true }, | ||
{ name: 'Audits', route: 'audits', visible: true }, | ||
{ name: 'Reports', route: 'reports', visible: true }, | ||
]; | ||
@tracked isLoading = false; | ||
|
||
constructor() { | ||
super(...arguments); | ||
this.loadVisibilitySettings(); | ||
} | ||
|
||
@action mutateVisibility(route, visible) { | ||
this.visibilitySettings = [...this.visibilitySettings].map((visibilityControl) => { | ||
if (visibilityControl.route === route) { | ||
return { | ||
...visibilityControl, | ||
visible, | ||
}; | ||
} | ||
|
||
return visibilityControl; | ||
}); | ||
} | ||
|
||
@action loadVisibilitySettings() { | ||
this.isLoading = true; | ||
|
||
this.fetch | ||
.get('pallet/settings/visibility') | ||
.then(({ visibilitySettings }) => { | ||
if (isArray(visibilitySettings)) { | ||
for (let i = 0; i < visibilitySettings.length; i++) { | ||
const visibilityControl = visibilitySettings.objectAt(i); | ||
this.mutateVisibility(visibilityControl.route, visibilityControl.visible); | ||
} | ||
} | ||
}) | ||
.catch((error) => { | ||
this.notifications.serverError(error); | ||
}) | ||
.finally(() => { | ||
this.isLoading = false; | ||
}); | ||
} | ||
|
||
@action saveVisibilitySettings() { | ||
this.isLoading = true; | ||
|
||
this.fetch | ||
.post('pallet/settings/visibility', { visibilitySettings: this.visibilitySettings }) | ||
.then(({ visibilitySettings }) => { | ||
if (isArray(visibilitySettings)) { | ||
for (let i = 0; i < visibilitySettings.length; i++) { | ||
const visibilityControl = visibilitySettings.objectAt(i); | ||
this.mutateVisibility(visibilityControl.route, visibilityControl.visible); | ||
} | ||
} | ||
}) | ||
.catch((error) => { | ||
this.notifications.serverError(error); | ||
}) | ||
.finally(() => { | ||
this.isLoading = false; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Controller from '@ember/controller'; | ||
|
||
export default class AdminProductCategoryController extends Controller {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.