Skip to content

Commit

Permalink
fix transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Dec 23, 2024
1 parent 73033b6 commit b343c62
Show file tree
Hide file tree
Showing 29 changed files with 88 additions and 94 deletions.
8 changes: 4 additions & 4 deletions addon/controllers/inventory/expired-stock.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export default class InventoryExpiredStockController extends Controller {
* @void
*/
@action viewInventory(inventory) {
return this.transitionToRoute('inventory.index.details', inventory);
return this.hostRouter.transitionTo('console.pallet.inventory.index.details', inventory);
}

/**
Expand All @@ -272,11 +272,11 @@ export default class InventoryExpiredStockController extends Controller {
* @void
*/
@action createInventory() {
return this.transitionToRoute('inventory.index.new');
return this.hostRouter.transitionTo('console.pallet.inventory.index.new');
}

@action makeStockAdjustment() {
return this.transitionToRoute('inventory.index.new-stock-adjustment');
return this.hostRouter.transitionTo('console.pallet.inventory.index.new-stock-adjustment');
}

/**
Expand All @@ -287,6 +287,6 @@ export default class InventoryExpiredStockController extends Controller {
* @void
*/
@action async editInventory(inventory) {
return this.transitionToRoute('inventory.index.edit', inventory);
return this.hostRouter.transitionTo('console.pallet.inventory.index.edit', inventory);
}
}
8 changes: 4 additions & 4 deletions addon/controllers/inventory/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export default class InventoryIndexController extends Controller {
* @void
*/
@action viewInventory(inventory) {
return this.transitionToRoute('inventory.index.details', inventory.public_id);
return this.hostRouter.transitionTo('console.pallet.inventory.index.details', inventory.public_id);
}

/**
Expand All @@ -280,11 +280,11 @@ export default class InventoryIndexController extends Controller {
* @void
*/
@action createInventory() {
return this.transitionToRoute('inventory.index.new');
return this.hostRouter.transitionTo('console.pallet.inventory.index.new');
}

@action makeStockAdjustment() {
return this.transitionToRoute('inventory.index.new-stock-adjustment');
return this.hostRouter.transitionTo('console.pallet.inventory.index.new-stock-adjustment');
}

/**
Expand All @@ -295,6 +295,6 @@ export default class InventoryIndexController extends Controller {
* @void
*/
@action async editInventory(inventory) {
return this.transitionToRoute('inventory.index.edit', inventory);
return this.hostRouter.transitionTo('console.pallet.inventory.index.edit', inventory);
}
}
4 changes: 2 additions & 2 deletions addon/controllers/inventory/index/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class InventoryIndexDetailsController extends Controller {
* @returns {Transition} The transition object representing the route change.
*/
@action transitionBack() {
return this.transitionToRoute('inventory.index');
return this.hostRouter.transitionTo('console.pallet.inventory.index');
}

/**
Expand All @@ -42,7 +42,7 @@ export default class InventoryIndexDetailsController extends Controller {
* @returns {Transition} The transition object representing the route change.
*/
@action onEdit(inventory) {
return this.transitionToRoute('inventory.index.edit', inventory);
return this.hostRouter.transitionTo('console.pallet.inventory.index.edit', inventory);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions addon/controllers/inventory/index/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export default class InventoryIndexEditController extends Controller {
return this.confirmContinueWithUnsavedChanges(inventory, {
confirm: () => {
inventory.rollbackAttributes();
return this.transitionToRoute('inventory.index');
return this.hostRouter.transitionTo('console.pallet.inventory.index');
},
});
}

return this.transitionToRoute('inventory.index');
return this.hostRouter.transitionTo('console.pallet.inventory.index');
}

/**
Expand All @@ -67,7 +67,7 @@ export default class InventoryIndexEditController extends Controller {
return this.confirmContinueWithUnsavedChanges(inventory);
}

return this.transitionToRoute('inventory.index.details', inventory);
return this.hostRouter.transitionTo('console.pallet.inventory.index.details', inventory);
}

/**
Expand All @@ -83,7 +83,7 @@ export default class InventoryIndexEditController extends Controller {
}

this.hostRouter.refresh();
return this.transitionToRoute('inventory.index.details', inventory);
return this.hostRouter.transitionTo('console.pallet.inventory.index.details', inventory);
}

/**
Expand All @@ -102,7 +102,7 @@ export default class InventoryIndexEditController extends Controller {
acceptButtonText: 'Continue without saving',
confirm: () => {
inventory.rollbackAttributes();
return this.transitionToRoute('inventory.index.details', inventory);
return this.hostRouter.transitionTo('console.pallet.inventory.index.details', inventory);
},
...options,
});
Expand Down
4 changes: 2 additions & 2 deletions addon/controllers/inventory/index/new-stock-adjustment.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class InventoryIndexNewStockAdjustmentController extends Controll
* @memberof InventoryIndexNewStockAdjustmentController
*/
@action transitionBack() {
return this.transitionToRoute('inventory.index');
return this.hostRouter.transitionTo('console.pallet.inventory.index');
}

/**
Expand All @@ -72,7 +72,7 @@ export default class InventoryIndexNewStockAdjustmentController extends Controll
}

this.hostRouter.refresh();
return this.transitionToRoute('inventory.index');
return this.hostRouter.transitionTo('console.pallet.inventory.index');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions addon/controllers/inventory/index/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class InventoryIndexNewController extends Controller {
* @memberof InventoryIndexNewController
*/
@action transitionBack() {
return this.transitionToRoute('inventory.index');
return this.hostRouter.transitionTo('console.pallet.inventory.index');
}

/**
Expand All @@ -76,7 +76,7 @@ export default class InventoryIndexNewController extends Controller {
}

this.hostRouter.refresh();
return this.transitionToRoute('inventory.index.details', inventory).then(() => {
return this.hostRouter.transitionTo('console.pallet.inventory.index.details', inventory).then(() => {
this.resetForm();
});
}
Expand Down
8 changes: 4 additions & 4 deletions addon/controllers/inventory/low-stock.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export default class InventoryLowStockController extends Controller {
* @void
*/
@action viewInventory(inventory) {
return this.transitionToRoute('inventory.index.details', inventory);
return this.hostRouter.transitionTo('console.pallet.inventory.index.details', inventory);
}

/**
Expand All @@ -271,11 +271,11 @@ export default class InventoryLowStockController extends Controller {
* @void
*/
@action createInventory() {
return this.transitionToRoute('inventory.index.new');
return this.hostRouter.transitionTo('console.pallet.inventory.index.new');
}

@action makeStockAdjustment() {
return this.transitionToRoute('inventory.index.new-stock-adjustment');
return this.hostRouter.transitionTo('console.pallet.inventory.index.new-stock-adjustment');
}

/**
Expand All @@ -286,6 +286,6 @@ export default class InventoryLowStockController extends Controller {
* @void
*/
@action async editInventory(inventory) {
return this.transitionToRoute('inventory.index.edit', inventory);
return this.hostRouter.transitionTo('console.pallet.inventory.index.edit', inventory);
}
}
6 changes: 3 additions & 3 deletions addon/controllers/products/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export default class ProductsIndexController extends Controller {
* @void
*/
@action viewProduct(product) {
return this.transitionToRoute('products.index.details', product);
return this.hostRouter.transitionTo('console.pallet.products.index.details', product);
}

/**
Expand All @@ -345,7 +345,7 @@ export default class ProductsIndexController extends Controller {
* @void
*/
@action createProduct() {
return this.transitionToRoute('products.index.new');
return this.hostRouter.transitionTo('console.pallet.products.index.new');
}
/**
* Edit a `product` details
Expand All @@ -355,7 +355,7 @@ export default class ProductsIndexController extends Controller {
* @void
*/
@action async editProduct(product) {
return this.transitionToRoute('products.index.edit', product);
return this.hostRouter.transitionTo('console.pallet.products.index.edit', product);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions addon/controllers/products/index/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class ProductsIndexDetailsController extends Controller {
* @returns {Transition} The transition object representing the route change.
*/
@action transitionBack() {
return this.transitionToRoute('products.index');
return this.hostRouter.transitionTo('console.pallet.products.index');
}

/**
Expand All @@ -39,7 +39,7 @@ export default class ProductsIndexDetailsController extends Controller {
* @returns {Transition} The transition object representing the route change.
*/
@action onEdit(product) {
return this.transitionToRoute('products.index.edit', product);
return this.hostRouter.transitionTo('console.pallet.products.index.edit', product);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions addon/controllers/products/index/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ export default class ProductsIndexEditController extends Controller {
return this.confirmContinueWithUnsavedChanges(product, {
confirm: () => {
product.rollbackAttributes();
return this.transitionToRoute('products.index');
return this.hostRouter.transitionTo('console.pallet.products.index');
},
});
}

return this.transitionToRoute('products.index');
return this.hostRouter.transitionTo('console.pallet.products.index');
}

/**
Expand All @@ -68,7 +68,7 @@ export default class ProductsIndexEditController extends Controller {
return this.confirmContinueWithUnsavedChanges(product);
}

return this.transitionToRoute('products.index.details', product);
return this.hostRouter.transitionTo('console.pallet.products.index.details', product);
}

/**
Expand All @@ -84,7 +84,7 @@ export default class ProductsIndexEditController extends Controller {
}

this.hostRouter.refresh();
return this.transitionToRoute('products.index.details', product);
return this.hostRouter.transitionTo('console.pallet.products.index.details', product);
}

/**
Expand All @@ -103,7 +103,7 @@ export default class ProductsIndexEditController extends Controller {
acceptButtonText: 'Continue without saving',
confirm: () => {
product.rollbackAttributes();
return this.transitionToRoute('products.index.details', product);
return this.hostRouter.transitionTo('console.pallet.products.index.details', product);
},
...options,
});
Expand Down
4 changes: 2 additions & 2 deletions addon/controllers/products/index/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class ProductsIndexNewController extends Controller {
* @memberof ProductsIndexNewController
*/
@action transitionBack() {
return this.transitionToRoute('products.index');
return this.hostRouter.transitionTo('console.pallet.products.index');
}

/**
Expand All @@ -72,7 +72,7 @@ export default class ProductsIndexNewController extends Controller {
}

this.hostRouter.refresh();
return this.transitionToRoute('products.index.details', product).then(() => {
return this.hostRouter.transitionTo('console.pallet.products.index.details', product).then(() => {
this.resetForm();
});
}
Expand Down
6 changes: 3 additions & 3 deletions addon/controllers/purchase-orders/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export default class PurchaseOrdersIndexController extends Controller {
* @void
*/
@action viewPurchaseOrder(purchaseOrder) {
this.transitionToRoute('purchase-orders.index.details', purchaseOrder);
this.hostRouter.transitionTo('console.pallet.purchase-orders.index.details', purchaseOrder);
}

/**
Expand All @@ -239,7 +239,7 @@ export default class PurchaseOrdersIndexController extends Controller {
* @void
*/
@action createPurchaseOrder() {
this.transitionToRoute('purchase-orders.index.new');
this.hostRouter.transitionTo('console.pallet.purchase-orders.index.new');
}

/**
Expand All @@ -249,7 +249,7 @@ export default class PurchaseOrdersIndexController extends Controller {
* @void
*/
@action editPurchaseOrder(purchaseOrder) {
this.transitionToRoute('purchase-orders.index.edit', purchaseOrder);
this.hostRouter.transitionTo('console.pallet.purchase-orders.index.edit', purchaseOrder);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions addon/controllers/purchase-orders/index/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class PurchaseOrdersIndexDetailsController extends Controller {
* @returns {Transition} The transition object representing the route change.
*/
@action transitionBack() {
return this.transitionToRoute('purchase-orders.index');
return this.hostRouter.transitionTo('console.pallet.purchase-orders.index');
}

/**
Expand All @@ -42,7 +42,7 @@ export default class PurchaseOrdersIndexDetailsController extends Controller {
* @returns {Transition} The transition object representing the route change.
*/
@action onEdit(purchaseOrder) {
return this.transitionToRoute('purchase-orders.index.edit', purchaseOrder);
return this.hostRouter.transitionTo('console.pallet.purchase-orders.index.edit', purchaseOrder);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions addon/controllers/purchase-orders/index/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export default class PurchaseOrdersIndexEditController extends Controller {
return this.confirmContinueWithUnsavedChanges(purchaseOrder, {
confirm: () => {
purchaseOrder.rollbackAttributes();
return this.transitionToRoute('purchase-orders.index');
return this.hostRouter.transitionTo('console.pallet.purchase-orders.index');
},
});
}

return this.transitionToRoute('purchase-orders.index');
return this.hostRouter.transitionTo('console.pallet.purchase-orders.index');
}

/**
Expand All @@ -67,7 +67,7 @@ export default class PurchaseOrdersIndexEditController extends Controller {
return this.confirmContinueWithUnsavedChanges(purchaseOrder);
}

return this.transitionToRoute('purchase-orders.index.details', purchaseOrder);
return this.hostRouter.transitionTo('console.pallet.purchase-orders.index.details', purchaseOrder);
}

/**
Expand All @@ -83,7 +83,7 @@ export default class PurchaseOrdersIndexEditController extends Controller {
}

this.hostRouter.refresh();
return this.transitionToRoute('purchase-orders.details', purchaseOrder);
return this.hostRouter.transitionTo('console.pallet.purchase-orders.details', purchaseOrder);
}

/**
Expand All @@ -102,7 +102,7 @@ export default class PurchaseOrdersIndexEditController extends Controller {
acceptButtonText: 'Continue without saving',
confirm: () => {
purchaseOrder.rollbackAttributes();
return this.transitionToRoute('purchase-orders.index.details', purchaseOrder);
return this.hostRouter.transitionTo('console.pallet.purchase-orders.index.details', purchaseOrder);
},
...options,
});
Expand Down
4 changes: 2 additions & 2 deletions addon/controllers/purchase-orders/index/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class PurchaseOrdersIndexNewController extends Controller {
* @memberof PurchaseOrdersIndexNewController
*/
@action transitionBack() {
return this.transitionToRoute('purchase-orders.index');
return this.hostRouter.transitionTo('console.pallet.purchase-orders.index');
}

/**
Expand All @@ -79,7 +79,7 @@ export default class PurchaseOrdersIndexNewController extends Controller {
}

this.hostRouter.refresh();
return this.transitionToRoute('purchase-orders.index.details', purchaseOrder).then(() => {
return this.hostRouter.transitionTo('console.pallet.purchase-orders.index.details', purchaseOrder).then(() => {
this.resetForm();
});
}
Expand Down
Loading

0 comments on commit b343c62

Please sign in to comment.