These are chat archives for reactioncommerce/reaction

23rd
Feb 2016
Mike Murray
@mikemurray
Feb 23 2016 00:18
@ScyDev @spencern I can confirm that, at times, onRendered is unreliable if you need to manupulate templates within {{#if}} {{#each}} and other blocks. As @aaronjudd mentioned, onRendered is only fired once, and not when those blocks change because of some reactive event. I agree with @spencern that breaking the templates into smaller ones may yield better results, but your mileage may vary.
Mike Murray
@mikemurray
Feb 23 2016 00:26
@spencern Yes, we do plan on showing you a better summary, just havn't gotten around to that yet. Added this ticket as a reminder: reactioncommerce/reaction#807
Mike Murray
@mikemurray
Feb 23 2016 00:41

@spencern as for theme docs, well... theming in general is taking a different turn. My grand scheme for themeing is not just some CSS classes strapped to some DOM element, but full components (html, css, and js) and define their own styles and make use of some global variables from bootstrap, for now.

for example, instead of doing <button class="btn btn-default">My Button</button> you do {{> button title="My Button"}} which yields <button class="rui button">My Button</button>. In practice, this means every button everywhere uses the same base html, and if you every wanted to change the class names or structure, you only have to change it in once place.

Reaction UI will define a base set of components, functonality for those components and some generic styles. You could then roll your own themes for them using css/less/stylus/sass/scss/postcss or using the built-in theme editor.

tl;dr theme docs will be out with the next release :smile:

Aesop7
@Aesop7
Feb 23 2016 00:44
Hi, does anyone know if it's possible to easily get a user's email address on the server?
I know that you can get the ID by using Meteor.userID(), but is the email address also accessible? Thanks in advance!
Ah, nevermind I think that I found it... Meteor.user().emails[0].address
Aaron Judd
@aaronjudd
Feb 23 2016 00:47
the email address should be in the Accounts collection, as well
Aesop7
@Aesop7
Feb 23 2016 00:47
Would I have to do a mongo query to get it? Is there a performance difference?
Aaron Judd
@aaronjudd
Feb 23 2016 00:47
server or client?
Aesop7
@Aesop7
Feb 23 2016 00:47
server
*server method
Aaron Judd
@aaronjudd
Feb 23 2016 00:48
this is ok then, but on the client, the fields are restricted
Aesop7
@Aesop7
Feb 23 2016 00:48
:thumbsup: Thanks aaron!
Aaron Judd
@aaronjudd
Feb 23 2016 00:48
:thumbsup:
Owen Hoskins
@owenhoskins
Feb 23 2016 00:52
Hey guys -- wanted to reiterate a questions from earlier: "I am just getting my head around the FlowRouter implementation. Is there a procedure for declaring a route without permissions? I see how permissions are set in the registry, but my custom routes are denying access to anonymous users."
Owen Hoskins
@owenhoskins
Feb 23 2016 00:57
Looking at the registry for reaction-product-simple as an example, the route "product" & "tag" are defined without permissions or audience specified. However, the custom routes I define I can only access while logged in, so I feel like I am missing a piece of the picture.
@owenhoskins what does your registry block look like?
Owen Hoskins
@owenhoskins
Feb 23 2016 01:03
@aaronjudd like so: registry: [{ route: "/feed", name: "feed", template: "feed", workflow: "" },
Aesop7
@Aesop7
Feb 23 2016 01:31
Hey, not sure if anyone can help, but i'm using reaction in a submodule and running into this issue when I try to clone my repo with --recursive fatal: no submodule mapping found in .gitmodules for path 'packages/launchdock-connect'
Aaron Judd
@aaronjudd
Feb 23 2016 01:48
@owenhoskins workflow shouldn’t be included or use the default, “coreWorkflow”, that might be causing an issue
Owen Hoskins
@owenhoskins
Feb 23 2016 01:49
@aaronjudd Testing now, thanks
Owen Hoskins
@owenhoskins
Feb 23 2016 02:01
@aaronjudd Got some results: with "workflow" omitted I get a 404 page and with "workflow": "coreWorkflow" I get a log in prompt. Which is better then a 404.
Aaron Judd
@aaronjudd
Feb 23 2016 02:01
@owenhoskins are you resetting after you make changes to the registry?
( I know this is PiTA, looking to resolve and have packages auto update soon)
Owen Hoskins
@owenhoskins
Feb 23 2016 02:02
@aaronjudd: I cleared the Packages collection
Aaron Judd
@aaronjudd
Feb 23 2016 02:02
k, that should work, and you also need to browser reload to get the routing table to reinit
I’ll test your route in a few minutes, though, see what’s happening
Owen Hoskins
@owenhoskins
Feb 23 2016 02:03
Yeah, hard refreshing and same results. Thanks -- I'd appreciate it!
Aesop7
@Aesop7
Feb 23 2016 02:04
For anyone having the issue with submodules, the following fixed it:
git rm --cached packages/launchdock-connect
git rm --cached packages/reaction-paypal
git rm --cached packages/reaction-stripe
git submodule update --init --recursive
Aaron Judd
@aaronjudd
Feb 23 2016 02:50
@owenhoskins
 "defaultVisitorRole" : [ 
        "anonymous", 
        "guest", 
        "product", 
        "tag", 
        "index", 
        "cart/checkout", 
        "cart/completed"
    ],
add “feed” to this…. in Shops.defaultVisitorRole
guess, we should add a way to add to that from the package -> I’ll look at that as I want to push new layouts into the Shops collection on load as well
so, by default now all routes require some sort of permissions.. you have to explicitly define that it’s public using this array
otherwise, tested your registry declaration locally, and it was fine.. so nothing else to change there...
Aaron Judd
@aaronjudd
Feb 23 2016 02:55
in your case, you probably also want to add to defaultRoles
this is anonymous (defaultVisitorRole) vs registered (defaultRoles)
Owen Hoskins
@owenhoskins
Feb 23 2016 04:04
@aaronjudd Ah ha. So I've added my route to the Shops.defaultVisitorRole AND to the Accounts.onCreateUser handler's defaultVisitorRole. Viola. Thanks!
Sunny Bhattacharjee
@Sunny-Github
Feb 23 2016 04:54
hey aaron ...sunny this side ...
Maged Eladawy
@meladawy
Feb 23 2016 07:44
Hey guys i hav a stupid question. why you are wrapping objects with ${ } wrapper such as this
routeName = `${registryItem.name}`;
rkhunter
@rkhunter
Feb 23 2016 08:24
@zenweasel the original idea is to store multiple reaction shops on single server (financial reason obviously). I want to use HAProxy (nginx analogue). As far as I understand PayPal payment system used in reaction requires SSL
1 - can I decrypt SSL on ha proxy
It's called SSL termination as far as I know
2 - or can it only work if SSL passes through to server?
Brent Hoover
@zenweasel
Feb 23 2016 08:31
We don’t do anything in particular to require encryption. It may depend if you are talking about PayPal express or PayFlow Pro
Even then as long as the client -> server flow was encrypted I believe you should be fine
I have worked a lot with HAProxy but never for HTTP traffic so I can’t give you any more insight on that
rkhunter
@rkhunter
Feb 23 2016 08:35
Alright, I guess I will need to experiment a bit with that. Thank you for reply :smile:
Brent Hoover
@zenweasel
Feb 23 2016 08:36
Yeah, you should be able to test it locally just using a self-signed cert, etc.
Let me know what you find out just so I know next time
rkhunter
@rkhunter
Feb 23 2016 08:38
@zenweasel alright, but i will probably not test it today. I will let you know in any case. Also, it would be nice to have this aspect in docs
Maged Eladawy
@meladawy
Feb 23 2016 09:16
Guys isn't it better to define isReady inside template helpers instead of Template.subscriptionsReady
because i believe fast render can't detect subscriptions from inside the template
Kavish Patel
@thekavish
Feb 23 2016 09:46
Can anyone help me with deploying reactioncommerce files onto the server using Meteor-up. I am getting following error.
✘ Invoking deployment process: FAILED

    -----------------------------------STDERR-----------------------------------
    Warning: Permanently added 'XXX.XXX.XX.XXX' (ECDSA) to the list of known hosts.
    npm WARN excluding symbolic link browser -> dist/browser
    npm WARN deprecated github-flavored-markdown@1.0.1: This project is long out of date. Use 'marked' instead.
    npm WARN deprecated graceful-fs@2.0.3: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
    npm WARN deprecated CSSselect@0.4.1: the module is now available as 'css-select'
    npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'
    npm WARN deprecated tap-assert@0.0.11: use the 'tap' module instead
    npm WARN deprecated tap-producer@0.0.1: This module is not supported. Please use 'tap' instead.
    npm WARN deprecated tap-results@0.0.2: This module is not supported. Please use 'tap' instead.
    -----------------------------------STDOUT-----------------------------------
    -gyp rebuild 2> builderror.log) || (exit 0)

    make: Entering directory `/opt/reaction-app/tmp/bundle/programs/server/npm/cfs_gridfs/node_modules/mongodb/node_modules/kerberos/build'
      CXX(target) Release/obj.target/kerberos/lib/kerberos.o
    make: Leaving directory `/opt/reaction-app/tmp/bundle/programs/server/npm/cfs_gridfs/node_modules/mongodb/node_modules/kerberos/build'

    > bson@0.2.22 install /opt/reaction-app/tmp/bundle/programs/server/npm/cfs_gridfs/node_modules/mongodb/node_modules/bson
    > (node-gyp rebuild 2> builderror.log) || (exit 0)

    make: Entering directory `/opt/reaction-app/tmp/bundle/programs/server/npm/cfs_gridfs/node_modules/mongodb/node_modules/bson/build'
      CXX(target) Release/obj.target/bson/ext/bson.o
      SOLINK_MODULE(target) Release/obj.target/bson.node
      SOLINK_MODULE(target) Release/obj.target/bson.node: Finished
      COPY Release/bson.node
    make: Leaving directory `/opt/reaction-app/tmp/bundle/programs/server/npm/cfs_gridfs/node_modules/mongodb/node_modules/bson/build'
    ----------------------------------------------------------------------------
hrath2015
@hrath2015
Feb 23 2016 10:53
RC team, more than 2k github stars :thumbsup: :clap:
Kavish Patel
@thekavish
Feb 23 2016 10:54
Congrats @hrath2015
Brent Hoover
@zenweasel
Feb 23 2016 11:16
Congrats to everybody here. Collect your badges on the way out. ;)
Aaron Judd
@aaronjudd
Feb 23 2016 15:02
@meladawy funny - that was originally a longer concatenated string.. obviously doesn’t need that anymore
Aaron Judd
@aaronjudd
Feb 23 2016 15:09
@meladawy re: subs, probably a good idea to choose a standard style, I’d prefer to use the isReady syntax I guess, but hadn’t considered fast-render in the equation, that’s just an argument in favor (and the fact that the isSubscriptionReady doesn’t seem to be recommended in the new guide either. )
@thekavish haven’t used MUP myself, so can’t really help, but I can’t tell what the exact error is, but node-gyp compiling is something that i’ve had issue with in the past with windows builds, but never a problem on osx/linux
Aaron Judd
@aaronjudd
Feb 23 2016 15:17
@hrath2015 :+1: not bad for never really marketing or pushing the project.. so those stars are all thanks to you guys for spreading the word. nice!
elkridgelodge
@elkridgelodge
Feb 23 2016 15:24
should Router.map _extend be broken vs a month ago?
like Router is not defined? Changing to ReactionRouter didn't do anything
newsiberian
@newsiberian
Feb 23 2016 16:00
@aaronjudd, factories v0.4 are really slow) I'm waiting about 20 minutes between rerun tests. Any idea why is so?
Aaron Judd
@aaronjudd
Feb 23 2016 16:01
can’t think why (factories would be an issue).. they don’t seem any slower to me running tests. what the issue I am having is with cosmos:browserify -> that’s taking 10+ minutes to finish (which is why the CI tests are timing out)
that’s probably what’s happening for you?
@elkridgelodge Router.map is deprecated, that’s iron-router and dev / v0.12 is flow-router (ReactionRouter).
newsiberian
@newsiberian
Feb 23 2016 18:14
I see the same, this because of cosmos:broserify
Owen Hoskins
@owenhoskins
Feb 23 2016 20:13
@aaronjudd Hey, got a follow up on the routing permissions: I am noticing that guest user's hit a 404 page on their first visit to a route, take a product detail route for example. I suppose the route is rendering before the guest user permissions are granted?
Aaron Judd
@aaronjudd
Feb 23 2016 20:14
the only time I see that is on restart, and I need to reload the browser, is this the same thing you are seeing?
Owen Hoskins
@owenhoskins
Feb 23 2016 20:33
Yep a reload restores the route. It seems to happen with fresh sessions. If I open it another browser for the first time, etc.
Spencer Norman
@spencern
Feb 23 2016 21:06

Is there a ReactionRouter method such as FlowRouter.getRouteName()that returns the current name of the route reactively?

I’ve tried ReactionRouter.getRouteName() but it returns undefined for some routes (or I’m using it wrong)

Mike Murray
@mikemurray
Feb 23 2016 21:26
Its reactive, might need to put it in a Tracker.autorun() or this.autorun() if its inside a template
Spencer Norman
@spencern
Feb 23 2016 21:26
It’s reactive, but it returns undefined
the issue being that it’s returning undefined rather than it’s reactivity
We can get the current route with ReactionRouter.current().route.name but that function is not reactive
Mike Murray
@mikemurray
Feb 23 2016 21:28
Where are you trying to use ReactionRouter.getRouteName() in onCreated / onRendered or inside a helper?
Spencer Norman
@spencern
Feb 23 2016 21:28
@paulgrever?
I tried using it from the browser console to check things
Paul Grever
@paulgrever
Feb 23 2016 21:32
@mikemurray was using it inside helper and in the browser console to verify
Mike Murray
@mikemurray
Feb 23 2016 21:49
@paulgrever @spencern found the issue. We're fixing it now. Seems we overode the FlowRotuer function getRouteName().
Spencer Norman
@spencern
Feb 23 2016 21:50
:+1: I was curious about that, figured it was intentional
Spencer Norman
@spencern
Feb 23 2016 23:19
Question about the register.js - What does priority: 1 vs priority: 2 or other numbers for priority do?
Mike Murray
@mikemurray
Feb 23 2016 23:19
help with sorting
lower numbers are higher priority
Spencer Norman
@spencern
Feb 23 2016 23:20
Sorting the cards in the dashboard?
Mike Murray
@mikemurray
Feb 23 2016 23:23
yea, in adition to container which is for the grouping
Spencer Norman
@spencern
Feb 23 2016 23:24
ok :+1:
Spencer Norman
@spencern
Feb 23 2016 23:42

One more question:

Is layout in the registry an array of workflows

layout: [{
    layout: 'coreAdminLayout',
    workflow: 'coreWorkflow',
    theme: 'default',
    enabled: true,
    structure: {
      template: 'rentalShopSettings',
      layoutHeader: 'layoutHeader',
      layoutFooter: '',
      notFound: 'notFound',
      dashboardHeader: 'dashboardHeader',
      dashboardControls: 'accountsDashboardControls', 
      dashboardHeaderControls: '',
      adminControlsFooter: 'adminControlsFooter'
    }
  }, {
    worflow: ‘uniqueWorkflow2'
    layout: '...'
  }]
Aaron Judd
@aaronjudd
Feb 23 2016 23:44
yes, except the layout itself (which is more)
I know, that wasn’t helpful - but yes, an array of workflows..
Spencer Norman
@spencern
Feb 23 2016 23:45
meaning ‘layout’ is more than an array of workflows
Aaron Judd
@aaronjudd
Feb 23 2016 23:45
right...
Spencer Norman
@spencern
Feb 23 2016 23:45
ok
and follow-up, is this spot in the registry the place to define workflows
Aaron Judd
@aaronjudd
Feb 23 2016 23:45
yes…
Spencer Norman
@spencern
Feb 23 2016 23:45
all coming together
Aaron Judd
@aaronjudd
Feb 23 2016 23:46
the only caveat right this second, is that you need to copy the layout from the packages to the Shops.. to use them.
(see Shops)
Spencer Norman
@spencern
Feb 23 2016 23:46
ok, have to put them manually in the Shops via database?
Aaron Judd
@aaronjudd
Feb 23 2016 23:46
when I patch the package reload, we’ll load them automatically, but for now.. yes
Spencer Norman
@spencern
Feb 23 2016 23:46
ok
Aaron Judd
@aaronjudd
Feb 23 2016 23:48
just to explain why...
the plan is to allow you to select alternate layouts via the admin, in the near future..
but that’s shop specific...
and the registry is more of a fixture set in this case..
Spencer Norman
@spencern
Feb 23 2016 23:49
works for me, helped in understanding the way we define workflows and what they are for
One more question about workflows, what does adding a collection attribute to a workflow do?
Aaron Judd
@aaronjudd
Feb 23 2016 23:52
if you have a collection, with a workflow object defined, we use that to define where to save the workflow status updates.
Spencer Norman
@spencern
Feb 23 2016 23:52
ok, that’s what I thought, it doesn’t affect subscriptions or anything though
Aaron Judd
@aaronjudd
Feb 23 2016 23:52
nope