These are chat archives for reactioncommerce/reaction

10th
Jul 2017
rnandhakumar1995
@rnandhakumar1995
Jul 10 2017 04:02
Tax calculation is not takes place till the end of order processing?
Vivek
@vivekmore89
Jul 10 2017 05:33
@dhonig are you integrated the carousel component?
v3yr0n
@v3yr0n
Jul 10 2017 09:11
@zenweasel what if it was already in production mode?
how would i do that?
because running the reaction reset will delete everything from mongo
right?
Brent Hoover
@zenweasel
Jul 10 2017 09:51
@v3yr0n yeah, then you probably need to write a routing to update all existing users with that permission.
You could use a migration
v3yr0n
@v3yr0n
Jul 10 2017 09:51
ok
what if the routes were added “in memory”
when calling Reaction.addRolesToDefaultRoleSet()?
Brent Hoover
@zenweasel
Jul 10 2017 09:52
That doesn’t retroacively add the permission to all existing users
it just means all new users will get that permission by default
v3yr0n
@v3yr0n
Jul 10 2017 09:53
yeah, i understand that
but what it they are added to some Session and then while checking if the user has permission to access the page we also check in that session
does that make sense?
Brent Hoover
@zenweasel
Jul 10 2017 09:54
so you want to rewrite how permissions for routes work?
v3yr0n
@v3yr0n
Jul 10 2017 09:54
not rewrite, but improve :)
Brent Hoover
@zenweasel
Jul 10 2017 09:55
sounds like a very open attack vector honestly
but I do agree that how it currently works is clunky and needs improvement
v3yr0n
@v3yr0n
Jul 10 2017 09:56
because we are using a session? then maybe we can use something else?
Brent Hoover
@zenweasel
Jul 10 2017 10:01
Yeah, I don’t really know what the best approach would be. You want to store the permission groups on the user, and some users may not get groups just because you add them to the default
v3yr0n
@v3yr0n
Jul 10 2017 10:10
well, i think we should have some common place where the visitor roles are
maybe a document in the roles collection, where all common routes are added?
Brent Hoover
@zenweasel
Jul 10 2017 10:11
maybe a better approach would be to allow a route to not have to have a special permission
so you can just say “this route is available to anonymous” and that’s it
if you want to add a special permission, that’s fine. That makes sense
v3yr0n
@v3yr0n
Jul 10 2017 10:12
yeah, that would work
Brent Hoover
@zenweasel
Jul 10 2017 10:12
But a lot of the time it doesn’t make sense
well, we are in the middle of rewriting a lot of our permission stuff. So if you want to get an enhancement request in now’s the time
v3yr0n
@v3yr0n
Jul 10 2017 10:13
ok, where is the best place to do that?
Brent Hoover
@zenweasel
Jul 10 2017 10:15
Just create an issue explaining what you want and why.
v3yr0n
@v3yr0n
Jul 10 2017 10:15
sure
Brent Hoover
@zenweasel
Jul 10 2017 10:15
Of course a PR is even better :)
We will do a triage of incoming issues tomorrow morning
v3yr0n
@v3yr0n
Jul 10 2017 10:16
yeah, i know that, but you said you are rewriting stuff
so.. :)
Brent Hoover
@zenweasel
Jul 10 2017 10:16
Yea, true true
v3yr0n
@v3yr0n
Jul 10 2017 10:16
i’ll add an issue until EOD
Brent Hoover
@zenweasel
Jul 10 2017 10:17
we did just finish the transition to React Router so that stuff is fairly stable now
v3yr0n
@v3yr0n
Jul 10 2017 10:17
yeah, react-router is nice
v3yr0n
@v3yr0n
Jul 10 2017 11:41
@zenweasel silly question, how can i console.log() from client to my terminal?
or is it not possible?
Brent Hoover
@zenweasel
Jul 10 2017 11:42
I don't think that's possible
v3yr0n
@v3yr0n
Jul 10 2017 11:43
ok, ty :)
danielpinna
@danielpinna
Jul 10 2017 14:00
How do I create a custom collection?
v3yr0n
@v3yr0n
Jul 10 2017 14:23
@danielpinna you need to use SimpleSchema
Daniel Honig
@dhonig
Jul 10 2017 15:24
@danielpinna its pretty easy
you can take a look at some WIP we are doing
to get the basics
take a look at the tests
and then work your way up from there
danielpinna
@danielpinna
Jul 10 2017 16:32
@dhonig Thanks Daniel!

I created my collection and my schema. Then I tried to use my collection in Reaction's existing function and it did not work.

I saw that in your wish-list you import your collection and schema into an index.js file in the server folder.

I think I need to import my collection and schema somewhere in Reaction, right? Do you know where I should do this?

@v3yr0n Thanks
Daniel Honig
@dhonig
Jul 10 2017 16:53
at the point you wish to use them
which could be on the client or server
I started with a test first approach
and thought I would use meteor methods to mutate the collection
but its not needed and redundant
so now we are implementing the React components
and we're moving all the code to the front end
and will let meteor do the heavylifting on the backend
I think you would only want to use the meteor functiosn in a more complex usage where you had to interact with a 3rd party, implement some transactionality or something else that had to be done on the server
danielpinna
@danielpinna
Jul 10 2017 17:24
@dhonig

Hmm, I get it.

What I need to do here is actually quite simple.

With my collection and schema created, I just need to create a screen that performs the desired operations for this collection (eg CRUD).

From what I understand I can do the import from my collection directly on the client (fronend) and already do the desired operation, for example an insert.

Or I can make a call to a method (insert for example) that is on my server (backend).

Which one would be the most correct? Or which one is the right one? Do the operations directly from the front or make calls to the server's methods?

Thank you

Sophie He
@sophiehe
Jul 10 2017 18:43
Wanna build a custom plugin? We'll show you how! The next Reaction Action livestream airs on Tues, July 18 at 10am PDT. Save your spot today: https://www.crowdcast.io/e/reaction-action-july
danielpinna
@danielpinna
Jul 10 2017 18:47
@sophiehe I'm still not accustomed to the terms of the reaction, but I think so ...
The only problem is that I can not wait until the date of the event, I had already seen this link and made my application.
Thank you for the tip!
  • Made my sign *
Michael Jenny
@prinzdezibel
Jul 10 2017 19:04
Congrats to 5K stars
asoares-dev
@asoares-dev
Jul 10 2017 19:17
image.png
please, anybody can helpme?
I solved the problem that I had and the Reaction runed
asoares-dev
@asoares-dev
Jul 10 2017 19:25
but, I think have a problem with port. My mongo response is in 27017 port
and the Meteor try to connect in 3001 port, is it ok?
If anybody should can help me, I'll be glad
Michael Jenny
@prinzdezibel
Jul 10 2017 19:31
that's ok, you don't need to run a separate mongo db on port 27017. The reaction log reads: "Started MongoDB" (which runs on port 3001)
asoares-dev
@asoares-dev
Jul 10 2017 19:37
@prinzdezibel it run in 27017 by pattern
see
image.png
image.png
Michael Jenny
@prinzdezibel
Jul 10 2017 19:38
did you start mongo db via console? this shouldn't be necessary at all
you don't need to execute mongo nor mongod
asoares-dev
@asoares-dev
Jul 10 2017 19:40
Really?
Michael Jenny
@prinzdezibel
Jul 10 2017 19:41
really ;-)
asoares-dev
@asoares-dev
Jul 10 2017 19:41
hahah ok, I'll Try again
danielpinna
@danielpinna
Jul 10 2017 19:56
Folks,
How do I create a new route to a new page?
danielpinna
@danielpinna
Jul 10 2017 21:19
@rhaix
I saw this tutorial, but it did not work ....
rhaix
@rhaix
Jul 10 2017 21:21
@zenweasel Is it possible to set the Email Configuration from within a plugin? I can modify settings.json but I'd like to be able to install the plugin so that the config to be set up from there
@danielpinna something that helped me is taking a look at the beesknees github and read the code they use there to make routes
danielpinna
@danielpinna
Jul 10 2017 21:24

@rhaix That's what I'm doing right now. The problem is that it creates many custom things like (themes, plugin, etc).

I just wanted to create a route and a page, but use the default theme. As it creates a custom theme, I'm not sure how it would be to use the default theme ....

Thank you for the tip

danielpinna
@danielpinna
Jul 10 2017 21:49
For me to create a custom routes and pages, do I necessarily need to create a custom plugin?
Brent Hoover
@zenweasel
Jul 10 2017 21:52
@danielpinna Yes, pretty much any customization you do requires you to do a plugin
rhaix
@rhaix
Jul 10 2017 21:53
@danielpinna You could change the core code, but it is not recommended
@zenweasel anyway to change the mail settings from a plugin?
Brent Hoover
@zenweasel
Jul 10 2017 21:54
Yeah, of course you can always change core code if you don’t care about upgradability/upstreams changes, etc. But we don’t recommend it, and most people don’t want to. But sometimes it is the easier path
@rhaix There’s no standard way to do that. You could always just write your changes to the db directly.
danielpinna
@danielpinna
Jul 10 2017 21:55
It is not my case to change core code.
rhaix
@rhaix
Jul 10 2017 21:56
@danielpinna Then you should create a custom plugin, it gets easier when you get more comfortable with the reaction ecosystem
@zenweasel Thanks, I'll figure something out
Brent Hoover
@zenweasel
Jul 10 2017 21:57
Yeah, don’t be intimidated by the term “plugin”. To create a route you.are just talking about a few lines of code in your register.js
danielpinna
@danielpinna
Jul 10 2017 22:00
@rhaix @zenweasel
Thank you guys.
I know this initial difficulty is part of the learning curve and then it will be easy easy ...

I understand that to create a custom plugin, I need to create a folder for the plugin inside imports / plugins / custom / myplugin

Containing the server and client folders. And having the file register.js

What would be the lowest content for these folders and files to get a route and a page?

My register file looks like this:

import { Reaction } from "/server/api";

Reaction.registerPackage({
name: "reaction-analytics",
icon: "fa fa-bar-chart-o",
autoEnable: true,
registry: [
{
route: "/cidade",
name: "cidade",
template: "aboutUs", // What I put here
workflow: "coreWorkflow"
}
]

});

Brent Hoover
@zenweasel
Jul 10 2017 22:05
the code in register.js gives you your route. Then you just need to add your template in the client directory
Brent Hoover
@zenweasel
Jul 10 2017 22:06
just remember to reaction reset for your changes to take effect
rhaix
@rhaix
Jul 10 2017 22:06
if you review the code there, you can see how it all fits together
don't reset the node_modules when you do reaction reset
Brent Hoover
@zenweasel
Jul 10 2017 22:07
yeah, you can do reaction reset -n
danielpinna
@danielpinna
Jul 10 2017 22:08
Ok, thanks
My template in the client folder, should it be a React page?
rhaix
@rhaix
Jul 10 2017 22:11
no, for now, if I'm not mistaken only some components, like the settings dashboard are in React
the rest still use blaze
Brent Hoover
@zenweasel
Jul 10 2017 22:13
Most of the consumer-facing stuff is converted to React now. But the simplest thing for now is to just use a Blaze template
danielpinna
@danielpinna
Jul 10 2017 22:14
Ok, i will use Blaze
Thanks
asoares-dev
@asoares-dev
Jul 10 2017 23:15
Hey guys, you're awsome. My reaction e-commerce its runing ok!
image.png
I'm already playing now
Thanks by all