I have 2 routes /main and /home. Both should show the same HTML content. Is it possible to point both the routes to the same hbs file?
vendredi 22 juillet 2022
jeudi 21 juillet 2022
Visual Studio Code marks each line of all files red
I am having the latest version of Visual Studio code.
Version: 1.69.2 (user setup)
Commit: 3b889b090b5ad5793f524b5d1d39fda662b96a2a
Date: 2022-07-18T16:12:52.460Z
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Windows_NT x64 10.0.19042
I am using Ember.js projects. Whenever I am opening any file, it is marking each and every line as red.
Native JS classes should be used instead of classic classes eslintember/no-classic-classes
I tried uninstall/ install VS Code (also I completely uninstalled and then installed again) but nothing helpled
Asap I try install my usual extensions it starts giving trouble.
mercredi 20 juillet 2022
Chrome launcher not installed on Jenkins
I have a problem with running ember test on Jenkins, i am currently trying to generate a code coverage report for my app using ember-cli-code-coverage and locally everything works fine with running COVERAGE=true ember test but when i run the same command in Jenkins, i got Launcher Chrome not found. Not installed? i also try to run ember test in ci mode and i got the same error
This is testem.js
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: ['Chrome'],
launch_in_dev: ['Chrome'],
browser_start_timeout: 120,
browser_args: {
Chrome: {
ci: [
// --no-sandbox is needed when running Chrome inside a container
process.env.CI ? '--no-sandbox' : null,
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage',
'--mute-audio',
'--window-size=1440,900',
'--remote-debugging-port=9222',
'--remote-debugging-address=0.0.0.0',
'--no-sandbox',
'--user-data-dir=/tmp',
].filter(Boolean),
},
},
};
any idea how i can fix this ?
Screenshot of Jenkins errors
[1]: https://i.stack.imgur.com/HlYKQ.png
using watchman only on specific project
I am running 2 ember applications on my computer.
On one of them I want watchman to run (to solve EMFILE: too many open files, watch),
on the other project I do not want it to run - since it causes an error (TypeError: Invalid Version: 2022.06.27.00)
Is there a way to configure watchman to run/ not run on specific projects?
mardi 19 juillet 2022
Ember Ajax request doesn't wait for the response
Here I'm calling an AJAX request with this "Security.createAuthenticatedAjaxRequest(session, URL)" method and I want to return the response of that request. But, it seems like the response doesn't wait until the request completes. It returns undefined as the response. I think it's because it returns the response before ajax request completes.
function minAndMaxGradeAllowedRequest(session) { if (Common.isEmpty(minAndMaxGradeAllowed)) {
Security.createAuthenticatedAjaxRequest(session, URL).then(function(minAndMaxGradeAllowedResponse) {
minAndMaxGradeAllowed = minAndMaxGradeAllowedResponse;
}).fail(function(error) {
LOGGER('Failed to find Shaywitz Min and Max grades information', error.toString());
}); } return minAndMaxGradeAllowed; }
createAuthenticatedAjaxRequest: function(session, url, config){
if(Common.isEmpty(config)) {
config = {};
}
return this.createAuthenticatedAjaxRequestWithAcceptHeaderParam(session, url, config, true);
},
createAuthenticatedAjaxRequestWithAcceptHeaderParam: function(session, url, config, isAcceptRequired){
if(Common.isEmpty(config)) {
config = {};
}
if(Common.isEmpty(config.headers)) {
config.headers = {};
}
config.headers['Authorization'] = 'Bearer ' + session.get('data.authenticated.access_token');
if(!Common.isEmpty(isAcceptRequired) && isAcceptRequired === true) {
config.headers['Accept'] = 'application/json';
}
if(Common.isNotEmpty(session.get('data.authenticated.supportuser'))){
config.headers['supportuser'] = session.get('data.authenticated.supportuser');
}
return Ember.$.ajax(url, config);
},
Below is the code where it uses the response of the function minAndMaxGradeAllowedRequest(session).
let minAndMaxGradeAllowed = ShaywitzGradesAllowed.getMinAndMaxGradeAllowed(this.get('session'));
I don't have much experience with Ember js. Can someone please help me to solve this problem?
mercredi 6 juillet 2022
Ember js, in heroku production, live reload fails to load and time out and loading spinner keeps spinning
I just deployed a simple side project using ember and rails. Evenything is good but when first enter the webpage, the browser loading spinner keeps spinning.
I checked on the console and it has an error saying fetching ember cli live reload has timed out.
This does not happen on local and live reload works fine on local. How can I fix this?
Thanks!
vendredi 1 juillet 2022
Ember-table shows index on the header
I am using ember-table but have a weird behavior. It automatically adds index next to my header title.

But after I click one of the header to sort the table, the index will disappear as I want. How do I get rid of the index in the first place. Plus, without the sorting function, the table was normal.
After I click anyone of the header to sort the column, the index will go away.

Here is my sort object
sorts = [
{ valuePath: 'username' },
{ valuePath: 'total_assignment_count' },
{ valuePath: 'accepted_assignment_count' },
{ valuePath: 'accepted_rate' },
{ valuePath: 'acl_name' },
{ valuePath: 'repo_name'}
];
template
<EmberTable as |t|>
<t.head
@columns=
@sorts=
@onUpdateSorts=
/>
<t.body @rows= />
</EmberTable>