Skip to content

Commit

Permalink
[ADF-4594] e2e configuration to disable animations (Alfresco#4760)
Browse files Browse the repository at this point in the history
* e2e environment

* configuration fixes

* update dist configuration

* use e2e configuration on travis
  • Loading branch information
DenysVuika authored and eromano committed Jun 26, 2019
1 parent 5c07d5b commit f99b943
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 10 deletions.
32 changes: 30 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,32 @@
"with": "demo-shell/src/environments/environment.prod.ts"
}
]
},
"e2e": {
"fileReplacements": [
{
"replace": "demo-shell/src/environments/environment.ts",
"with": "demo-shell/src/environments/environment.e2e.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "dist:build",
"port": 3000
"host": "0.0.0.0",
"port": 3000,
"proxyConfig": "demo-shell/proxy.conf.js",
"disableHostCheck": true
},
"configurations": {
"production": {
"browserTarget": "dist:build:production"
},
"e2e": {
"browserTarget": "dist:build:e2e"
}
}
},
Expand Down Expand Up @@ -352,18 +366,32 @@
"with": "demo-shell/src/environments/environment.prod.ts"
}
]
},
"e2e": {
"fileReplacements": [
{
"replace": "demo-shell/src/environments/environment.ts",
"with": "demo-shell/src/environments/environment.e2e.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "dev:build",
"port": 3000
"host": "0.0.0.0",
"port": 3000,
"proxyConfig": "demo-shell/proxy.conf.js",
"disableHostCheck": true
},
"configurations": {
"production": {
"browserTarget": "dev:build:production"
},
"e2e": {
"browserTarget": "dev:build:e2e"
}
}
},
Expand Down
5 changes: 3 additions & 2 deletions demo-shell/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { FormsModule } from '@angular/forms';
import { FlexLayoutModule } from '@angular/flex-layout';
import { ChartsModule } from 'ng2-charts';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';

import { AppConfigService, TRANSLATION_PROVIDER, DebugAppConfigService, CoreModule, CoreAutomationService } from '@alfresco/adf-core';
import { ExtensionsModule } from '@alfresco/adf-extensions';
Expand Down Expand Up @@ -90,6 +90,7 @@ import { CommunityStartTaskCloudDemoComponent } from './components/cloud/communi
import { CommunityProcessDetailsCloudDemoComponent } from './components/cloud/community/community-process-details-cloud.component';
import { CommunityProcessesCloudDemoComponent } from './components/cloud/community/community-processes-cloud.component';
import { CommunityTaskDetailsCloudDemoComponent } from './components/cloud/community/community-task-details-cloud.component';
import { environment } from '../environments/environment';

import { registerLocaleData } from '@angular/common';
import localeFr from '@angular/common/locales/fr';
Expand Down Expand Up @@ -129,7 +130,7 @@ registerLocaleData(localeSv);
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule,
ReactiveFormsModule,
routing,
FormsModule,
Expand Down
21 changes: 21 additions & 0 deletions demo-shell/src/environments/environment.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export const environment = {
production: false,
e2e: true
};
3 changes: 2 additions & 1 deletion demo-shell/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
*/

export const environment = {
production: true
production: true,
e2e: false
};
3 changes: 2 additions & 1 deletion demo-shell/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
// The list of which env maps to which file can be found in `.angular-cli.json`.

export const environment = {
production: false
production: false,
e2e: false
};
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
"stylelint": "stylelint ./**/*.scss --config stylelint-config.json",
"04": "echo -------------------------------------------- Demo Shell -----------------------------------------------",
"04s": "",
"start": "ng lint dist && npm run validate-config && npm run server-versions && ng serve dist --host 0.0.0.0 --proxy-config ./demo-shell/proxy.conf.js --open",
"start:dev": "ng lint dev && npm run validate-config && npm run server-versions && concurrently \"ng serve dev --host 0.0.0.0 --disable-host-check --proxy-config ./demo-shell/proxy.conf.js --open\" \"npm run style:dev --watch\" ",
"start:dist": "ng lint dist && npm run validate-config && npm run server-versions && ng serve dist --prod --host 0.0.0.0 --disable-host-check --proxy-config ./demo-shell/proxy.conf.js --open",
"start": "ng lint dist && npm run validate-config && npm run server-versions && ng serve dist --open",
"start:dev": "ng lint dev && npm run validate-config && npm run server-versions && concurrently \"ng serve dev --open\" \"npm run style:dev --watch\" ",
"start:dist": "ng lint dist && npm run validate-config && npm run server-versions && ng serve dist --prod --open",
"build": "npm run validate-config && npm run server-versions && ng build dist",
"build:dev": "npm run validate-config && npm run style:dev && npm run server-versions && ng build dev",
"build:dist": "npm run validate-config && npm run server-versions && node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build dist --prod ",
"build:dist": "npm run validate-config && npm run server-versions && node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build dist --prod --stats-json ",
"build:dist:e2e": "npm run validate-config && npm run server-versions && node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build dist --prod --configuration=e2e --stats-json ",
"style:dev": "npm run webpack -- --config ./lib/config/webpack.style.js --progress --profile --bail",
"test": "npm run validate-config && ng test dev --watch=false",
"server-versions": "rimraf ./demo-shell/src/versions.json && npm list --depth=0 --json=true --prod=true > ./demo-shell/src/versions.json || exit 0",
Expand Down

0 comments on commit f99b943

Please sign in to comment.