These are chat archives for reactioncommerce/reaction

24th
Jun 2016
Eric Jonas
@ericmachine88
Jun 24 2016 01:53
@aaronjudd how about drop shipping? say my customer makes a purchase, a new purchase order is forwarded to my merchant which they can accept in the UI? (instead of just am email). Is that something out of the box?
Himanshu Aggarwal
@haggarwal90
Jun 24 2016 05:28

Hi
I want to update user role when user click on continue as guest

i m doing like below on "click .continue-guest"

Meteor.users.update(Meteor.userId(), {$set:data});

but i m geeting access denied error
i understand that i cant update user collection from client java script
so any advise how to update user role on click of 'Continue as guest'
Himanshu Aggarwal
@haggarwal90
Jun 24 2016 05:35
@Brent : any help here?
Valery Orloff
@valorloff
Jun 24 2016 06:22
maybe, need call server update method
Himanshu Aggarwal
@haggarwal90
Jun 24 2016 06:22
which method? method name plz
Valery Orloff
@valorloff
Jun 24 2016 06:23
ReactionCore.users.update
Brent Hoover
@zenweasel
Jun 24 2016 06:24
@haggarwal90 Sorry I didn’t see your mention because that’s not my handle
I’m not sure I understand exactly what you are trying to do
Valery Orloff
@valorloff
Jun 24 2016 06:25
@zenweasel , maybe you help me ))
Himanshu Aggarwal
@haggarwal90
Jun 24 2016 06:29
@zenweasel I want to call meteor mongo update on user collection from client javasciprt. Client javascript is inline.js
Brent Hoover
@zenweasel
Jun 24 2016 06:30
@valorloff Try adding logging output to layout.js. That’s where most of the logic for finding layouts is. You can see what record it’s trying (and failing) to find.
@haggarwal90 Right. You can’t do that. You need to have server-side code that modifies a Mongo collections. Mostly you have Meteor.methods.
Valery Orloff
@valorloff
Jun 24 2016 06:36
such error appears in other places:
Uncaught TypeError: Cannot read property 'structure' of undefined reactioncommerce_reaction-router.js:533 Uncaught TypeError:
Brent Hoover
@zenweasel
Jun 24 2016 06:37
Right. But we want to know what record it is looking for. That error is just symptom of not looking for the correct record
Valery Orloff
@valorloff
Jun 24 2016 06:43
What methods of logging output do you use? best practice?
Brent Hoover
@zenweasel
Jun 24 2016 06:44
Usually just old school console.log for temporary debugging. Or ReactionCore.Logger for permanent logging
Himanshu Aggarwal
@haggarwal90
Jun 24 2016 06:57
thnaks. for now its working.
Valery Orloff
@valorloff
Jun 24 2016 07:36
@zenweasel
newLayout defined, fallbackLayout is undefined
James Scaggs
@jamesscaggs
Jun 24 2016 08:08
@aaronjudd thx for clarifying
Valery Orloff
@valorloff
Jun 24 2016 09:12
I figured something: "Cannot read property 'structure' of undefined" appears for first click only, and after next routing to same pages no longer appears,
the order in which newLayout/fallbackLayout defined/undefined happens, can't possible catch....
in my home testing page i have linked tags
<a class="rui tag link" href="{{pathFor "tag" slug=slug}}" data-id="{{_id}}">{{name}}</a>
the first click on it throw above error,
anywhere else need to define the customlayout?
main.js in app, in registry, where else?
James Scaggs
@jamesscaggs
Jun 24 2016 10:00
I’m seeking a sr. developer for a reactioncommerce project, please DM me if interested
Valery Orloff
@valorloff
Jun 24 2016 10:54
click to href="{{pathFor "tag" in myCustom homepage leads to search pathFor helper? i add
ReactionRouter = FlowRouter; ReactionRouter.pathFor = pathFor = (path, options = {}) => {, but now
"FlowRouter is not defined",
how to make router global?
Ed
@htmelvis
Jun 24 2016 15:28
Good afternoon guys, new to reaction just playing around pretty awesome so far!
Valery Orloff
@valorloff
Jun 24 2016 15:57
good evening )
Valery Orloff
@valorloff
Jun 24 2016 16:34
layout.js:
let newLayout = shop.layout.reverse().find((x) => selectLayout(x, layout, workflow));
what is "X" ?
How it's works?
at this point layout and workflow values defined and expected, but newLayout i have undefined, what is wrong?
hrath2015
@hrath2015
Jun 24 2016 16:47
@valorloff it searches from Shop.layout the values u passed as options to ReactionLayout() method
If no value is passed then it will look for default values layout =coreLayout and workflow=coreWorkflow
Valery Orloff
@valorloff
Jun 24 2016 16:50
what is x?
hrath2015
@hrath2015
Jun 24 2016 16:50
It will pick the one from many in shop layout
Valery Orloff
@valorloff
Jun 24 2016 16:51
what criterion search?
selectLayout return single name of layout
is not it be like
db.collection.find( { query } ) ?
Valery Orloff
@valorloff
Jun 24 2016 16:56
if i have correct layout and workflow, why newLayout is undefined?
hrath2015
@hrath2015
Jun 24 2016 16:58
is this returned by the const newLayout = shop.layout.find((x) => selectLayout(x, layout, workflow)) code
if not then u may have to do reset and reload
Give me 2 min I started my local installation
hrath2015
@hrath2015
Jun 24 2016 17:08
To debug please run on browser console in sequence
  1. selectLayout = (layout, setLayout, setWorkflow) => {
console.log("layout in shop:",layout);
console.log("To ckeck layout:",setLayout,"workflow", setWorkflow);
const currentLayout = setLayout || "coreLayout";
const currentWorkflow = setWorkflow || "coreWorkflow";
if (layout.layout === currentLayout && layout.workflow === currentWorkflow && layout.enabled === true) {
return layout;
}
}
  1. shop = ReactionCore.Collections.Shops.findOne(ReactionCore.getShopId())
3.newLayout = shop.layout.find((x) => selectLayout(x, "coreLayout", "coreWorkflow"))
if layout is available in db then it will return else null or undefined
hrath2015
@hrath2015
Jun 24 2016 17:15
please replace your layout and workflow what u are looking for in step 3
Spencer Norman
@spencern
Jun 24 2016 20:05

RC Team, nice work on getting module-structure published, looks like a huge undertaking. :clap: Now those of us with production shops get the joy of upgrading our shops to fit the new structure. :smile:

Are there any other big changes we should anticipate coming or is it fairly safe to pull this down and begin the process of merging our project in?

Aaron Judd
@aaronjudd
Jun 24 2016 20:09
I feel like we’ve hammered it a lot during the restructuring, but fully expect to have to make some changes for some unexpected (or forgotten) use cases that you might find during the upgrade. However, I feel like the over all structure is solid and ready to be built on. The two big caveats, we’re still finishing the payment method migrations, and working on a way for the (any new) imports/plugins to import without modifying code in the app.
so if you start moving things into imports (as you should), be aware that the two client/main.js and server/main.js will get an update in the near future.
Spencer Norman
@spencern
Jun 24 2016 20:11
:+1:
Are payment packages working right now at all or not yet?
Aaron Judd
@aaronjudd
Jun 24 2016 20:12
our theory is that you should be able to contain all custom code in either custom or imports/plugins/custom.
the paypal and stripe packages are “working"
but the “order/completed” is broken
Spencer Norman
@spencern
Jun 24 2016 20:12
oh :/
Aaron Judd
@aaronjudd
Jun 24 2016 20:12
but that’s on my list for today .. it was docs vs payments ;-)
Spencer Norman
@spencern
Jun 24 2016 20:12
nice
are docs out?
Aaron Judd
@aaronjudd
Jun 24 2016 20:13
yup, updated
Spencer Norman
@spencern
Jun 24 2016 20:13
outstanding
What’s the plan for additional plugins that also require imports?
Looks like current imports aren’t really self-contained
goes to read docs
Aaron Judd
@aaronjudd
Jun 24 2016 20:15
well, even though I’ve updated the docs. I’m working on more “here’s how we’re going to do this” doc.. (the customization guide is not updated)
Spencer Norman
@spencern
Jun 24 2016 20:15
ok, cool
Aaron Judd
@aaronjudd
Jun 24 2016 20:18
that said, all questions will lead to further explanation in the docs.. so ask away. the concept on the plugins:
imports/plugins/core will always exist and can be dependencies. imports/plugins/included are optional, but will always be distributed even if they are not loaded. imports/plugins/custom should be self-contained or custom modules
other folders, files at the top level of the app, such as client, server,etc should not be altered.. ;-)…...
Spencer Norman
@spencern
Jun 24 2016 20:20
Are you guys building any self-contained modules as examples of how you think it should be done?
hah, yeah understood, easier said than done ;)
Aaron Judd
@aaronjudd
Jun 24 2016 20:21
well, I guess it depends on the definition of self contained.. the payment-methods represent a package in the old sense of that in Meteor.
Spencer Norman
@spencern
Jun 24 2016 20:21
yeah, looking through stripe right now, it’s more self-contained than analytics for example
Where analytics depends on some files in lib/
Aaron Judd
@aaronjudd
Jun 24 2016 20:23
dependencies like
import { AnalyticsEvents, Packages } from "/lib/collections";
import { Reaction, i18next } from "/client/api”;
should be expected to be depended upon, I can see those eventually getting published as npm packages so that you can be truly self-contained, but for now, I’d consider those the equivalent of depending on reaction-core
Spencer Norman
@spencern
Jun 24 2016 20:25
ah, ok
Aaron Judd
@aaronjudd
Jun 24 2016 20:26
the shared lib/collections is akin to reaction-collections, but that doesn’t stop you from depending on a collection in the plugins module itself.
or importing those, changing the behavior, and exporting your own custom version to import in your own modules
Spencer Norman
@spencern
Jun 24 2016 20:40
perfect.