mercredi 31 juillet 2019

TypeError when using before all hook in ember mocha

I'm running into some issues with the before all hook in ember-mocha (version 0.14.0). Here's an example from the docs that's been slightly modified to include a beforeEach hook:

import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupApplicationTest } from 'ember-mocha';
import { visit, currentURL } from '@ember/test-helpers';

describe('basic acceptance test', function() {
  setupApplicationTest();

  beforeEach(async function() {
    await visit('index');
  });

  it('can visit /', async function() {
    await visit('/');
    expect(currentURL()).to.equal('/');
  });
});

The above test runs as expected with no issues. However, when I substitute before for beforeEach I encounter an error:

import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupApplicationTest } from 'ember-mocha';
import { visit, currentURL } from '@ember/test-helpers';

describe('basic acceptance test', function() {
  setupApplicationTest();

  before(async function() {
    await visit('index');
  });

  it('can visit /', async function() {
    await visit('/');
    expect(currentURL()).to.equal('/');
  });
});

TypeError: Cannot destructure property `owner` of 'undefined' or 'null'.
    at visit (assets/test-support.js:24931:9)
    at Context.<anonymous> (assets/tests.js:339:36)
    at invoke (assets/test-support.js:22801:21)
    at Context.asyncFn (assets/test-support.js:22786:11)
    at callFnAsync (assets/test-support.js:14070:8)
    at Hook.Runnable.run (assets/test-support.js:14022:7)
    at next (assets/test-support.js:14386:10)
    at assets/test-support.js:14408:5
    at timeslice (assets/test-support.js:9651:27)

Please let me know if any clarification is needed. Thanks in advance for your help!




Clicking on a button with dynamic selector in python selenium webdriver

I am working on this automation thing and I am trying to click on this button with selector

<button id="ember2570" class="ember-view btn btn-default btn btn-default" type="button">    <i class="fa fa-upload"></i>
PDMLink<!----></button>

I have tried find_element_by_id but the ID changes with every reload and the class names are also not unique to the button. if I try including wildcard like "ember*" then it clicks somewhere else. Almost all the elements of the web page has id="embersomeRandomNumber" I cannot share the url as it is an intranet site.




mardi 30 juillet 2019

ember.js `afterModel` event handler changes not reflected in Template

I have a route in which I use Ajax (not Ember Data) to pull a record, a costcentre, off the server. The record is intended to populate a template for subsequent edits.

Before the fetch, in beforeModel, an empty costcentre is created using createRecord. After the model processing is complete, in afterModel, the returned data is used to populate the costcentre object in the Data Store.

The fetch of the data is successful and in the debugger the update of the locally stored DS object can be seen to have worked but the changes are not seen in the template.

How can I get the template to populate with the data returned from the server ?

In the route I have this :

  beforeModel: function(transition) {
    this.set('ccToEdit', this.store.createRecord('costcentre'));
  },

  model(params) {
      return getCCByCCIdent(    this.urlbase,
                                this.currentMOP.currentMOP,
                                ENV.APP.MATClientCode,
                                params.cceIdentifier_to_edit);
  },
  afterModel(ccs, transition) {
    //I'm testing this with an API end point that returns a
    //list but there will only ever be one item in the list

    this.ccToEdit.setProperties(ccs[0]);
  },

The getCCByCCIdent looks like this :

export const getCCByCCIdent = function(urlbase, currentMOP, clientCode, targetCostCentreIdent) {

  return new Promise(function (resolve, reject) {
    if (targetCostCentreIdent.length == 0)
    {
      resolve([])
    }
    else
    {
      var theUrl = `${urlbase}/costcentres/${currentMOP}/${clientCode}/${targetCostCentreIdent}`;
      $.ajax({
        type: 'GET',
        url: theUrl,
        success: function (response) {
          resolve(response);
          },
        error: function (request, textStatus, error) {
          reject(error);
          }
        });
    }
  })
}





lundi 29 juillet 2019

How to create EmberJS app and stick it into Chrome

I am trying to create a basic Ember app to then stick into a Chrome extension. I want the Chrome extension to takeover the newtab functionality. The end goal is to see the Ember Welcome App whenever I open a new tab.

Here is my manifest.json:

{
  "manifest_version": 2,
  "name": "My Cool Extension",
  "version": "0.1",
  "description": "Build an Extension!",
  "permissions": ["storage", "activeTab", "geolocation"],
  "background": {
    "scripts": ["background.js"]
  },
  "content_scripts": [
    {
      "matches": [
        "<all_urls>"
      ],
      "js": ["jquery-2.2.4.min.js", "content.js"]
    }
  ],
  "browser_action": {
    "default_icon": {
      "16": "icon.png"
    }
  },
  "chrome_url_overrides": { "newtab": "index.html" }
}

I am running Ember CLI 3.10 and this is a fresh EmberJS app. I ran ember build --environment production and copied over the dist folder into my chrome folder that contains my manifest.json. I'm referencing my built index.html file in my manifest.json. The problem I'm running into is that when I open a new page, I get UnrecognizedURLError: /index.html that originates from my fingerprinted vendor.js. Why is that? How can I fix this?




dimanche 28 juillet 2019

Ember form-for addon's text-field onblur not working

I tried onblur, focus-out, focusout, onfocusout, blur and focusOut throws error as it's a tagless component. None of them are working.

I'm trying to build a user form and validate the input when the user blur's from the field.

I'm using the below addon's together

Component Template File


  
  
    <p></p>
  
  
  
    <p></p>
  
  
  
    <p></p>
  
  


Component Javascript File

import Component from '@ember/component';
import { get }   from '@ember/object';
import Changeset from 'ember-changeset';
import lookupValidator from 'ember-changeset-validations';
import UserValidations from '../../validations/user';

export default Component.extend({
  init() {
    this._super(...arguments);
    this.user = new Changeset(get(this, 'model'), lookupValidator(UserValidations), UserValidations);
  },
  actions:{
    validateOnBlur(changeset, property){
      debugger
    },
    async submit(changeset){
      await changeset.validate();
      if(changeset.isValid){
        changeset.save();
      }
    }
  }
});

Validator

import {
  validatePresence,
  validateLength,
  validateFormat
} from 'ember-changeset-validations/validators';

export default {
  name: validatePresence(true),
  email: [
    validatePresence(true),
    validateFormat({ type: 'email' })
  ],
  password: [
    validatePresence(true),
    validateLength({ min: 8 })
  ]
};




vendredi 26 juillet 2019

How to open and close Ember Power Select from outside

I'm aware of this question, but is not complete. I want to open and close the dropdown from outside.

I can dispatch a mousedown event when click on my wrapper component, so ember-power-select trigger opens!. But then if I click again it doesn't close. More precisely, it closes and opens again rapidly.

My assumption is the component is listening blur event to get closed, and then the mousedown arrives again and open the trigger.

Has anyone managed to get this to work? or an alternative?? I'm quite lost :)

Thanks for the help!

wrapper-component.js 

  didInsertElement() {

    this._super(...arguments);
    this.element.addEventListener('mousedown', (event) => {
      event.stopPropagation();
      const eventedElement = this.element.querySelector('.ember-power-select-trigger');
      const mouseDownEvent = new MouseEvent('mousedown');
      eventedElement.dispatchEvent(mouseDownEvent);
    });

  },





Firebase Phone Auth - RecaptchaVerifier undefined

I'm trying to implement Firebase Phone Authentication in my Ember.js app but the function RecaptchaVerifier is not defined.

The packages I'm using are Ember Canary with Firebase 6.3.2 and Node 10.15.3. The problem is that when I try to run the function it is undefined. I already have initialized firebase and it is working great when I'm using authentication with email and password.

I followed the instructions from https://firebase.google.com/docs/auth/web/phone-auth?hl=es-419 and wrote this line window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container'); to call the recaptcha. The method firebase.auth is defined and working correctly.

If anyone has an idea or another approach on how to implement this would be very helpful. Thanks in advance!




Ember: Disable SRI on a single file

How can disable sub resource integrity for a specific file in a Ember.js application? I tried putting this but no luck

"SRI": {
    exclude: ['assets/env.js']
}




mercredi 24 juillet 2019

How to stub the Keycloak Service in Ember.js

In our Ruby on Rails - Ember.js Application we've recently started introducing Keycloak. The implementation with https://github.com/JFTechnology/ember-keycloak-auth is completely functional and works quite well out of the box.

I've now tried disabling the Keycloak authentication for local development, since we don't want to have to sign in to Keycloak when developing locally.

What I want to do is stub the Keycloak-Session so that some of its calls, such as init and installKeycloak don't actually initialize anything which then also allows us to just return true on checkToken calls etc.

I've managed to stub the service in our tests by simply registering this helper kalled keycloak-stub.js:

import Service from '@ember/service';

export default Service.extend({
  tokenParsed: '1234',
  keycloak: Object.freeze([{ token: '1234', given_name: 'fritz' }]),

  hasResourceRole(resource, role) {},

  installKeycloak(parameters) {},

  initKeycloak() {},

  checkTransition(transition) {},

  updateToken() {
    return new Promise((resolve, reject) => { resolve() })
  }
})

with this call in one of our test-helpers.

this.owner.register("service:keycloak-session", keycloakStub);

So far so good, doing the same thing for the "normal" development environment turns out to be much more difficult though.

Per documentation of the package you initialize the Keycloak-Service like this:

// app/routes/application.js

  session: inject('keycloak-session'),

  beforeModel: function () {

    this._super(...arguments);

      var session = this.get('session');

      // Keycloak constructor arguments as described in the keycloak documentation.
      var options = {
        'url': 'https://auth.my-server.com/auth',
        'realm': 'my-realm',
        'clientId': 'my-client-id'
      };

      // this will result in a newly constructed keycloak object
      session.installKeycloak(options);

      // set any keycloak init parameters where defaults need to be overidden
      session.set('responseMode', 'fragment');

      // finally init the service and return promise to pause router.
      return session.initKeycloak();

  }

So optimally we'd want to inject our keycloak-stub.js before this happens here so we could define our own install methods and therefore stub the whole thing to our liking.

I've tried to do this with an initializer like this:

import KeycloakStub from '../helpers/keycloak-stub';

export function initialize(application) {
  application.register('service:abc', KeycloakStub)
  application.inject('route', 'keycloak-session', 'service:abc')
}

export default {
  initialize
};

This doesn't seem to change anything and the Keycloak Service just gets initialized normally.

I've also tried registering they stubbed service similar as in the test environment but these methods don't seem to be available in the context of the application.js file.

I'm looking forward to any answers to my problem or on other suggestions on how to stub the keycloak service.




mardi 23 juillet 2019

Hosting a ember application under angular Progressive web apps

We need to create a PWA with angular which will wrap the ember application and communicate through some navigation and events.

PWa will be just as a container which hosts the ember so that the application can be used as native and as webapps through every devices.

We need some approaches to get some solution regarding the above requirement.

Will it be possible for everyone to give some light one that.

Planning to host the application using iframe under PWA and communicate.Not sure whether it will be helpful or not.




lundi 22 juillet 2019

`cannot read property ‘setDirtyAttribute’ of null` even if you use `YourModel.create({…})` in `ember-typescript-cli`

Facing cannot read property 'setDirtyAttribute' of null even if you use YourModel.create({...}) in ember-typescript-clito create a EmberObject.

Model:

import DS from 'ember-data';
import {computed} from "@ember/object";

export default class Person extends DS.Model {
  @DS.attr() firstName!: string;
  @DS.attr() lastName!: string;
  @DS.attr() age!: number;
  @DS.attr() desc?: string;


  @computed("firstName", "lastName")
  public get fullName() {
    return `${this.firstName} ${this.lastName}`;
  }
}


Route:

export default class Persons extends Route {
  @service() public store!: DS.Store;

  constructor() {
    super(...arguments);

    const persons: Person[] = [
      Person.create({firstName: "first1", lastName: "last1", age: 10}),
      Person.create({firstName: "first2", lastName: "last2", age: 320}),
      Person.create({firstName: "first3", lastName: "last3", age: 30}),
    ];
      persons.forEach(p => this.store.createRecord('person', p));
  }
}

Get error when enter the page:

Uncaught TypeError: Cannot read property 'setDirtyAttribute' of null
    at Person.set (-private.js:144)
    at ComputedProperty._set (metal.js:3543)
    at ComputedProperty.setWithSuspend (metal.js:3532)
    at ComputedProperty.set (metal.js:3503)
    at initialize (core_object.js:67)
    at Function.create (core_object.js:692)
    at new Persons (persons.js:23)
    at Function.create (core_object.js:684)
    at FactoryManager.create (container.js:549)
    at instantiateFactory (container.js:359)

So I have to use things like this.store.createRecord('person', {firstName: "first1", lastName: "last1", age: 10}) rather than this.store.createRecord('person', <a Person class instance>), which is not typescript-ish at all. So I hope to find a more elegant way to combine the ember feature to typescript, rather than use any or bare object everywhere.

Any advice?




Sort to desc and asc order based on selected property in an array javascript [duplicate]

This question already has an answer here:

I have an array with list of objects in that i need to sort "Asc" and "Desc" based on the property i selected.

Consider this an array

var array = [
{
triggerType: "Create",
txRefNo: "SCC507G710A1180815090948",
updateDate: "2015-08-18 12:01:31.0",
{
triggerType: "Create",
txRefNo: "SCC234G710A1180815090948",
updateDate: "2016-08-18 04:01:31.0",
}]

in this i need to sort asc and desc based on date and txrefno when button clicked.

like toggle if i click on one button or icon it will do both fucntionality.

How i wil do this on javascript or jquery




dimanche 21 juillet 2019

Ember not generating model files

Trying to use the cli to generate model files but no files get generated. I run:

ember generate model blurbs

and it returns these two lines without any mention of actual files being generated (like app/models/blurbs.js)

installing model
installing model-test

I was able to generate my routes (ember g route blurb) correctly before but for models it lists no files and none are generated either.

This is my setup:

ember-cli: 3.11.0
node: 12.6.0
os: win32 x64




Uable to generate adapter application - ember.js

I am quite new to ember.js. I have been working on the tutorial and having issue with generating adapter application.

When i run the command ember generate adapter application i can see message saying installing adapter and installing adapter-test but no file is getting generated in the folder structure .enter image description here




How can I get the new lat, lang of the user whenever the user drags the pin anywhere

I'm building a web app that actually allow the user to see the marker for a selected a address. Also, I'm trying to build a feature that when a user drag the pin it should update the lat, lang value. Though I was able to get the current location of a user using the code below but the big question is How can I get the new lat, lang of the user whenever the user drags the pin anywhere? Any response is much appreciated, thank you. Btw, I am using this addon https://github.com/asennikov/ember-g-map

/component.js

    getCurrentLocation() {
      if (navigator.geolocation) {
        console.log(navigator.geolocation);
        navigator.geolocation.getCurrentPosition((position) => {
         this.set('selectedLatitude', position.coords.latitude);
         this.set('selectedLongitude', position.coords.longitude);
         this.set('hasSelectedFromAutoCompleteOrCurrentLocation', true);

         this.reverseGeoCode(position.coords.latitude, position.coords.longitude).then((resp) => {
           this.set('formattedAddress', resp);
         }).catch((error) => console.log(error));

       });
      } else {
        console.log("Your browser doesn't support geo location");
      }
    },

/template.hbs

    
      
        
      
    




samedi 20 juillet 2019

Unable to import andThen in acceptance test - ember.js

I am quite new to ember.js project where i am trying to write my first acceptance test for testing my root path works. I am following the below tutorial . I was unable to import "module-for-acceptance" from the helpers as its deprecated. when i run the below test i am getting an error which says (0 , _testHelpers.andThen) is not a function. I had also gone through ember js discussion post and imported andThen. It does not seem to work . How can i import andThen and make my test work . Thank you.

Test case

import { module, test } from 'qunit';
import { visit, currentURL ,andThen } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';


module('Acceptance | list rentals', function(hooks) {
  setupApplicationTest(hooks);

  test('should redirect to rentals route', function (assert) {
    visit('/');
    andThen(function() {
      assert.equal(currentURL(), '/rentals', 'should redirect automatically');
    });
  });

});

Log

Died on test #1     at Object.<anonymous> (http://localhost:7357/assets/tests.js:8:21)
    at processModule (http://localhost:7357/assets/test-support.js:3765:16)
    at module$1 (http://localhost:7357/assets/test-support.js:3790:4)
    at Module.callback (http://localhost:7357/assets/tests.js:6:21)
    at Module.exports (http://localhost:7357/assets/vendor.js:111:32)
    at requireModule (http://localhost:7357/assets/vendor.js:32:18)
    at TestLoader.require (http://localhost:7357/assets/test-support.js:13736:9): (0 , _testHelpers.andThen) is not a function@ 60 ms
Source:         
TypeError: (0 , _testHelpers.andThen) is not a function
    at Object.<anonymous> (http://localhost:7357/assets/tests.js:10:32)
    at runTest (http://localhost:7357/assets/test-support.js:5618:30)
    at Test.run (http://localhost:7357/assets/test-support.js:5604:6)
    at http://localhost:7357/assets/test-support.js:5831:12
    at processTaskQueue (http://localhost:7357/assets/test-support.js:5197:24)
    at advanceTaskQueue (http://localhost:7357/assets/test-support.js:5182:4)
    at Object.advance (http://localhost:7357/assets/test-support.js:5168:4)
    at unblockAndAdvanceQueue (http://localhost:7357/assets/test-support.js:6944:20)
    at begin (http://localhost:7357/assets/test-support.js:6978:5)
    at http://localhost:7357/assets/test-support.js:6219:6
Tried to restart test while already started (test's semaphore was 0 already)@ 61 ms
Source:         
    at resume (http://localhost:7357/assets/test-support.js:6171:5)
    at done (http://localhost:7357/assets/test-support.js:6362:7)
    at Class.asyncEnd (http://localhost:7357/assets/test-support.js:13822:9)
    at asyncEnd (http://localhost:7357/assets/vendor.js:68040:15)
    at http://localhost:7357/assets/vendor.js:67197:31
    at invoke (http://localhost:7357/assets/vendor.js:65509:16)
    at Queue.flush (http://localhost:7357/assets/vendor.js:65400:13)
    at DeferredActionQueues.flush (http://localhost:7357/assets/vendor.js:65597:21)



vendredi 19 juillet 2019

Ember-Electron: Uncaught Error: Expected to find: 'service:settings

I am trying to run an open source ember-electron project: https://github.com/nano-wallet-company/nano-wallet-desktop

But it gives me the error shown in image below though I have it in my code. The same source worked back before 2 months but now it doesnt. May be there are upgrades in ember-cli I guess.

Can anyone tell me what can be the issue?

Please ignore red spots, I have renamed the repo but it is a fork of nano wallet.

Issue: enter image description here




jeudi 18 juillet 2019

In Jenkins I received the error: Could not find the default SASS implementation

In Jenkins we recently started getting the following error:

Could not find the default SASS implementation. Run the default blueprint:
   ember g ember-cli-sass
Or install an implementation such as "node-sass" and add an implementation option. For example:
   sassOptions: {implementation: require("node-sass")}

I added the sassOptions and installed ember-cli-sass and it fixed the issue on my local machine, but the app is build in a docker container and I am unsure how to run the command ember g ember-cli-sass.

Any help is greatly appreciated.

Thanks In Advanced!

    sassOptions: {implementation: require("node-sass")},
  });```




mercredi 17 juillet 2019

How can I reload a model on controller checkbox state change?

Given some checkboxes that mut a boolean, how can we automatically update the model using these booleans by querying the datastore in the route?

E.g.:

model(params) {
  return this.store.query('email', {
    filter: {
      option1: controller.checkbox1, 
      option2: controller.checkbox2, 
      option3: controller.checkbox3
    }
  })
}




mardi 16 juillet 2019

What is an effective strategy for polling in the router in Emberjs?

I need help on developing a good strategy for polling in the router. I have a route queries/:query_id/results/:result_id that I transition to whenever the user executes a query. In this I route I need to load two things: the result model that is associated with this route and a table object using the url inside the result model. The problem is, if a query is long running I need to poll and ask the server if the query is finished. Only then can I download the table. I'm using ember concurrency to do all my polling and it works great except for a small edge case. This edge case has to do with the fact that If my polling function gets canceled after it is finished and while it downloads the table, then it will get stuck saying "loading the table" because it only triggers the polling when the status of the query is not completed. I'm doing all my data loading in the result route so maybe someone can offer some alternatives to do this.

Relevant code in the result route


import Route from "@ember/routing/route";
import { inject as service } from "@ember/service";
import { reject } from "rsvp";
import { task } from "ember-concurrency";
import { encodeGetParams } from "gtweb-webapp-v2/utils";

export default Route.extend({
  poller: service("poller"),

  fetchResults: task(function*(result_id) {
    try {
      const result = yield this.store.findRecord("result", result_id);

      if (result.status === "COMPLETED") {
        const adapter = this.get("store").adapterFor("application");
        const queryString = encodeGetParams({ parseValues: true, max: 25 });

        const table = {
          table: yield adapter.fetch(
            `${result._links.table.href}?` + queryString
          )
        };

        // Cache the table that we fetched so that we dont have to fetch again if we come back to this route.
        this.store.push({
          data: [
            {
              id: result_id,
              type: "result",
              attributes: table,
              relationships: {}
            }
          ]
        });

        return true;
      }
    } catch (err) {
      return reject(err);
    }
  }),

  model(params) {
    const result = this.store.peekRecord("result", params.result_id);

    if (!result || result.status !== "COMPLETED") {
      const poller = this.get("poller");
      poller.startTask(this.get("fetchResults"), {
        pollingArgs: [params.result_id],
        onComplete: () => {
          this.refresh(); // If we finish polling or have timeout, refresh the route.
        }
      });
    }

    return result;
  },

  setupController(controller, model) {
    const query = { title: this.modelFor("queries.query").get("title") };
    controller.set("query", query);
    this._super(controller, model);
  },

  actions: {
    willTransition() {
      const poller = this.get("poller");
      poller.abort(); // Task was canceled because we are moving to a new result route.
    }
  }
});

Idea

One idea is probably creating a separate route for loading the table i.e queries/:query_id/results/:result_id/:table_id and only transition to this once the query is completed. From there I can safely load the table. Only problem I have with this is that the result route will simply be involved with loading the result. There will be no components that will be render in the result route; only in the table route.




Uncaught (in promise) when calling multiple ajax within router model

I calling multiple API endpoint within ember router model I'm using ember-cli 3.11.0 When I refresh the page, it failed to load with "Uncaught (in promise)" which point specifically in $.ajax call

import $ from 'jquery';
import { hash } from 'rsvp';

export default Route.extend(AuthenticatedRouteMixin, {
  model: function (param) {
    return hash({
      category: $.ajax({
        url: 'http://localhost:8000/catalog/category/' + param.id,
        type: 'GET'
      }).then(function(res) {
        return res;
      }),
      categories: $.ajax({
        url: 'http://localhost:8000/catalog/category',
        type: 'GET'
      }).then(function(res) {
        return res;
      })
    })
  }
});

With those codes, I want to call inside setupController something like

setupController(ctrl, model) {
   console.log(model.category);
   console.log(model.categories);
}




lundi 15 juillet 2019

Print out all of the parent and child routes in the template for Ember

Suppose I have an Ember route like the following

myApp/RouteA/RouteB/RouteC

Is there a way that I could get all the names of different route levels in either my route or controller?

The reason is because I'm trying to write an ember component that dynamically generates breadcrumbs.




how to set a parameter of a json object inside a json array in ember

I need to access and change the a boolean parameter 'SELECTED' of a json object inside a json array using ember set method, but when i tried it I got error message "Assertion Failed: Cannot call set with 'false' key". Also tried to access the data using a temp Object.

structure of JSON Array:

[
    {
        "VALUE":
            [
                {
                    "SELECTED":false,
                    "KEY":"audit_actions_added",
                    "NAME":"ADDED"
                },
                {
                    "SELECTED":false,
                    "KEY":"audit_actions_deleted",
                    "NAME":"DELETED"
                },
                {   "SELECTED":false,
                    "KEY":"audit_actions_disabled",
                    "NAME":"DISABLED"
                },
                {
                    "SELECTED":false,
                    "KEY":"audit_actions_enabled",
                    "NAME":"ENABLED"
                },
                {
                    "SELECTED":false,
                    "KEY":"audit_actions_modified",
                    "NAME":"MODIFIED"
                }
            ],
            "KEY":"",
            "NAME":"",
                            "SELECTED":false
    },
    {   
        "VALUE":
            [
                {
                    "SELECTED":false,
                    "KEY":"audit_actions_deleted",
                    "NAME":"DELETED"
                }
            ],
        "KEY":"",
        "NAME":"",
                    "SELECTED":false
    },
    {
        "VALUE":
            [
                {
                    "SELECTED":false,
                    "KEY":"audit_actions_added",
                    "NAME":"ADDED"
                },
                {
                    "SELECTED":false,
                    "KEY":"audit_actions_deleted",
                    "NAME":"DELETED"
                },
                {
                    "SELECTED":false,
                    "KEY":"audit_actions_disabled",
                    "NAME":"DISABLED"
                },
                {
                    "SELECTED":false,
                    "KEY":"audit_actions_enabled",
                    "NAME":"ENABLED"
                },
                {
                    "SELECTED":false,
                    "KEY":"audit_actions_updated",
                    "NAME":"UPDATED"
                }
            ],
        "KEY":"",
        "NAME":"",
                    "SELECTED":false
    }
]

I can get the values but can't change those in ember.




vendredi 12 juillet 2019

Ember / PostCSS / Tailwind - where do directives get parsed?

I've assembled a vanilla combination of ember, postcss, and tailwind, and for the life of me, I cannot understand why this code works.

For a generic ember app with postcss and tailwind:

ember new poc-tailwind --yarn
ember install ember-cli-postcss
yarn add tailwindcs

Then to configure postcss in ember-cli-build:

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    postcssOptions: {
      compile: {
        plugins: [
          require('tailwindcss')
        ]
      }
    }
  });

  return app.toTree();
};

And then finally in app.css:

@tailwind base;

@tailwind components;

@tailwind utilities;

Again, the strange thing is this works.

Can anyone explain why those directives are working? And how they're getting glued together?




jeudi 11 juillet 2019

How do I use the googleapis node package in Ember

I am using Ember 3.10 and made a fresh project and did npm i googleapis. I tried using ember-auto-import and ember-cli-es6-transform but neither work. All I want is for this to work:

import { google } from 'googleapis';

I did notice that Google pre-builds the package (googleapis/build/src/...). Does this mean I can just do app.import(node_modules/googleapis/...) in my ember-cli-build.js file? Any clues or tips? Am I supposed to even use the node package?




How to iteratively save child records in Ember.js?

I want to save a parent record and multiple child records to an external REST API using Ember Data. The problem I have is that I'm not sure what the best way to handle this asynchronously.

My first attempt looked something like this:

let parent = this.store.createRecord('parent');
parent.set('name', 'Bob');
parent.set('children', []);
parent.save().then(()=>{
  for (i=0;i<8;i++) {
    let child = this.store.createRecord('child');
    child.set('name', 'Child' + i);
    child.set('parent', parent);
    child.save().then(()=>{
      parent.get('children').pushObject(child);
      if (i == 7) {parent.save()}
    }
  }
})

This successfully creates the parent and all children but fails to save the ids of all children in the parent's record. Not all child.save() promises have resolved by time parent.save() is called.

I understand that RSVP is a library that can be used to resolve this problem, but I can't find any examples of its usage that make sense in context to what I'm trying to do.

Can anyone outline how I can rework this to ensure all children have been saved before attempting to save the parent?




Is there a way to create a generic Electron application with electron-builder to build multiple Ember.js projects with independent versioning?

I'm looking for a way to automate the electron builds for EmberJs build projects.

I have a pipeline where I would clone the built EmberJs-project in a specific folder in an Electron project which then uses electron-builder to generate an installer for this project.

I need to keep this electron-project generic but the usage of the package.json version for the builds and auto-updater is preventing this. Is there a way to select the Ember project version / tag for builds instead of the one specified in the electron project?

Or is there another way to add/check versions of electron builds?

I really wan't to prevent forking my base electron-project for every new EmberJs-project.

I tried adding a package.json-file in the folder where I clone my built project and specify a version there but this seems to override my electron-project package.json-file which I would like to keep using for the generic scripts and links.

in my electron package.json:

"name": "electron-launcher",
"version": "0.1.0", => needs to be independant of the builds if possible
"scripts": {
    "dist": "electron-builder -p always"
  },
...

My project structure

  • package.json (electron)
  • main.js
  • resources (folder containing EmberJS dist)



mercredi 10 juillet 2019

How come in `./node_modules/googleapis` I see a `build/src` folder instead of a `src` folder

I have this new Ember project and I installed the google node sdk via npm install googleapis --save-dev. I then installed ember-cli-es6-transform in hopes of importing the es6 modules from the google api node client.

However I noticed in ./node_modules/googleapis there is a build/src folder instead of a src folder. In the Github repo, it's just a src folder. Why is this? This is causing my imports to be wonky while using ember-cli-es6-transform.

This is all that is in my devDependencies:

  "devDependencies": {
    "broccoli-asset-rev": "^2.4.5",
    "ember-ajax": "^3.0.0",
    "ember-cli": "~3.1.4",
    "ember-cli-app-version": "^3.0.0",
    "ember-cli-babel": "^6.6.0",
    "ember-cli-dependency-checker": "^2.0.0",
    "ember-cli-es6-transform": "^1.0.0",
    "ember-cli-eslint": "^4.2.1",
    "ember-cli-htmlbars": "^2.0.1",
    "ember-cli-htmlbars-inline-precompile": "^1.0.0",
    "ember-cli-inject-live-reload": "^1.4.1",
    "ember-cli-qunit": "^4.1.1",
    "ember-cli-sass": "^10.0.1",
    "ember-cli-shims": "^1.2.0",
    "ember-cli-sri": "^2.1.0",
    "ember-cli-uglify": "^2.0.0",
    "ember-data": "~3.1.0",
    "ember-export-application-global": "^2.0.0",
    "ember-load-initializers": "^1.0.0",
    "ember-maybe-import-regenerator": "^0.1.6",
    "ember-resolver": "^4.0.0",
    "ember-source": "~3.1.0",
    "ember-welcome-page": "^3.0.0",
    "eslint-plugin-ember": "^5.0.0",
    "googleapis": "^40.0.1",
    "loader.js": "^4.2.3",
    "sass": "^1.22.2"
  },




mardi 9 juillet 2019

EmberJS computed `and` negation

I have a class with properties:

import { and, not } from '@ember/object/computed';

EmberObject.extend({
    a: false,
    notA: not('a'),

    b: true,
    c: true,
    d: and('b', 'c', 'notA')
});

So d relies on the negation of a.

Is there a notation to do something like d: and('b', 'c', '!a') so that I don't need the redundant notA property?




Ember pagination is not smooth at all (flashing)

I'm actually using ember-simple-pagination. It's works with a simple logic : -Empty the sore -Fetch data according to the actual page

The fact is that transition is not smooth at all, see by yourself : https://streamable.com/sg6sg

Is there a way to fix that ? My mind said to me that it would be a solution to fetch data first, empty the sort and then push data back to the store.

import Component from '@ember/component';
import { computed } from '@ember/object';
import { sort } from '@ember/object/computed';
import { inject as service } from '@ember/service';

export default Component.extend({
  store: service(),
  posts: computed(function() {
    return this.get('store').peekAll('post');
  }),

  pageSize: 20,
  pageNumber: null,
  recordCount: null,

  sortProps: ['createdAt:desc'],
  sortedPosts: sort('posts', 'sortProps'),

  loadPosts(getPageNumber) {
    const pageSize = this.get('pageSize');

    this.get('store').unloadAll('post');
    this.get('store').
      query('post', {page: {number: getPageNumber, size: pageSize}}).
      then((result) => {
        this.setProperties({
            'recordCount': result.get('meta.record-count'),
            'pageNumber': getPageNumber
        });
      };
  },

  init() {
    this._super(...arguments);
    this.loadPosts(1);
  },

  actions: {
    getPage(getPageNumber) {
      this.loadPosts(getPageNumber);
    }
  }
});




How to fix "Error: Token is empty. Please check your backend response." in Ember.js and Django REST Framework

I'm attempting to implement authentication in Ember.js using JSON Web Tokens generated from Django REST Framework.

Django 2.0.13 Django REST Framework 3.9.4 Django REST Simple JWT 4.3.0

I followed the example from this repository: https://github.com/jpadilla/ember-simple-auth-token

I have plugins for DRF that render and parse according to the JSON API standard, disabling them doesn't have any effect.

# urls.py
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
path("api/token/", TokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('api/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),

// config/environment.js
  ENV['ember-simple-auth-token'] = {
    refreshAccessTokens: true,
    refreshLeeway: 300, // refresh 5 minutes (300 seconds) before expiration
    serverTokenEndpoint: 'http://localhost:8000/api/token/',
    serverTokenRefreshEndpoint: 'http://localhost:8000/api/token/refresh/',
    tokenPropertyName: 'access',
  };

// adapters/application.js
import DS from 'ember-data';
import TokenAuthorizerMixin from 'ember-simple-auth-token/mixins/token-authorizer';

export default DS.JSONAPIAdapter.extend(TokenAuthorizerMixin, {
  host: 'http://localhost:8000',
  namespace: 'api',
});

// controllers/u/login.js
import Controller from '@ember/controller';
import { inject } from '@ember/service';

export default Controller.extend({
  session: inject('session'),

  actions: {
    authenticate: function() {
      const credentials = this.getProperties('username', 'password');
      const authenticator = 'authenticator:jwt';

      this.get('session').authenticate(authenticator, credentials);
    }
  }
});

<!-- templates/u/login.hbs -->
<form >
  <label for="username">Login</label>
  
  <label for="password">Password</label>
  
  <button type="submit">Login</button>
</form>

I can make a successful request using Postman to Django, and I get the JWT back.

Submitting the login form with correct credentials gives a console error: Uncaught (in promise) Error: Token is empty. Please check your backend response.




lundi 8 juillet 2019

EmberJS Mirage Dependent attributes do not update on patch

I have declared a properties in a Mirage factory as below and using Dependent attributes as found in the docs.

price() {
  return faker.finance.amount(100000, null, 0);
},

priceDisplay() {
  return '$' + this.price;
}

When I do a patch to update price I expect priceDisplay to update as well like a computed property however this is not the case.

Does anyone know if this is possible or is this a Mirage limitation?




Compilation error when deploying my Ember/Rails app

I have a rails 5 ember 2.17 app that was previously being successfully deployed in production. The deployment is done with ember-cli-rails.

During asset compilation I have the following error :

=================================================================================

ENV Summary:

  TIME: Mon Jul 08 2019 15:40:33 GMT+0200 (CEST)
  TITLE: ember
  ARGV:
  - /usr/bin/node
  - /srv/production/www/placedemarche/releases/20190708133545/marketadmin/node_modules/ember-cli/bin/ember
  - build
  - --environment
  - production
  - --output-path
  - /srv/production/www/placedemarche/releases/20190708133545/tmp/ember-cli/apps/marketadmin
  EXEC_PATH: /usr/bin/node
  TMPDIR: /tmp
  SHELL: /bin/bash
  PATH:
  - /srv/production/www/placedemarche/shared/bundle/ruby/2.4.0/bin
  - /home/admin/.rvm/gems/ruby-2.4.1/bin
  - /home/admin/.rvm/gems/ruby-2.4.1@global/bin
  - /home/admin/.rvm/rubies/ruby-2.4.1/bin
  - /home/admin/.rvm/bin
  - /usr/local/sbin
  - /usr/local/bin
  - /usr/sbin
  - /usr/bin
  - /sbin
  - /bin
  - /usr/games
  - /usr/local/games
  PLATFORM: linux x64
  FREEMEM: 1093439488
  TOTALMEM: 3149369344
  UPTIME: 16758723
  LOADAVG: 0.8134765625,0.71240234375,0.56201171875
  CPUS:
  - Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz - 2200
  - Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz - 2200
  - Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz - 2200
  - Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz - 2200
  - Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz - 2200
  - Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz - 2200
  ENDIANNESS: LE
  VERSIONS:
  - ares: 1.10.1-DEV
  - http_parser: 2.8.0
  - icu: 58.2
  - modules: 48
  - napi: 3
  - node: 6.14.3
  - openssl: 1.0.2o
  - uv: 1.16.1
  - v8: 5.1.281.111
  - zlib: 1.2.11

ERROR Summary:

  - broccoliBuilderErrorStack: [undefined]
  - code: [undefined]
  - codeFrame: [undefined]
  - errorMessage: Unexpected identifier
  - errorType: [undefined]
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
  - message: Unexpected identifier
  - name: SyntaxError
  - nodeAnnotation: [undefined]
  - nodeName: [undefined]
  - originalErrorMessage: [undefined]
  - stack: /srv/production/www/placedemarche/releases/20190708133545/marketadmin/node_modules/@embroider/core/src/to-broccoli-plugin.js:18
        async build() {
              ^^^^^

SyntaxError: Unexpected identifier
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/srv/production/www/placedemarche/releases/20190708133545/marketadmin/node_modules/@embroider/core/src/index.js:9:28)

=================================================================================


I am not sure what's the next step to solve this problem.




how to get data from controller in ember JS?

i have a controller which fetches data from servlet like this:

import Ember from 'ember';

export default Ember.Controller.extend({


fetch : function(){

Ember.$.get('http://localhost:8080/getdata', function(data)
    {
         var json = JSON.parse(data);
    }

}.on('init')
});

how to print this data on a template? I'm not using ember data or models. The data from servlet is returned as json string.




Unable to play large m4a audio file using wavesurfer

I am trying to develop a UI for editing a audio file using wavesurfer.js. I am adding this as feature to the existing ember application. On loading large audio files of m4a format, I received an error: error-handler.js:63 Error decoding audiobuffer Uncaught (in promise) DOMException

Its working very well in firefox and its working in chrome(if i use plain javascript). And its working in both browsers when tested with a new ember application. Its only a problem with the current ember application and that too only in chrome.

Error decoding audio buffer Uncaught (in promise) DOMException




dimanche 7 juillet 2019

No transition when using ember liquid fire

I have an ember project and I have install ember liquid fire for transitions when switching routes.

Ember liquid fire

So its installed and I have made 3 routes in my router.js

Router.map(function()
{
    this.route('home', {path: '/'});
    this.route('home');
    this.route('history');
    this.route('projects');
});

After installing, a transitions.js file has appeared, so I put 2 transitions in there like the documentation says to do

export default function()
{
    this.transition(
        this.fromRoute('home'),
        this.toRoute('history'),
        this.use('toLeft'),
        this.reverse('toRight')
    );

    this.transition(
        this.fromRoute('history'),
        this.toRoute('projects'),
        this.use('toLeft'),
        this.reverse('toRight')
    );
}

Then on each route/page .hbs file I add

<h2 class="test-title"> home page! </h2>
Home
History
Projects


I replace home page with whatever route/ page it is

Then I run and it navigates between pages intantly with no transition. No errors either, im not sure what im doing wrong

Any help is appriciated




vendredi 5 juillet 2019

In tabulator AJAX call(on CELLEDITED) and addRow() functionaliry cursor is always moving to the first row and first cell

In Tabulator in celledited() function, after ajax call always the cursor is moving to the first row first coulumn.

I have tried with available tabulator api, nothing is working. table.navigateNext() cell.getElement().focus();

table = new Tabulator("#example-table", {
            data:self.get('tableData'),
            selectable:1,
            height:"auto",
            columns:self.get('tableColumnData'),
            keybindings:true,

            cellEdited:function(cell){                  
                self.cellBlur(cell, row,value, self.get("testData"));
            },
        });        

   },
   cellBlur: function(cell, row, value, testData){
        self.send('execute',value,id,row); 
        //table.scrollToColumn(cell.getField(), "middle", false);
        //console.log("cell nav right1 "+cell.getField())
        //if(cell.getField() === "NAME"){
        //cell.nav().right();
        //self.get('table').navigateNext();
        //}

    },
    actions: {
     self.get('services').fetch(self.get('services').getModuleUrl('TEST'), 'controller/test', requestdto, 'POST').then(function (json) {
                    if (json !== null && json.data !== null) {
        execute: function (value, eventId, fieldName) {                                                                                     

                           self.get('table').updateOrAddRow(rowIndex,tempObj).then(function(row){
                                                                console.log("pring updateOrAddRow ....");
                                                                var cell = row.getCell("ACCNAME");
                                                                cell.getElement().focus();
                                                        })
                                                        .catch(function(error){
                                                        });
        }
        }
        },

enter image description here In the above image 1.once I enter STUDENT ID, cellEdited() function is calling, inside this by making AJAX call I am fetching the student name based on ID and populating the name -in the second column. 2.After I enter the tab the cursor is moving to the STUDENT ID column instead of STUDENT MARKS column. 3. In the second row once I enter the student id and the tab, the name is populating in the second column, if I give the next tab the cursor is moving to the first row first cell.

Not sure which part of the code is causing this issue, it might be due to onblur ajax call or addRow functionality.

Your suggestions are highly appreciated.




jeudi 4 juillet 2019

How to run my node script as one of the ember's build tasks?

I am working in an ember application. From what I understood, it builds the application using Broccoli. I have a requirement where I need to process some files in the application by running a node script before the building process starts. Now I am running the node script separately and then I start the ember server. What is the right way to achieve it? Can I make it as one of the tasks during ember build process? Where should I maintain the node file in the directory?




Use constant for Ember computed property dependent key

For an Ember app, is it possible to use a constant as part of a computed property key ?

So, essentially, I have a constant as below;

MY_SECTION {
MY_FIELD: "my-field-id"
}

What I want is a computed property on "my-field-id" i.e.

myCP: function() {
console.log('Inside CP...');
}.property('section.field.my-field-id.value')

However, I want to be able to use constant for my-field-id instead of using it directly. Is that possible ?




In Ember.js IOS Cordova Building App Not Working?

when I add the ios platform in ember.js by using cordova comand.

  • ember cdv:platform add ios

Adding platform in my project is ok.

Then I tried to build by using this command.

  • ember cdv:build --platform=ios

Now showing error. I tried a lot of things and by using this command too.

  • ember cdv:build --platform=ios --buildFlag='-UseModernBuildSystem=0'

Not working.

Error showing this only.

enter image description here




mercredi 3 juillet 2019

Find nested property from ember lodash and pick the value

I am new to javascript.

I would like to check whether the specific nested property is present or not in an array of items, ex)

[{
    "_id" : ObjectId("5c4ec057e21b840001968d31"),
    "status" : "ACTIVE",
    "customerId" : "sample-book",
    "bookInfo" : {
        "bookChunks" : [ 
            {
                "key" : "Name",
                "value" : "test"
            }, 
            {
                "key" : "Surname1",
                "value" : "testtt"
            }, 
            {
                "key" : "user-contact",
                "value" : "sample-value",
                "ContactList" : {
                    "id" : "sample-id",
                    "timeStamp" : "Tue, 20 Sep 2016 07:49:25 +0000",
                    "contacts" : [ 
                        {
                            "id" : "contact-id1",
                            "name" : "Max Muller",
                            "phone_number" : "+XXXXXXX"
                        }, 
                        {
                            "id" : "contact-id2",
                            "name" : "Max Muller",
                            "phone_number" : "+XXXXXXX"
                        }
                    ]
                }
            }
        ]
    }
},
{
    "_id" : ObjectId("5c4ec057e21b840001968d32"),
    "status" : "ACTIVE",
    "customerId" : "sample-book1",
    "bookInfo" : {
        "bookChunks" : [ 
            {
                "key" : "Name",
                "value" : "test"
            }, 
            {
                "key" : "Surname1",
                "value" : "testtt"
            }
        ]
    }
}]

Here, I would like to find whether any item has ContactList or contacts present. If it is present take the item and put it in a separate list.

I am using ember-lodash. Using normal javascript or lodash would be fine for me. Any help will be really appreciated.




mardi 2 juillet 2019

Editor Error - No such editor found: dateEditor in tabulator code

I am using tabulator code in ember js, to build editable table. Here I need a formatter for date(http://tabulator.info/examples/4.2 -- Editable data), as per the example given in tabulator api I have tried, here I am getting Editor Error - No such editor found: dateEditor.

I am assigning the dateEditor for the column as below at run time. I have tried like below this also editor: "dateEditor(cell, onRendered, success, cancel)" getting same error.

columnMap = 
{ 
align: "center", editor: "dateEditor"
}

var dateEditor = function(cell, onRendered, success, cancel){
    //cell - the cell component for the editable cell
    //onRendered - function to call when the editor has been rendered
    //success - function to call to pass the successfuly updated value to Tabulator
    //cancel - function to call to abort the edit and return to a normal cell

    //create and style input
    var cellValue = moment(cell.getValue(), "DD/MM/YYYY").format("YYYY-MM-DD"),
    input = document.createElement("input");

    input.setAttribute("type", "date");

    input.style.padding = "4px";
    input.style.width = "100%";
    input.style.boxSizing = "border-box";

    input.value = cellValue;

    onRendered(function(){
        input.focus();
        input.style.height = "100%";
    });

    function onChange(){
        if(input.value != cellValue){
            success(moment(input.value, "YYYY-MM-DD").format("DD/MM/YYYY"));
        }else{
            cancel();
        }
    }

    //submit new value on blur or change
    input.addEventListener("blur", onChange);

    //submit new value on enter
    input.addEventListener("keydown", function(e){
        if(e.keyCode == 13){
            onChange();
        }

        if(e.keyCode == 27){
            cancel();
        }
    });

    return input;
};

Could some please help me how to call customEditor in tabulator code.




How to refresh token with different endpoint?

I have an Ember app in which I use ember-simple-auth for authentication. My backend is structure in a way that the endpoint for authorization is different from the endpoint for refreshing.

How can I specify a different endpoint for refreshing? So far, I only found serverTokenEndpoint which specifies both auth and refreshing endpoints at once.




I am getting the following error while creating the ember application through cmd

I am trying to create an ember application through command prompt

i installed Nodejs version v10.16.0 and then i use the command 'install npm install -g ember -cli' to install ember

ember successfully insatalled with version ember-cli 3.10.1 then i create a new application by using command 'ember new ember-quickstart' then i got the below error

Error creating new application. Removing generated directory ./kushi Command failed: npm install --loglevel error npm WARN deprecated @babel/polyfill@7.4.4: 🚨 As of Babel 7.4.0, this npm WARN deprecated package has been deprecated in favor of directly npm WARN deprecated including core-js/stable (to polyfill ECMAScript npm WARN deprecated features) and regenerator-runtime/runtime npm WARN deprecated (needed to use transpiled generator functions): npm WARN deprecated npm WARN deprecated > import "core-js/stable"; npm WARN deprecated > import "regenerator-runtime/runtime"; npm WARN deprecated exists-sync@0.0.4: Please replace with usage of fs.existsSync npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\broccoli-rollup-93db1951\dist\index.d.ts' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\broccoli-rollup-93db1951\dist\index.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-typescript-b54d1b7c\js\blueprints\ember-cli-typescript\index.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-typescript-b54d1b7c\js\lib\commands\clean.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-typescript-b54d1b7c\js\lib\commands\precompile.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-typescript-b54d1b7c\js\lib\utilities\copy-declarations.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-typescript-b54d1b7c\js\lib\utilities\ember-cli-entities.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-typescript-b54d1b7c\js\lib\utilities\fork.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-typescript-b54d1b7c\blueprint-files\ember-cli-typescript__config_root__\config\environment.d.ts' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-typescript-b54d1b7c\blueprint-files\ember-cli-typescript\types__app_name__\index.d.ts' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-5cfc18ea\blueprints\module-unification-app\files\src\ui\routes\application\template.hbs' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-5cfc18ea\lib\tasks\server\middleware\broccoli-watcher\index.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-5cfc18ea\lib\tasks\server\middleware\broccoli-watcher\package.json' npm WARN tar ENOENT: no such file or directory, lstat 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-5cfc18ea\lib\tasks\server\middleware' npm WARN tar ENOENT: no such file or directory, lstat 'C:\Users\kagrawal.EMEAAD\Desktop\kushi\node_modules.staging\ember-cli-5cfc18ea\lib' npm ERR! code ERR_INVALID_OPT_VALUE npm ERR! The value "false" is invalid for option "readableHighWaterMark" npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\kagrawal.EMEAAD\AppData\Roaming\npm-cache_logs\2019-07-02T09_36_58_880Z-debug.log Stack Trace and Error Report: C:\Users\KAGRAW~1.EME\AppData\Local\Temp/error.dump.4edeef2bba53a9733909115d695aa4ba.log

can someone help me to resolve the error.




How to include an ember app inside a jsp file and serve it using tomcat

I am new to ember. I am having an ember app which I could run using ember serve and see the output. I want to include this app in a jsp file and run the whole app from tomcat server (i.e., port 8080). I saw in some posts that including handlebars and routes in jsp is possible but I'm unable to get a proper tutorial for it. please help me with these!!