These are chat archives for reactioncommerce/reaction

27th
Feb 2018
Sebastian Alvarado
@sebasalvarado
Feb 27 2018 04:48
Hi, can anyone explain why we have imports/plugins/custom/* in .gitignore?
So none of our cusom packages should be commited to our own repository? I imagine we have to remove that line from the .gitignore but want to confirm
Brent Hoover
@zenweasel
Feb 27 2018 04:49
because we don’t want you to commit those to core
yes, if you are using your own repo, just remove those entries in the .gitignore
Sebastian Alvarado
@sebasalvarado
Feb 27 2018 04:50
Ok thanks for confirming @zenweasel . For example i have reaction-swag-shop installed as a plugin. Is it the typical practice to upload the images as well? This plugin has many images inside it.
Brent Hoover
@zenweasel
Feb 27 2018 04:51
well, we did that for the purpose of the tutorial to show you how to add images to your plugin
I don’t know if it’s “typical” or not
Sebastian Alvarado
@sebasalvarado
Feb 27 2018 04:58
Ok makes sense. Do we have a tutorial or some kind of guidance in how to store the images in S3 or Google Cloud Storage? They are currently being stored in Mongo right?
Sebastian Alvarado
@sebasalvarado
Feb 27 2018 05:04
@zenweasel If it's not too much trouble, do you mind explaining what is happening here?
registerComponent("NavBar", NavBar, composeWithTracker(composer));

export default composeWithTracker(composer)(NavBar);
What does the composeWithTracker is supposed to do?This is in ui-navbar plugin in core navbar.js
Akarshit Wal
@Akarshit
Feb 27 2018 05:08
composeWithTracker basically wraps the component inside Meteor's Tracker.autorun(). So the component you register with composeWithTracker will update whenever the data is changed.
Sebastian Alvarado
@sebasalvarado
Feb 27 2018 05:19
Thanks @Akarshit , and the composer function passes theprops` down to the React Component?
galpeer
@galpeer
Feb 27 2018 09:11
Hi guys, I'm trying to move all the admin views to the left side of the screen (instead of the default - right side). The only solution I found is to change the order of the components in app.js. It's not ideal since It will be overrided in any update. Any alternatives ?
Brent Hoover
@zenweasel
Feb 27 2018 09:13
Have you looked at how we handle rtl languages? That's all done with CSS
galpeer
@galpeer
Feb 27 2018 09:15
Partly yes. But then I need to filter what I need from it and override it in my theme
look for example on rtl.less. How can I use it only for those 2 components ?
The CSS code is very generic
Brent Hoover
@zenweasel
Feb 27 2018 09:19
You would need to just copy use more specific selectors.
galpeer
@galpeer
Feb 27 2018 09:21
So to create CSS that will override the default CSS by using selector. It's gonna be dirty code ;)
I think most of the websites' control bar is on the left/upper side. So it might be useful for many people
Akarshit Wal
@Akarshit
Feb 27 2018 09:48
@sebasalvarado Yes, it passes the props to the component using the onData function.
galpeer
@galpeer
Feb 27 2018 10:25
Thanks @zenweasel
zzh1234567
@zzh1234567
Feb 27 2018 11:18
why I can not get productvariants(fields is null) from subscribeProductsByTags . is my fault or it is design intent?
code :
added..。。。. 。。。。。。{"msg":"added","collection":"Products","id":"6qiqPwBkeJdtdQc4G","fields":{}}
@zenweasel
Michael Jenny
@prinzdezibel
Feb 27 2018 11:23
@zzh1234567 what contain those fields ? can you paste the exact code?
zzh1234567
@zzh1234567
Feb 27 2018 11:32
Meteor.ddp.on("added", message => {
{
this.state.collections[message.collection] = {//// message.collection: Products & cfs.Media.filerecord
...this.state.collections[message.collection],
        [message.id]: {
            _id: message.id,
            ...message.fields
        }
      };
      console.log("subscribeProductsByTags added..。。。。。。。。。" + JSON.stringify(message));
    }
  });
params = [ this.state.allSubIdscribeNum, { tags: [tagid] } ];
this.state.currentSubId = Meteor.ddp.sub("Products", params);
zzh1234567
@zzh1234567
Feb 27 2018 11:39
@prinzdezibel
Michael Jenny
@prinzdezibel
Feb 27 2018 12:54
@zzh1234567 not sure actually. The products publication should publish simple and variant types.
zzh1234567
@zzh1234567
Feb 27 2018 13:01
thank you. it should be. I will check my code again.
William Moss
@willmoss1000
Feb 27 2018 15:05
I'm trying to replace the OrdersList Component (which is wrapped in file UserOrdersListContainer). Once I've done this I can replace the completedOrder Component (wrapped in file CompletedOrderContainer) and put in somewhere where users can leave reviews. It's all working when I edit source code. However, for some reason I'm unable to replace "OrdersList". Could someone please take a look at the below and let me know why it's not working?
import React from "react";
import PropTypes from "prop-types";
import { replaceComponent } from "@reactioncommerce/reaction-components";
import OrdersListCore from "/imports/plugins/core/accounts/client/components/ordersList";
import CompletedOrderCore from "/imports/plugins/core/checkout/client/components/completedOrder";

class OrdersList extends OrdersListCore {
  static propTypes = {
    allOrdersInfo: PropTypes.array,
    handleDisplayMedia: PropTypes.func,
    isProfilePage: PropTypes.bool
  }

  render() {
    const { allOrdersInfo, handleDisplayMedia } = this.props;

    if (allOrdersInfo) {
      return (
        <div>
          {allOrdersInfo.map((order) => {
            const orderKey = order.orderId;
            return (
              <CompletedOrderCore
                key={orderKey}
                shops={order.shops}
                order={order.order}
                orderId={order.orderId}
                orderSummary={order.orderSummary}
                paymentMethods={order.paymentMethods}
                productImages={order.productImages}
                handleDisplayMedia={handleDisplayMedia}
                isProfilePage={this.props.isProfilePage}
              />
            );
          })}
          {"TESTTESTTEST"}
        </div>
      );
    }
    return (
      <div className="alert alert-info">
        <span data-i18n="cartCompleted.noOrdersFound">No orders found. TEST TEST</span>
      </div>
    );
  }
}

export default OrdersList;

replaceComponent("OrdersList", OrdersList);
I added some strings to check if it comes through "TEST TEST" when No orders are found. But, this isn't showing, so it can't be picking this up. Definitely added to index.js
Michael Jenny
@prinzdezibel
Feb 27 2018 15:41
@willmoss1000 Whenever you've replaced components, you shouldn't refer to them via direct import
Use <Components.OrdersList /> , resp <Components.CompletedOrderCore /> if that was overwritten as well
William Moss
@willmoss1000
Feb 27 2018 15:44
@prinzdezibel OK, so when I use the replaced component, it should be using <Components.OrderList>?
Patrick Newell
@pnewell4_twitter
Feb 27 2018 15:46
as a sanity check, can you try registerComponent instead of replaceComponent?
William Moss
@willmoss1000
Feb 27 2018 15:48
sure, will do.
@pnewell4_twitter is the issue here then, if I understood the above correctly. This is then being called by direct import, so I am unable to replace it? https://github.com/reactioncommerce/reaction/blob/master/imports/plugins/core/accounts/client/templates/profile/userOrdersList.js
@pnewell4_twitter it's wrapped in a container, if I copy the registercomponent section from the original will it superseed it?
*I mean from UserOrdersListContainer where it is registered
sorry I meant @prinzdezibel for the top one
galpeer
@galpeer
Feb 27 2018 15:52
Hi guys, I'm following https://docs.reactioncommerce.com/reaction-docs/master/email-admin# to configure my emails server, but getting - Invalid login: 535 5.7.0 Mailgun is not loving your login or password. Do you know what can be the problem?
Patrick Newell
@pnewell4_twitter
Feb 27 2018 15:54
@willmoss1000 (this isn't exactly an answer to your question, but...) there is a registry of components that is a simple JS object, the difference between replace and register is that replace attempts to keep the HOCs in tact. My hunch is that one of those HOC is making it such that allOrdersInfo is not null
William Moss
@willmoss1000
Feb 27 2018 15:58
@pnewell4_twitter thanks, that's good to know. Ok that's definitely worth checking. But it's certainly the case that the replaced "OrdersList" is not being used. I think it's because of how "OrdersList" is called here https://github.com/reactioncommerce/reaction/blob/master/imports/plugins/core/accounts/client/templates/profile/userOrdersList.js
would that make sense? It's being called directly rather than as a component, so I'm unable to replace it?
I'll test that out
Patrick Newell
@pnewell4_twitter
Feb 27 2018 16:03

oh yeah, that's definitely it. that code should probably look like this:

import { Components } from "@reactioncommerce/reaction-components";

// ...
return {
  component: Components.UserOrdersList,
  orders
};

that might mean you have to 1) edit Reaction code (and submit a PR!) or 2) monkey patch Template.userOrdersList.helpers.completedOrders

Michael Jenny
@prinzdezibel
Feb 27 2018 16:04
I'd vote for #1 (with PR) :)
William Moss
@willmoss1000
Feb 27 2018 16:07
Haha, Ok I'll see if this fixes it an get a PR in. Thanks both! Been chasing that one down for ages, thought I was being idiotic
Guillaume Huard hughes
@t1gu1
Feb 27 2018 16:23

When i execute reaction run command, i got

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

With a big error follow by a big object and it finish by: Error: App failed to start

I got that error the first time i lunch the command. The second time it works.
Michael Jenny
@prinzdezibel
Feb 27 2018 16:34
@t1gu1 have you seen this: reactioncommerce/reaction#2940 ?
William Moss
@willmoss1000
Feb 27 2018 16:37
@prinzdezibel reactioncommerce/reaction#3848 could you please check this is submitted accurately. I haven't put in a PR before with you guys. Would be great if we can get this in 1.9, it's just changing 2 lines. Cheers!!!
Michael Jenny
@prinzdezibel
Feb 27 2018 16:38
@willmoss1000 thanks!
Guillaume Huard hughes
@t1gu1
Feb 27 2018 17:29
Can we build the app in devellopement mode to rebuild the app in less time? Cause it's a bit long to see changements.
Maybe i don't see an information in the doc.
Akarshit Wal
@Akarshit
Feb 27 2018 18:52
The app takes around 10-15 secs on my MBP to restart after changes.
William Moss
@willmoss1000
Feb 27 2018 18:59
Sorry for all the messages today, but I'm now trying to replace Completed Order. I simply wish to add one line to this component: https://github.com/reactioncommerce/reaction/blob/c5b36e48ef6e526a3288a897c911876248a37ec6/imports/plugins/core/checkout/client/components/completedOrder.js. However, it's not possible to replace that component without changing a lot more of the source code. I think I am having the same issue as before, but CompletedOrder is called in a lot more places. @prinzdezibel I've made the note here: reactioncommerce/reaction#3785. Would be great if someone could take a look at some point. Cheers!!
Michael Jenny
@prinzdezibel
Feb 27 2018 19:46
@willmoss1000 How many places with references have you found? I'm seeing 2.
Please file a issue with a description. This is the easiest way to handle it.
William Moss
@willmoss1000
Feb 27 2018 19:49
Yes, I replaced 2 and it gave a match error due to the CompletedCartOrder Subscription. Yep, I'll write up a proper issue and describe the problem so you can test.
No, I believe there were 3