These are chat archives for reactioncommerce/reaction

24th
Feb 2016
Spencer Norman
@spencern
Feb 24 2016 00:09

One more layout/workflow related question:

I’m getting this error: "Failed to render layout coreLayout coreRentalWorkflow”…

It’s spawning from a workflow that looks like this, defined in a package

  layout: [{
    workflow: 'coreRentalWorkflow',
    layout: 'coreAdminLayout',
    theme: 'default',
    enabled: true,
    structure: {
      template: 'rentalShopSettings',
      layoutHeader: 'layoutHeader',
      layoutFooter: '',
      notFound: 'notFound',
      dashboardHeader: 'dashboardHeader',
      dashboardControls: 'accountsDashboardControls',
      dashboardHeaderControls: '',
      adminControlsFooter: 'adminControlsFooter'
    }
  }]

I’m then trying to use this workflow in a provides: dashboard registry entry like so

{
    route: '/dashboard/rentalProducts',
    provides: 'dashboard',
    name: 'rentalProducts',
    label: 'Rental Products',
    description: 'Enables rental products for your shop',
    icon: 'fa fa-calendar',
    container: 'getoutfitted',
    template: 'rentalShopSettings',
    workflow: 'coreRentalWorkflow',
    priority: 1
  }

I’ve also added this to the layout section of the current shop

It seems like the error is because it’s trying to find a workflow/layout combo that is coreRentalWorkflow + coreLayout, but this workflow is defined as coreRentalWorkflow + coreAdminLayout
Spencer Norman
@spencern
Feb 24 2016 00:33
of note, If I change my workflow to use the layout coreWorkflow instead of coreAdminWorkflow it works fine.
elkridgelodge
@elkridgelodge
Feb 24 2016 01:34
What might have changed from a month ago that overridden templates' javascript now applies to my template overrides?
I can see the templates from a custom workflow. The old javascript still applies pushing the wrong workflows
Aaron Judd
@aaronjudd
Feb 24 2016 07:19
@spencern try layout: coreAdminLayout on the registry entry? - I think we’re defaulting to coreLayout if you don’t define..
@elkridgelodge not sure, a lot has changed with v0.12 vs 0.11 but not a lot of the template themselves have changed, however -> most of the template move into new packages and now need subscriptions. I’d have to see a more specific case to really help out
Spencer Norman
@spencern
Feb 24 2016 07:25
I did try that and no dice on it. Looking here https://github.com/reactioncommerce/reaction/blob/development/packages/reaction-router/common/init.js#L76-L115 I didn’t see anywhere that the layout was ever defined, so perhaps it’s always defaulting to coreLayout?
Maged Eladawy
@meladawy
Feb 24 2016 07:30
Yea i was just going to ask you about the workflow :-/
i believe u are now discussing this but i'm not sure even i still understand whats going on :-/
when i search for "coreAccountsWorkflow", i found that its only defined in register.js files but i didn't find any other code related to this
so i still don't know why you added this inside register.js
trying to figure out what "Workflow" is ! and why we add it to register file :-/
Spencer Norman
@spencern
Feb 24 2016 07:35
@meladawy - here’s a primer on workflow https://docs.reactioncommerce.com/reaction-docs/master/workflow
Maged Eladawy
@meladawy
Feb 24 2016 07:54
Yea i had a look on this before but i didn't actually understand :D...i'll giv it one more try
Maged Eladawy
@meladawy
Feb 24 2016 08:12
@spencern so the layout is a collection of templates are displayed based on the current workflow status ?
like in checkout process ?
elkridgelodge
@elkridgelodge
Feb 24 2016 09:37
@meladawy there's pushCartWorkflow methods that check to make sure you can be in that workflow status, push your workflow status to the next status. that's what sets the template, yes
it only sets the templates you've associated with your custom workflow or are defined in the core workflow
elkridgelodge
@elkridgelodge
Feb 24 2016 09:45
@aaronjudd I can hack on core file reaction-checkout/client/templates/cart/checkout/checkout.js to tell it to use a custom workflow and set my replacement step for 'checkoutLogin' just fine
but what actually works is that i can see my custom progress bar with custom steps but it's grey not blue and it's actually using the reaction-checkout checkout.js file not my .js file
so it's pushing through a core workflow not a custom one. mainly i just removed this file from being included in the package https://github.com/elkridgelodge/sip-workflow/blob/master/common/router.js (it's still there for reference)
this is changes from .10.0 to .12.0
it's probably me being an idiot but i don't see why these .js files aren't being used at all
elkridgelodge
@elkridgelodge
Feb 24 2016 09:54
oh, should i not be using template-overrides.js anymore because FlowRouter?
nope, i don't see it
Maged Eladawy
@meladawy
Feb 24 2016 10:33
@elkridgelodge Thank u, it clear nw !
Guys how to call loadPackages function when changes made to register.js file
can we call loadPackages function on Meteor.startup ?
Maged Eladawy
@meladawy
Feb 24 2016 10:38
because each time i make some changes to register.js i have to remove and install the package again to reload the new register.js file !
elkridgelodge
@elkridgelodge
Feb 24 2016 11:43
meladawy: one thing you can do is stop meteor while you make the edits so it won't keep reloading
other than that i just start it like normal after i make the edits
Maged Eladawy
@meladawy
Feb 24 2016 13:21
@elkridgelodge yea so if you made any changes in server/register.js file while meteor is working it doesn't take any effect untill you remove the package and install it again right ?
elkridgelodge
@elkridgelodge
Feb 24 2016 13:22
meladawy: i'm not sure, i thought it was that way a few weeks ago but then i saw meteor reloading recently. i have no idea honestly
Maged Eladawy
@meladawy
Feb 24 2016 13:27
when i make any changes in register.js file meteor is actually reloaded but ReactionRegistry.loadPackages() doesn't be called. ReactionRegistry.loadPackages() should be called after each update in any server/register.js file because ReactionRegistry.loadPackages() is responsible for loading register files in the database and without calling this function old registers will be displayed
so if you changed the dashboard item name inside register.js file it doesn't take effect until ReactionRegistry.loadPackages() is called
Spencer Norman
@spencern
Feb 24 2016 16:17
@meladawy, I know that this is something that the core reaction team is working on, but right now you have to manually reset the package when you update the registry.
Maged Eladawy
@meladawy
Feb 24 2016 19:45
is there any command for reset or just to un&&install it again
Mike Murray
@mikemurray
Feb 24 2016 21:52
@meladawy meteor reset
Alex Hoffmann
@ahoff314
Feb 24 2016 22:39
Is there an issue with removing tags from the navbar? Cannot seem to remove them via tiny 'x' in edit mode
Mike Murray
@mikemurray
Feb 24 2016 22:41
@ahoff314 seems you're right. probably a simple callback issue at the top level.
@ahoff314 added an issue: reactioncommerce/reaction#817
Alex Hoffmann
@ahoff314
Feb 24 2016 22:46
Awesome, thank you