Open pjdicke opened 8 years ago
Could you verify that these defaults are being set in the production
environment?
Here is my current config:
module.exports = function(environment) {
var ENV = {
contentSecurityPolicy: {
'default-src': "'none'",
'script-src': "'self' *",
'font-src': "'self'",
'connect-src': "'self' *",
'img-src': "'self'",
'style-src': "'self' *",
'media-src': "'self'"
},
modulePrefix: 'clfs-app',
environment: environment,
baseURL: '/clweb/CLFSAdminNew/',
rootURL: '/clweb/CLFSAdminNew/',
locationType: 'hash',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
}
},
flashMessageDefaults: {
sticky: true,
preventDuplicates: true
},
APP: {
imgSrc : '/clweb/apps/clfs/assets/images/'
// Here you can pass flags/options to your application instance
// when it is created
}
};
if (environment === 'development') {
// ENV.APP.LOG_RESOLVER = true;
// ENV.APP.LOG_ACTIVE_GENERATION = true;
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
// ENV.APP.LOG_VIEW_LOOKUPS = true;
ENV.APP.imgSrc = 'assets/images/';
}
if (environment === 'test') {
// Testem prefers this...
ENV.baseURL = '/';
ENV.locationType = 'none';
// keep test console output quieter
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.rootElement = '#ember-testing';
}
if (environment === 'production') {
ENV.baseURL = '/clweb/CLFSAdminNew/';
}
return ENV;
};
I have tried the following for production
:
if (environment === 'production') {
ENV.baseURL = '/clweb/CLFSAdminNew/';
ENV.flashMessageDefaults = {
sticky: true,
preventDuplicates: true
};
}
No dice.
Thanks for the detailed response! That's very odd, I don't do any environment checking in this addon. Could you please show me what the properties defined on your service looks like? If you open the ember-inspector in the production app you should be able to see something like this in the Container > service > flash-messages
panel:
From production env/mode.
I don't think this has anything to do with the environment. I'm seeing sticky: true
ignored in all environments.
And, of course, as soon as I posted that it started working in all environments. Never mind. sigh
It only gets picked up when running ember serve but not for builds in my case.
Do you see anything that I might be doing wrong?
It's been awhile and figured I would check in on this issue. Any progress on wiring up the configuration overwrites correctly? I just had to do a new build on a new machine which pulled down a new copy of your addon which obviously wouldn't have my "hack" fix in the addonDefaults config obj.
I have been having the same issue. Once I think it works, it breaks again… Warning type was working fine, just not error.
I want the messages to be sticky and this works fine when developing but when I run
ember build --environment production
the prod version isn't sticky.I'm not overwriting this config anywhere else.