Quantcast
Channel: Ember.JS - Latest topics
Viewing all 4748 articles
Browse latest View live

Uncaught TypeError: Cannot read property 'ColumnDefinition' of undefined


Use of Curly Braces while importing

$
0
0

@manushome wrote:

import { computed, observer } from ‘@ember/object’;

import Controller from ‘@ember/controller’;

why curly braces for first line and not needed for second line?

Posts: 1

Participants: 1

Read full topic

“I contribute to Ember” with Serena Fritsch

$
0
0

@jessica wrote:

Hello folks and welcome to the second edition of the interview series “I contribute to Ember”, presented by the folks at The Ember Times :slight_smile:

This week we’d like to highlight the work of contributor @serenaf and talk about her learnings in organising Ember meetups and making contributions to Ember learning projects easier for everyone!

How did you get started with using Ember and joining the community?

I started with Ember at around three and a half years ago when I joined Intercom. I joined [them] in July 2015 and at the time [they were] already using Ember. That was my first experience with Ember. I started working with Gavin Joyce who was already contributing a lot to the Ember scene at the time and the year after, Leah was contacting me to speak at Embercamp [London] - that was in 2016. […] I already knew the people at Intercom working with Ember and then at Embercamp it was my first time meeting the wider community, and I immediately fell in love with Ember. Everyone’s really nice, very friendly people.

How have you been contributing recently in regards to Ember?

My main focus last year was on the deprecations app. The deprecations app was one of the first apps that we migrated from a Rails app to an Ember app. So this was my main focus. And the last commit was actually adding search capability to the deprecations app with the help of Chris Manson…he’s amazing. […] Chris, Gavin and I are the organising the Ember meetups for Dublin, we are not doing them super regularly, but we’re trying to get that back on track in the next month or so. And then, the next thing will hopefully be working with the Ember Learning team to see where my help is really needed. Yeah. That’s the idea.

What made you initially interested in working on the deprecations app in particular?

I think this originally started out with Ricardo, one of the Ember Learning Core team members, and him adding a Github issue […] about the Rails app that was used at the time and to try something out [in the app] regarding changing the way the deprecations looked. I was really interested [in that] and this got me into the actual source code for the deprecations. And then I met with Chris last year [around Christmas] and we said: "It would be so much easier if this were an Ember app". And then we started to step-by-step change it to a native Ember app. […]

Did you see advantages in migrating the previous deprecations app to an Ember app?

Totally. […] Deprecations are very easy to contribute to if you know "how", right? If you know how to write text. So with this [new] Ember app we allowed even non-technical people to write just Markdown and then it could be translated into a visible deprecation which was already styled in the right format. And this was really super interesting to see: How can we get more people to contribute to Ember [easily]? At that time it was really painful to setup this Rails monolith we had with the Ember website and all these different parts. [And the question was] how can we make this easier for new contributors, so they don’t have to spend like three afternoons setting their system up to start contributing to the app? The deprecations app was an excellent example because later [people started to] just create a pull request in Markdown format and they didn’t even have to set up the app themselves - we had lots of cases like that [after migrating the deprecations app to an Ember app].

What has been your most important learning so far in regards to Ember?

Yeah, so this is a good question actually. I think the one thing is: Never hesitate to ask questions! Because everyone [in the community] is always super, super helpful; in the Discord channel there will always be someone to give an answer.

And then, the second one is - that’s one thing I sometimes struggle with myself: I would love to contribute more again. […] And I had this [idea] in my head. I had this bad feeling: “Oh my god, I’m not contributing every weekend, I have to do more.” And then Chris sat me aside at some stage and said: “No, you already did so much, even a tiny little contribution, even a PR fixing a typo in the Guides is a great contribution.” So kind of changing this mindset of feeling like you have to be productive all the time to help out. [But you help out] when you can! And with the help of many, we get to the point where we are.

Do you have one piece of advice for first-time contributors?

That’s a great question. Don’t hesitate to jump into the Discord channel! Ask questions there. Maybe get someone to mentor you or go with you through some stuff. I was really lucky that I had Chris for example, and I had people like [Jessica] and Jen and Ricardo who were always super helpful and who are my friends, my support network and who I can always ask questions! And people are so nice in the community, that there will always be someone like this.


Serena Fritsch, also known as @serenaf, is a Product Engineer at Intercom and a contributor to Ember. You can also find her on Twitter.

Posts: 1

Participants: 1

Read full topic

Mirage error responses for jsonAPI ember-data

$
0
0

@teejay wrote:

Hello, I am currently struggling to create a valid error response in mirage for a patch request.

my config looks like this

server.patch(`api/v2/students/:id`, function () {
  // example Error response from the server
  return new Mirage.Response(422, {}, {
    errors: [
      {
        'status': 422,
        'title': 'wth',
        'detail': 'login has already been taken',
        'source': {
          'pointer': '/data/attributes/login',
        },
      },
    ],
  })
})

and when I try to save the model object via .save() I am presented with a super duper annoying error message-> The adapter rejected the commit because it was invalid

I am really a little clueless at this point and I hope someone could help me out with this one. I am using ember 2.18, same for ember data.

Posts: 1

Participants: 1

Read full topic

How to write test when moving to other hosted page

$
0
0

@EUGinsane wrote:

Hi, I stuck at writing Acceptance-test for this case: My Ember app has an /login route, which will redirect to a login page, this login page is not from Ember app, it is hosted by Auth0. Any suggestions for writing test for this case ? Thanks.

Posts: 2

Participants: 2

Read full topic

Using ember-cli + ember-cli-sass to generate vendor.css

$
0
0

@diegoholiveira wrote:

Hi guys. I’m a newbie using ember and I’m trying to use ember + ember-cli-sass but I can’t make it generate my vendor.css as I expected. With ember serve or ember build --env production, my app.css is generated successfully.

After read the docs about managing assets, I configure my ember-cli-build.js as it follow:

"use strict";

const EmberApp = require("ember-cli/lib/broccoli/ember-app");

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {});

  app.import("node_modules/bootstrap/scss/boostrap.scss");
  app.import("vendor/paper-dashboard.scss");

  return app.toTree();
};

What I’m doing wrong here?

Posts: 1

Participants: 1

Read full topic

About the Blog category

$
0
0

@jessica wrote:

(Replace this first paragraph with a brief description of your new category. This guidance will appear in the category selection area, so try to keep it below 200 characters. Until you edit this description or create topics, this category won’t appear on the categories page.)

Use the following paragraphs for a longer description, or to establish category guidelines or rules:

  • Why should people use this category? What is it for?

  • How exactly is this different than the other categories we already have?

  • What should topics in this category generally contain?

  • Do we need this category? Can we merge with another category, or subcategory?

Posts: 1

Participants: 1

Read full topic

Possible to use slickgrid with ember-auto-import?

$
0
0

@Lupestro wrote:

Hi folks,

This last week, we were forced to seek an alternative (temporarily for an imminent release) to ember-table for the one place we were using it in our app and fell back to using slickgrid.

We got a complete replacement table component (with some enhancements) coded and tested in about three days, but as we started development, we set aside using ember-auto-import for the task and used app.import instead. The package.json for slickgrid specifies jquery and jquery-ui as dependencies and slick.core as the main, so ember-auto-import dealt with those just fine. However, doing what we needed required loading modules provided in the package but whose role is not mentioned in the npm package manifest. While developing with a hot deadline, we fell back on app.import, which we knew would work:

  let app = new EmberApp(defaults, {
    'ember-cli-babel': {
      includePolyfill: true
    },
    sassOptions: {
      onlyInclude: true
    },
    autoImport: {
      exclude: ['slickgrid'],
    }
      // Add options here
  });
  app.import('node_modules/slickgrid/lib/jquery-3.1.0.js', {using: [{transformation: 'fastbootShim'}]});
  app.import('node_modules/slickgrid/lib/jquery-ui-1.11.3.js', {using: [{transformation: 'fastbootShim'}]});
  app.import('node_modules/slickgrid/lib/jquery.event.drag-2.3.0.js', {using: [{transformation: 'fastbootShim'}]});
  app.import('node_modules/slickgrid/slick.core.js', {using: [{transformation: 'fastbootShim'}]});
  app.import('node_modules/slickgrid/plugins/slick.rowselectionmodel.js', {using: [{transformation: 'fastbootShim'}]});
  app.import('node_modules/slickgrid/slick.grid.js', {using: [{transformation: 'fastbootShim'}]});
  app.import('node_modules/slickgrid/slick.dataview.js', {using: [{transformation: 'fastbootShim'}]});
  app.import('node_modules/slickgrid/slick.grid.css', {using: [{transformation: 'fastbootShim'}]});

This works, and let us complete the development.

slickgrid contributes the Slick global to the browser environment. As best I can tell, it doesn’t provide anything like ES6, AMD, CommonJS, or UMD modules to keep it out of the global namespace. The app must load a JavaScript file for each feature that it uses, files with names like slick.grid.js and slick.data.js. Each of the JS files adds some property under Slick.

Is there some way to use ember-auto-import to tame a beast like this one, or is what we did the best solution available?

Aside:

Since someone will ask, our ember-table issues related primarily to display glitches in IE11 and Edge and load performance overall, but especially in IE11 and Edge. slickgrid is blazingly fast and has few issues with supported browsers. We’ve been using it for five years across all our tools, and our customers are used to what it provides, so any component we use must meet those expectations. We will return to ember-table when we have time to address those issues, as I still really want a modern “pure ember” solution but, for mid-February, it isn’t likely to deliver all that we get from slickgrid, and we had to “fish or cut bait”.

Posts: 1

Participants: 1

Read full topic


Best way to share computed properties?

$
0
0

@larryh wrote:

Let’s say you have a few or several computed properties, some of which are kinda complex, that you want to share between 2 (or more) controllers. In the interest of keeping things DRY, what would be the best way to do this?

I tried to do it as a mixin, but couldn’t get export to work, if for no other reason than the computed properties are separated by commas, not semicolons.

So the only thing I can think of is to define the comp. props. in a parent controller and then derive the using controllers from it.

But to me that kinda sorta smells because I have to name it something like MyParentController and stick it in the top level of the /controllers directory. (Although I could create a separate directory for it, I guess.) And all it does is define a few/several computed properties.

The comp. props.behave like functions => seems they should be able to be mixed in to the controllers that need them, as opposed to making those controllers inherit from a base class that just defines them.

BTW, I realize that comp. props. are normally relative to (i.e. use) properties within the same class. In this case my 2 child controllers are very similar (deal with same object: one is for list-all and the other is for show-one), while the properties that they care about (i.e. need in their computations) live in another controller.

So maybe this arrangement can only result in either code duplication or odor.

Okay, as I think about this even more… this doesn’t have to be specifically about sharing computed properties - it’s probably not uncommon for controllers to share all kinds of stuff. Heck, look at Rails: they have a base ApplicationController that you derive your own controllers from, and it’s not uncommon to create other controllers that derive from ApplicationController, add some functionality, and then derive from them.

It’s just that I’ve never run across controller derivation in my Ember readings, hence my ignorance on how people address/solve this problem.

Posts: 1

Participants: 1

Read full topic

Relationships Across Microservices

$
0
0

@niltz wrote:

I have two microservices, lets call them “accounts” and “posts”

The “accounts-service” has it’s own database and handles “users” and “organizations”. Users can be a member of one or more organization.

The “posts-service” also has it’s own database and handles “posts” and “comments”. Both posts and comments have a creator which references a user id. Comments belong to a post. Posts belong to an organization by referencing an organization id.

I know how to setup the relationships between things in the same service, but I don’t know the best way to set up the relationships between resources in different services.

For instance, should a post have an attribute for “organizationId” or should it have a relationship for “organization”? If it should be under relationships, how to I do things like compound documents where a client asks for a post to include the organization (I don’t really want my microservices to be talking to eachother that much…but maybe I need to)?

Posts: 1

Participants: 1

Read full topic

Ember.js - The Ember Times - Issue No. 80

Ember.js - Ember 3.7 Released

$
0
0

@jessica wrote:

Today the Ember project is releasing version 3.7 of Ember.js, Ember Data, and Ember CLI. This release kicks off the 3.8 beta cycle for all sub-projects. We encourage our community (especially addon authors) to help test these beta builds and report any bugs before they are published as a final release in six weeks' time. The ember-try addon is a great way to continuously test your projects against the latest Ember releases.


This is a companion discussion topic for the original entry at https://emberjs.com/blog/2019/01/07/ember-3-7.html

Posts: 1

Participants: 1

Read full topic

Ember.js - The Ember Times - Issue No. 79

$
0
0

@jessica wrote:

Blein Vie Noa, Emberistas! 🐹🎆🎇

The new year starts off with loads of new RFCs! Read more about suggested deprecations of Route render methods and selected ApplicationController properties 🈸! We also have a new RFC for a brand new look of emberjs.com, performance improvements 🏎 for the API Docs search, a new beta release of ember-cli-babel and an advanced testing exam for you!


This is a companion discussion topic for the original entry at https://emberjs.com/blog/2019/01/04/the-ember-times-issue-79.html

Posts: 1

Participants: 1

Read full topic

Troubles migrating away from bower

$
0
0

@johnnyicon wrote:

I’ve been having issues with migrating away from bower using bower-away. When I try to start my project now, I get the following error:

yarn start 
yarn run v1.12.3
$ ember serve

Directory not found: bower_components


Stack Trace and Error Report: /var/folders/8h/j9zgv6t52pz2qd_xsnhlv0yr0000gn/T/error.dump.e8be45d71975e1facda7f232149d57d3.log
error Command failed with exit code 1.

In case there are those who don’t know how bower-away works, it adds all the dependencies in bower.json to the "dependencies" section of package.json with a prefix: "@bower_components/<package_name>": "<package_url>". It then replaces the physical bower_components directory with a symlink to node_modules/@bower_components.

Looking at the strack trace, the source code that is throwing the error (Line 261) seems to not like symlinks…

# node_modules/broccoli/lib/builder.js

254    checkInputPathsExist() {
255      // We might consider checking this.unwatchedPaths as well.
256      for (let i = 0; i < this.watchedPaths.length; i++) {
257        let isDirectory;
258        try {
259          isDirectory = fs.statSync(this.watchedPaths[i]).isDirectory();
260        } catch (err) {
261          throw new this.constructor.BuilderError('Directory not found: ' + this.watchedPaths[i]);
262        }
263        if (!isDirectory) {
264          throw new this.constructor.BuilderError('Not a directory: ' + this.watchedPaths[i]);
265        }
266      }
267    }

Any ideas? Or is there a more reliable away to migrate away from bower?

Thanks in advance!

Posts: 1

Participants: 1

Read full topic

Send() undefined for nested routes

$
0
0

@JimParsons wrote:

I’m trying access the action from the parent controller in the child controller. The following error occurs : Uncaught TypeError: Cannot read property ‘send’ of undefined. How to use the parent controller’s action in child controller ?

Parent Hbs :

Parent Controller : Child Hbs : Child controller:

Posts: 1

Participants: 1

Read full topic


Search folder field not working fine

$
0
0

@Boo wrote:

Hi, I’m having the search field for folder finding, when the enter the corresponding folder names, it will show the corresponding folder files on the below. If the folder name having 100 result means, it will only show the first 24 search result as like I wrote in the below code:

    Core.controller.ManagedObjectLocations = Ember.Object.extend({
        searchResults: null,
        searchResultSize: 0,
        searching: Ember.computed(function () { 
            return ( 'loaded' !== this.get('searchLoadState'));
        }).property('searchLoadState'),
        searchResultPageSizeBinding: 'Core.model.resultsConfig.resultsPerPage',
        init: function () {
            this._super();
 this.set('searchResultSize', this.get('searchResultPageSize') || 24);`
     },
        query: '',
        queryChanged: Ember.observer(function () {
            var model, name, resultSet,
                query = this.get('query'),
                isEmpty = !query.trim(),
                isXPath = query.substr(0, 1) === '/',
                ctl = this;

            if (isEmpty) {
                return;
            }
            if (ctl.get('searchFlight')) {
                return;
            }
            if (isXPath) {
                model = Core.model.search.builtin['core:xpath'];
                name = "xpath";
            } else {
                model = Core.model.search.FacetedForm.getBasic();
                name = "query-text";
            }
            console.log("Creating resultSet.");
            resultSet = model.send([{ name: name, value: query }], null);
            resultSet.set('loading', true);
            ctl.set('searchResults', resultSet);
            resultSet.done(function () {
                resultSet.set('loading', false);
            });
        }, 'query'),
        subcontainersOnly: null,
        recentLocationsBinding: 'Core.model.recentLocations.objects',
        briefcaseBinding: 'Core.model.briefcase',
        systemRoot: function () {
            if (this.get('subcontainersOnly')) {
                return Core.rootNode.get('subcontainers');
            } else {
                return Core.rootNode.get('children');
            }
        }.property('subcontainersOnly')
    });

The result message will be taken from below code:

message: function () {
            var count = this.get('count'),
                total = this.get('parentObjectView.model.length'),
                fetching = Core.messageTable.get('chrome/object-table/fetching'),
                showing = Core.messageTable.get('chrome/object-table/showing-x-of-y').fmt(count, total);
            return total === null ? fetching : (this.get('loading') ? fetching : showing);
        }.property('loading', 'count', 'parentObjectView.model.length'),

The above message will show after the 24 result folder name as like “showing 24 of 100”. After that if we click on that message it will show another 24 result folder name.

The corresponding function happening as like below:

addSearchPage: function (event) {
        var ctl = this.get('controller'),
            rs = ctl.get('searchResultSize'),
            rl = ctl.get('searchResults.length') || 0,
            ps = ctl.get('searchResultPageSize');
        ctl.set('searchResultSize', Math.min(rl, rs + ps));
    },

The corresponding Hbr file having the below code:

{{#if searchResults}}
    <div class="managed-object-group search-results">
        <h1 {{action "toggleSearch" target="view"}}>{{message "/dialog/select-managed-object/search-results"}}</h1>
        <group-content {{bind-attr class="view.showSearch:show-content"}}>
            {{#if searchResults.length}}
                {{view view.MOList model=searchResults}}
            {{else}}
                {{#if searchResults.loading}}
                    {{icon "spinner" size=20}} "Loading..."
                {{else}}
                    "No results"
                {{/if}}
            {{/if}}
        </group-content>
    </div>
{{/if}}

If the folder names having below 24 means also the above message is showing. It need not to show the message as like “showing x of y” for below 24 search result. It only applicable for above 24 results. If the result is not available means it have to show “No Results”. I’m using ember 1.4.0.

Posts: 1

Participants: 1

Read full topic

Controller actions

Ember.js - The Ember Times - Issue No. 81

Ember is trying to open a dependency that I've removed. How do I get rid of it for good?

$
0
0

@johnnyicon wrote:

I’m having a strange issue with a dependency I removed from my project. I removed bootstrap-slider. It’s not referenced anywhere in my project – there’s no single string with bootstrap, slider in any file. However, when I run yarn start , I get the following error:

Build Error (SourceMapConcat)

ENOENT: no such file or directory, open '/var/folders/q4/qd78jlj90qb1szrqh3b0j29r0000gn/T/broccoli-82286Ii6ddaxeQqa1/out-462-broccoli_debug_debug_6_vendor_js/bower_components/seiyria-bootstrap-slider/dist/bootstrap-slider.js'

Where could it be hiding?

Posts: 1

Participants: 1

Read full topic

Join the FOSSASIA community and become a GSoC student working on our Eventyay system using emberJS

$
0
0

@mariobehling wrote:

Hi,

we’re running the FOSSASIA Summit Singapore from March 14-17 this year and we are using emberjs for our event system at https://eventyay.com.

We also participate in Google Summer of Code and would love to get more people on board and connect with you. You can talk to us on Gitter at gitter.im/fossasia/open-event-frontend and check out our issue tracker here: https://github.com/fossasia/open-event-frontend/

All the best and Happy Coding!

Mario

Posts: 1

Participants: 1

Read full topic

Viewing all 4748 articles
Browse latest View live




Latest Images