These are chat archives for reactioncommerce/reaction

29th
Oct 2015
Tom De Caluwé
@tdecaluwe
Oct 29 2015 10:27
Can I prevent reaction-core from loading fixture data on first startup? I'd like to provide my own fixture data. It seems I can't get this to work and I'm not sure how to understand the docs...
SharathKS
@SharathKS
Oct 29 2015 10:37
This message was deleted
bankim
@bankim
Oct 29 2015 10:40
Hello, I am trying to customize the template but it is not working. I have created one template and trying to use it in layout.html file instead of region="layoutHeader" but not reflecting any changes on this. Can anyone please help me on this how to use custom template in reactioncommerce? Thanks.
SharathKS
@SharathKS
Oct 29 2015 10:42
Hi,
I am trying to customize reaction-core package, but having few errors from package.
Is it possible to customize reaction-core?
bankim
@bankim
Oct 29 2015 10:47
Hi Sharath, could you please elaborate your query?
SharathKS
@SharathKS
Oct 29 2015 10:52

@bankim
Error: Cannot find module 'faker'
W20151029-16:00:57.962(5.5)? (STDERR) at Function.Module._resolveFilename (module.js:338:15)
W20151029-16:00:57.962(5.5)? (STDERR) at Function.Module._load (module.js:280:25)
W20151029-16:00:57.962(5.5)? (STDERR) at Module.require (module.js:364:17)
W20151029-16:00:57.962(5.5)? (STDERR) at require (module.js:380:17)
W20151029-16:00:57.962(5.5)? (STDERR) at Object.Npm.require

This is the error i am facing while customizing reaction-core.
FYI:
I have cloned reaction package and tried to loose dependency of "reactioncommerce:core" as package but adding source code directly to respective package.
Thanks.

Aaron Judd
@aaronjudd
Oct 29 2015 15:34
@tdecaluwe the fixtures load from core/private/data/Shops.json (and others), which you could customize but if you are not doing any other customization with core - this wouldn't be ideal. The loadData function in core/server/fixtures.js is what you want to take a look at - it prevents you from loading additional fixture data if the collection already has data, but you could reuse that function in the app level code if you wanted to load data fixtures at the app level, maybe you can do this before core runs, or at least use a similar method to update the default shop fixture with your own data set.
@SharathKS made a recent change to how faker is being implemented (used just for tests, and not actually common code anymore). This required a change in reaction-accounts as well, so if you are using the development branch, make sure that you also have the development branch of the other reaction packages cloned locally into a PACKAGE_DIRS. See: https://github.com/reactioncommerce/reaction/blob/development/docs/developer/packages.md#core-packages - my first suspicion is that error is from reaction-acounts, or some other npm failure.
Spencer Norman
@spencern
Oct 29 2015 20:12
Hey guys - having trouble extending/replacing the variantForm template. Specifically when I extend this template, products/updateVariantisn’t firing for some reason.
https://github.com/reactioncommerce/reaction-core/blob/development/client/templates/products/productDetail/variants/variantForm/variantForm.js#L65-L71
Template.variantForm.events({
  "change form :input": function (event, template) {
    let formId;
    formId = "#variant-form-" + template.data._id;
    template.$(formId).submit();
    setCurrentVariant(template.data._id);
  },
I can verify that this change event is firing, but not sure how exactly this update gets submitted to the server. I can fire the template.$(formId).submit() function and it doesn’t error, but it also doesn’t update any data on the server.
This is from a template (rentalVariantForm) that replaces variantForm - all of my other template replaces are working fine and events/helpers are still working properly.
Aaron Judd
@aaronjudd
Oct 29 2015 20:19
nice easy questions.. please :eyes:
it looks to me that the event you want is "change .child-variant-form :input”: that this change form :input is just setting the currentVariant for reference. https://github.com/reactioncommerce/reaction-core/blob/65316d7f99fb8855e4012c1221afe9e8d7539572/client/templates/products/productDetail/variants/variantForm/childVariant/childVariant.js#L64
Spencer Norman
@spencern
Oct 29 2015 20:24
lol, sorry for the tough ones. The child variant input works fine when replaced, but is actually a different template. Controls the child variants rather than the top level variants
Spencer Norman
@spencern
Oct 29 2015 20:27
Ah, good thought. Perhaps because I don’t have auto-form in my package
Aaron Judd
@aaronjudd
Oct 29 2015 20:27
well it should be implied by core, so you should have it.. but maybe
Spencer Norman
@spencern
Oct 29 2015 20:29
It is implied by core, and adding it did not work, so not sure then.
That does appear to be the difference between variantForm and childVariant though
Aaron Judd
@aaronjudd
Oct 29 2015 20:30
did you give your auto form an unique id? id=variantFormId
Spencer Norman
@spencern
Oct 29 2015 20:31
I left everything identical to the variant form that was inherited, but swap one field currently
and by inherited I mean replace
{{#autoForm schema="ReactionCore.Schemas.RentalProductVariant" doc=. type="method" meteormethod="products/updateVariant" id=variantFormId validation="keyup" resetOnSuccess=false}}
That appears to be working fine though, as the generated html has the id
I might just need to rip out autofom in this one and replace with a standard form a la childVariant
Aaron Judd
@aaronjudd
Oct 29 2015 20:34
well the form is the one responsible for the updateVariant, so I guess you could debug the auto form AutoForm.debug(); in the console, before you try submitting to see if you get any more info
Spencer Norman
@spencern
Oct 29 2015 20:36
ah, super helpful, thanks. I didn’t know about AutoForm.debug() before
was removing a required field (price) for pricePerDay which caused a schema Validation error
Thanks for the help, sorry to bug :eyes:
Ryan
@allpoolspa
Oct 29 2015 23:13
I am having an issue with the newest reaction-core 0.9.4. reaction works fine but when I have reaction-core cloned into my packages, only 0.9.3 works. Is anyone else having this issue?
Spencer Norman
@spencern
Oct 29 2015 23:14
I haven’t updated to 0.9.4 yet. Tomorrow is ‘merge day’ here so we will be upgrading then. Also haven’t updated to Meteor 1.2.1 yet
Ryan
@allpoolspa
Oct 29 2015 23:18
Ok. Ya I just updated both and I have to go back to this "aae6e206788ce82bdc1f88bf5275d2c90dfd9bad" commit to get everything to run.
reactioncommerce/reaction-core@aae6e20