mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Merge branch 'development' into dev-denys-70
This commit is contained in:
@@ -3,12 +3,16 @@
|
|||||||
[](https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[](https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a title='Build Status' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
<a title='Build Status Travis' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
||||||
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
||||||
Status' />
|
Status' />
|
||||||
</a>
|
</a>
|
||||||
|
<a title='Build Status AppVeyor' href="https://ci.appveyor.com/project/alfresco/alfresco-ng2-components">
|
||||||
|
<img src='https://ci.appveyor.com/api/projects/status/github/Alfresco/alfresco-ng2-components' alt='travis
|
||||||
|
Status' />
|
||||||
|
</a>
|
||||||
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
||||||
<img src='https://img.shields.io/codecov/c/github/codecov/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
<img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
||||||
</a>
|
</a>
|
||||||
<a href='https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE'>
|
<a href='https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE'>
|
||||||
<img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />
|
<img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />
|
||||||
|
35
appveyor.yml
Normal file
35
appveyor.yml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Test against this version of Node.js
|
||||||
|
environment:
|
||||||
|
nodejs_version: "5"
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
- COMPONENT_NAME: ng2-alfresco-core
|
||||||
|
- COMPONENT_NAME: ng2-alfresco-datatable
|
||||||
|
- COMPONENT_NAME: ng2-alfresco-documentlist
|
||||||
|
- COMPONENT_NAME: ng2-alfresco-login
|
||||||
|
- COMPONENT_NAME: ng2-alfresco-search
|
||||||
|
- COMPONENT_NAME: ng2-alfresco-upload
|
||||||
|
- COMPONENT_NAME: ng2-alfresco-viewer
|
||||||
|
|
||||||
|
# Install scripts. (runs after repo cloning)
|
||||||
|
install:
|
||||||
|
# Get the latest stable version of Node.js or io.js
|
||||||
|
- ps: Install-Product node $env:nodejs_version
|
||||||
|
# install module
|
||||||
|
- IF %COMPONENT_NAME% NEQ ng2-alfresco-core (cd ng2-components/ng2-alfresco-core && npm install && npm link && cd ../../)
|
||||||
|
- IF %COMPONENT_NAME% EQU ng2-alfresco-documentlist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
|
||||||
|
- cd ng2-components/%COMPONENT_NAME%
|
||||||
|
- IF %COMPONENT_NAME% NEQ ng2-alfresco-core (npm link ng2-alfresco-core)
|
||||||
|
- IF %COMPONENT_NAME% EQU ng2-alfresco-documentlist (npm link ng2-alfresco-datatable)
|
||||||
|
- npm install
|
||||||
|
|
||||||
|
# Post-install test scripts.
|
||||||
|
test_script:
|
||||||
|
# Output useful info for debugging.
|
||||||
|
- node --version
|
||||||
|
- npm --version
|
||||||
|
# run tests
|
||||||
|
- npm test
|
||||||
|
|
||||||
|
# Don't actually build.
|
||||||
|
build: off
|
@@ -46,17 +46,26 @@ export class LoginDemoComponent {
|
|||||||
|
|
||||||
toggleECM(checked) {
|
toggleECM(checked) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
this.providers[0] = 'ECM';
|
this.providers.push('ECM');
|
||||||
} else {
|
} else {
|
||||||
this.providers[0] = '';
|
this.removeElement('ECM');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleBPM(checked) {
|
toggleBPM(checked) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
this.providers[1] = 'BPM';
|
this.providers.push('BPM');
|
||||||
} else {
|
} else {
|
||||||
this.providers[1] = '';
|
this.removeElement('BPM');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
removeElement(el: string) {
|
||||||
|
for (let i = 0; i < this.providers.length; i++) {
|
||||||
|
if (this.providers[i] === el) {
|
||||||
|
this.providers.splice(i, 1);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,12 +1,16 @@
|
|||||||
# Alfresco Angular 2 Components
|
# Alfresco Angular 2 Components
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a title='Build Status' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
<a title='Build Status Travis' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
||||||
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
||||||
Status' />
|
Status' />
|
||||||
</a>
|
</a>
|
||||||
|
<a title='Build Status AppVeyor' href="https://ci.appveyor.com/project/alfresco/alfresco-ng2-components">
|
||||||
|
<img src='https://ci.appveyor.com/api/projects/status/github/Alfresco/alfresco-ng2-components' alt='travis
|
||||||
|
Status' />
|
||||||
|
</a>
|
||||||
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
||||||
<img src='https://img.shields.io/codecov/c/github/codecov/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
<img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
||||||
</a>
|
</a>
|
||||||
<a href='https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE'>
|
<a href='https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE'>
|
||||||
<img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />
|
<img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />
|
||||||
|
@@ -1,12 +1,16 @@
|
|||||||
# Alfresco Angular2 Components core
|
# Alfresco Angular2 Components core
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a title='Build Status' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
<a title='Build Status Travis' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
||||||
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
||||||
Status' />
|
Status' />
|
||||||
</a>
|
</a>
|
||||||
|
<a title='Build Status AppVeyor' href="https://ci.appveyor.com/project/alfresco/alfresco-ng2-components">
|
||||||
|
<img src='https://ci.appveyor.com/api/projects/status/github/Alfresco/alfresco-ng2-components' alt='travis
|
||||||
|
Status' />
|
||||||
|
</a>
|
||||||
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
||||||
<img src='https://img.shields.io/codecov/c/github/codecov/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
<img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
||||||
</a>
|
</a>
|
||||||
<a href='https://www.npmjs.com/package/ng2-alfresco-core'>
|
<a href='https://www.npmjs.com/package/ng2-alfresco-core'>
|
||||||
<img src='https://img.shields.io/npm/dt/ng2-alfresco-core.svg' alt='npm downloads' />
|
<img src='https://img.shields.io/npm/dt/ng2-alfresco-core.svg' alt='npm downloads' />
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
||||||
"test-browser": "karma start karma.conf.js --reporters kjhtml ",
|
"test-browser": "karma start karma.conf.js --reporters kjhtml ",
|
||||||
"posttest": "node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
"posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
||||||
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build",
|
||||||
"travis": "echo 'placeholder'"
|
"travis": "echo 'placeholder'"
|
||||||
|
@@ -84,13 +84,18 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
return keys[i] || null;
|
return keys[i] || null;
|
||||||
});
|
});
|
||||||
|
|
||||||
service = injector.get(AlfrescoAuthenticationService);
|
// service = injector.get(AlfrescoAuthenticationService);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the setting is ECM', () => {
|
describe('when the setting is ECM', () => {
|
||||||
|
|
||||||
it('should create an AlfrescoAuthenticationECM instance', (done) => {
|
it('should create an AlfrescoAuthenticationECM instance', (done) => {
|
||||||
let providers = ['ECM'];
|
let providers = ['ECM'];
|
||||||
|
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise').and.returnValue(fakePromiseECM);
|
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise').and.returnValue(fakePromiseECM);
|
||||||
|
|
||||||
service.login('fake-username', 'fake-password', providers)
|
service.login('fake-username', 'fake-password', providers)
|
||||||
@@ -106,6 +111,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should return an ECM token after the login done', (done) => {
|
it('should return an ECM token after the login done', (done) => {
|
||||||
let providers = ['ECM'];
|
let providers = ['ECM'];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise').and.returnValue(fakePromiseECM);
|
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise').and.returnValue(fakePromiseECM);
|
||||||
|
|
||||||
service.login('fake-username', 'fake-password', providers)
|
service.login('fake-username', 'fake-password', providers)
|
||||||
@@ -119,6 +128,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should return token undefined when the credentials are wrong', (done) => {
|
it('should return token undefined when the credentials are wrong', (done) => {
|
||||||
let providers = ['ECM'];
|
let providers = ['ECM'];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise')
|
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise')
|
||||||
.and.returnValue(Promise.reject('fake invalid credentials'));
|
.and.returnValue(Promise.reject('fake invalid credentials'));
|
||||||
|
|
||||||
@@ -137,7 +150,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should return an error if no provider are defined calling the login', (done) => {
|
it('should return an error if no provider are defined calling the login', (done) => {
|
||||||
let providers = [];
|
let providers = [];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
service.login('fake-username', 'fake-password', providers)
|
service.login('fake-username', 'fake-password', providers)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
(res) => {
|
(res) => {
|
||||||
@@ -153,7 +169,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should return an error if an empty provider are defined calling the login', (done) => {
|
it('should return an error if an empty provider are defined calling the login', (done) => {
|
||||||
let providers = [''];
|
let providers = [''];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
service.login('fake-username', 'fake-password', providers)
|
service.login('fake-username', 'fake-password', providers)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
(res) => {
|
(res) => {
|
||||||
@@ -161,7 +180,7 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
},
|
},
|
||||||
(err: any) => {
|
(err: any) => {
|
||||||
expect(err).toBeDefined();
|
expect(err).toBeDefined();
|
||||||
expect(err).toEqual('No providers defined');
|
expect(err.message).toEqual('Wrong provider defined');
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -169,6 +188,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should return a token undefined after logout', (done) => {
|
it('should return a token undefined after logout', (done) => {
|
||||||
let providers = ['ECM'];
|
let providers = ['ECM'];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
localStorage.setItem('token-ECM', 'fake-post-token-ECM');
|
localStorage.setItem('token-ECM', 'fake-post-token-ECM');
|
||||||
service.createProviderInstance(providers);
|
service.createProviderInstance(providers);
|
||||||
spyOn(AlfrescoAuthenticationECM.prototype, 'getDeleteTicketPromise').and.returnValue(fakePromiseECM);
|
spyOn(AlfrescoAuthenticationECM.prototype, 'getDeleteTicketPromise').and.returnValue(fakePromiseECM);
|
||||||
@@ -184,6 +207,11 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return an error if no provider are defined calling the logout', (done) => {
|
it('should return an error if no provider are defined calling the logout', (done) => {
|
||||||
|
let providers = [];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
service.logout()
|
service.logout()
|
||||||
.subscribe(
|
.subscribe(
|
||||||
(res) => {
|
(res) => {
|
||||||
@@ -207,6 +235,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should create an AlfrescoAuthenticationBPM instance', (done) => {
|
it('should create an AlfrescoAuthenticationBPM instance', (done) => {
|
||||||
let providers = ['BPM'];
|
let providers = ['BPM'];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(fakePromiseBPM);
|
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(fakePromiseBPM);
|
||||||
|
|
||||||
service.login('fake-username', 'fake-password', providers)
|
service.login('fake-username', 'fake-password', providers)
|
||||||
@@ -222,6 +254,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should return an BPM token after the login done', (done) => {
|
it('should return an BPM token after the login done', (done) => {
|
||||||
let providers = ['BPM'];
|
let providers = ['BPM'];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(fakePromiseBPM);
|
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(fakePromiseBPM);
|
||||||
|
|
||||||
service.login('fake-username', 'fake-password', providers)
|
service.login('fake-username', 'fake-password', providers)
|
||||||
@@ -235,6 +271,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should return token undefined when the credentials are wrong', (done) => {
|
it('should return token undefined when the credentials are wrong', (done) => {
|
||||||
let providers = ['BPM'];
|
let providers = ['BPM'];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(Promise.reject('fake invalid credentials'));
|
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(Promise.reject('fake invalid credentials'));
|
||||||
|
|
||||||
service.login('fake-wrong-username', 'fake-wrong-password', providers)
|
service.login('fake-wrong-username', 'fake-wrong-password', providers)
|
||||||
@@ -252,6 +292,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should return a token undefined after logout', (done) => {
|
it('should return a token undefined after logout', (done) => {
|
||||||
let providers = ['BPM'];
|
let providers = ['BPM'];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
localStorage.setItem('token-BPM', 'fake-post-token-BPM');
|
localStorage.setItem('token-BPM', 'fake-post-token-BPM');
|
||||||
service.createProviderInstance(providers);
|
service.createProviderInstance(providers);
|
||||||
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogout').and.returnValue(fakePromiseBPM);
|
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogout').and.returnValue(fakePromiseBPM);
|
||||||
@@ -268,6 +312,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should throw an error when the logout return error', (done) => {
|
it('should throw an error when the logout return error', (done) => {
|
||||||
let providers = ['BPM'];
|
let providers = ['BPM'];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
localStorage.setItem('token-BPM', 'fake-post-token-BPM');
|
localStorage.setItem('token-BPM', 'fake-post-token-BPM');
|
||||||
service.createProviderInstance(providers);
|
service.createProviderInstance(providers);
|
||||||
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogout').and.returnValue(Promise.reject('fake logout error'));
|
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogout').and.returnValue(Promise.reject('fake logout error'));
|
||||||
@@ -293,6 +341,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should create both instances', (done) => {
|
it('should create both instances', (done) => {
|
||||||
let providers = ['ECM', 'BPM'];
|
let providers = ['ECM', 'BPM'];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise').and.returnValue(fakePromiseECM);
|
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise').and.returnValue(fakePromiseECM);
|
||||||
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(fakePromiseBPM);
|
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(fakePromiseBPM);
|
||||||
|
|
||||||
@@ -311,6 +363,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should return both ECM and BPM tokens after the login done', (done) => {
|
it('should return both ECM and BPM tokens after the login done', (done) => {
|
||||||
let providers = ['ECM', 'BPM'];
|
let providers = ['ECM', 'BPM'];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise').and.returnValue(fakePromiseECM);
|
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise').and.returnValue(fakePromiseECM);
|
||||||
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(fakePromiseBPM);
|
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(fakePromiseBPM);
|
||||||
|
|
||||||
@@ -327,6 +383,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should return token undefined when the credentials are correct for the ECM login but wrong for the BPM login', (done) => {
|
it('should return token undefined when the credentials are correct for the ECM login but wrong for the BPM login', (done) => {
|
||||||
let providers = ['ECM', 'BPM'];
|
let providers = ['ECM', 'BPM'];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise').and.returnValue(fakePromiseECM);
|
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise').and.returnValue(fakePromiseECM);
|
||||||
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(Promise.reject('fake invalid credentials'));
|
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(Promise.reject('fake invalid credentials'));
|
||||||
|
|
||||||
@@ -347,6 +407,10 @@ describe('AlfrescoAuthentication', () => {
|
|||||||
|
|
||||||
it('should return token undefined when the credentials are correct for the BPM login but wrong for the ECM login', (done) => {
|
it('should return token undefined when the credentials are correct for the BPM login but wrong for the ECM login', (done) => {
|
||||||
let providers = ['ECM', 'BPM'];
|
let providers = ['ECM', 'BPM'];
|
||||||
|
let alfSetting = injector.get(AlfrescoSettingsService);
|
||||||
|
alfSetting.providers = providers;
|
||||||
|
|
||||||
|
service = injector.get(AlfrescoAuthenticationService);
|
||||||
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise')
|
spyOn(AlfrescoAuthenticationECM.prototype, 'getCreateTicketPromise')
|
||||||
.and.returnValue(Promise.reject('fake invalid credentials'));
|
.and.returnValue(Promise.reject('fake invalid credentials'));
|
||||||
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(fakePromiseBPM);
|
spyOn(AlfrescoAuthenticationBPM.prototype, 'apiActivitiLogin').and.returnValue(fakePromiseBPM);
|
||||||
|
@@ -40,6 +40,7 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase {
|
|||||||
constructor(private alfrescoSettingsService: AlfrescoSettingsService,
|
constructor(private alfrescoSettingsService: AlfrescoSettingsService,
|
||||||
private http: Http) {
|
private http: Http) {
|
||||||
super(alfrescoSettingsService, http);
|
super(alfrescoSettingsService, http);
|
||||||
|
this.createProviderInstance(this.alfrescoSettingsService.getProviders());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,8 +54,7 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase {
|
|||||||
if (providers.length === 0) {
|
if (providers.length === 0) {
|
||||||
return Observable.throw('No providers defined');
|
return Observable.throw('No providers defined');
|
||||||
} else {
|
} else {
|
||||||
this.createProviderInstance(providers);
|
return this.performeLogin(username, password, providers);
|
||||||
return this.performeLogin(username, password);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,28 +65,29 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase {
|
|||||||
* @param password
|
* @param password
|
||||||
* @returns {Observable<R>|Observable<T>}
|
* @returns {Observable<R>|Observable<T>}
|
||||||
*/
|
*/
|
||||||
private performeLogin(username: string, password: string): Observable<any> {
|
private performeLogin(username: string, password: string, providers: string []): Observable<any> {
|
||||||
let observableBatch = [];
|
let observableBatch = [];
|
||||||
if (this.providersInstance.length !== 0) {
|
providers.forEach((provider) => {
|
||||||
this.providersInstance.forEach((authInstance) => {
|
let auth: AbstractAuthentication = this.findProviderInstance(provider);
|
||||||
observableBatch.push(authInstance.login(username, password));
|
if (auth) {
|
||||||
});
|
observableBatch.push(auth.login(username, password));
|
||||||
return Observable.create(observer => {
|
} else {
|
||||||
Observable.forkJoin(observableBatch).subscribe(
|
observableBatch.push(Observable.throw('Wrong provider defined'));
|
||||||
(response: any[]) => {
|
}
|
||||||
this.performeSaveToken();
|
});
|
||||||
/*response.forEach((res) => {
|
return Observable.create(observer => {
|
||||||
this.performeSaveToken(res.name, res.token);
|
Observable.forkJoin(observableBatch).subscribe(
|
||||||
});*/
|
(response: any[]) => {
|
||||||
observer.next(response);
|
this.performeSaveToken();
|
||||||
},
|
/*response.forEach((res) => {
|
||||||
(err: any) => {
|
this.performeSaveToken(res.name, res.token);
|
||||||
observer.error(new Error(err));
|
});*/
|
||||||
});
|
observer.next(response);
|
||||||
});
|
},
|
||||||
} else {
|
(err: any) => {
|
||||||
return Observable.throw('No providers defined');
|
observer.error(new Error(err));
|
||||||
}
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -28,6 +28,8 @@ export class AlfrescoSettingsService {
|
|||||||
private _contextPath = AlfrescoSettingsService.DEFAULT_CONTEXT_PATH;
|
private _contextPath = AlfrescoSettingsService.DEFAULT_CONTEXT_PATH;
|
||||||
private _apiBasePath: string = AlfrescoSettingsService.DEFAULT_BASE_API_PATH;
|
private _apiBasePath: string = AlfrescoSettingsService.DEFAULT_BASE_API_PATH;
|
||||||
|
|
||||||
|
private providers: string[] = ['ECM', 'BPM'];
|
||||||
|
|
||||||
public get host(): string {
|
public get host(): string {
|
||||||
return this._host;
|
return this._host;
|
||||||
}
|
}
|
||||||
@@ -39,4 +41,8 @@ export class AlfrescoSettingsService {
|
|||||||
getApiBaseUrl(): string {
|
getApiBaseUrl(): string {
|
||||||
return this._host + this._contextPath + this._apiBasePath;
|
return this._host + this._contextPath + this._apiBasePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getProviders(): string [] {
|
||||||
|
return this.providers;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +1,16 @@
|
|||||||
# DataTable Component for Angular 2
|
# DataTable Component for Angular 2
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a title='Build Status' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
<a title='Build Status Travis' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
||||||
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
||||||
Status' />
|
Status' />
|
||||||
</a>
|
</a>
|
||||||
|
<a title='Build Status AppVeyor' href="https://ci.appveyor.com/project/alfresco/alfresco-ng2-components">
|
||||||
|
<img src='https://ci.appveyor.com/api/projects/status/github/Alfresco/alfresco-ng2-components' alt='travis
|
||||||
|
Status' />
|
||||||
|
</a>
|
||||||
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
||||||
<img src='https://img.shields.io/codecov/c/github/codecov/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
<img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
||||||
</a>
|
</a>
|
||||||
<a href='https://www.npmjs.com/package/ng2-alfresco-datatable'>
|
<a href='https://www.npmjs.com/package/ng2-alfresco-datatable'>
|
||||||
<img src='https://img.shields.io/npm/dt/ng2-alfresco-datatable.svg' alt='npm downloads' />
|
<img src='https://img.shields.io/npm/dt/ng2-alfresco-datatable.svg' alt='npm downloads' />
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
||||||
"test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
"test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
||||||
"posttest": "node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
"posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
||||||
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build",
|
||||||
"travis": "npm link ng2-alfresco-core"
|
"travis": "npm link ng2-alfresco-core"
|
||||||
|
@@ -1,12 +1,16 @@
|
|||||||
# DocumentList Component for Angular 2
|
# DocumentList Component for Angular 2
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a title='Build Status' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
<a title='Build Status Travis' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
||||||
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
||||||
Status' />
|
Status' />
|
||||||
</a>
|
</a>
|
||||||
|
<a title='Build Status AppVeyor' href="https://ci.appveyor.com/project/alfresco/alfresco-ng2-components">
|
||||||
|
<img src='https://ci.appveyor.com/api/projects/status/github/Alfresco/alfresco-ng2-components' alt='travis
|
||||||
|
Status' />
|
||||||
|
</a>
|
||||||
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
||||||
<img src='https://img.shields.io/codecov/c/github/codecov/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
<img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
||||||
</a>
|
</a>
|
||||||
<a href='https://www.npmjs.com/package/ng2-alfresco-documentlist'>
|
<a href='https://www.npmjs.com/package/ng2-alfresco-documentlist'>
|
||||||
<img src='https://img.shields.io/npm/dt/ng2-alfresco-documentlist.svg' alt='npm downloads' />
|
<img src='https://img.shields.io/npm/dt/ng2-alfresco-documentlist.svg' alt='npm downloads' />
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
||||||
"test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
"test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
||||||
"posttest": "node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
"posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
||||||
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build",
|
||||||
"travis": "npm link ng2-alfresco-core ng2-alfresco-datatable"
|
"travis": "npm link ng2-alfresco-core ng2-alfresco-datatable"
|
||||||
|
@@ -1,11 +1,15 @@
|
|||||||
# Alfresco Login Component for Angular 2
|
# Alfresco Login Component for Angular 2
|
||||||
<p>
|
<p>
|
||||||
<a title='Build Status' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
<a title='Build Status Travis' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
||||||
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
||||||
Status' />
|
Status' />
|
||||||
</a>
|
</a>
|
||||||
|
<a title='Build Status AppVeyor' href="https://ci.appveyor.com/project/alfresco/alfresco-ng2-components">
|
||||||
|
<img src='https://ci.appveyor.com/api/projects/status/github/Alfresco/alfresco-ng2-components' alt='travis
|
||||||
|
Status' />
|
||||||
|
</a>
|
||||||
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
||||||
<img src='https://img.shields.io/codecov/c/github/codecov/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
<img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
||||||
</a>
|
</a>
|
||||||
<a href='https://www.npmjs.com/package/ng2-alfresco-login'>
|
<a href='https://www.npmjs.com/package/ng2-alfresco-login'>
|
||||||
<img src='https://img.shields.io/npm/dt/ng2-alfresco-login.svg' alt='npm downloads' />
|
<img src='https://img.shields.io/npm/dt/ng2-alfresco-login.svg' alt='npm downloads' />
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
||||||
"test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
"test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
||||||
"posttest": "node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
"posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
||||||
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build",
|
||||||
"travis": "npm link ng2-alfresco-core"
|
"travis": "npm link ng2-alfresco-core"
|
||||||
|
@@ -1,12 +1,16 @@
|
|||||||
# Search Component for Angular 2
|
# Search Component for Angular 2
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a title='Build Status' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
<a title='Build Status Travis' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
||||||
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
||||||
Status' />
|
Status' />
|
||||||
</a>
|
</a>
|
||||||
|
<a title='Build Status AppVeyor' href="https://ci.appveyor.com/project/alfresco/alfresco-ng2-components">
|
||||||
|
<img src='https://ci.appveyor.com/api/projects/status/github/Alfresco/alfresco-ng2-components' alt='travis
|
||||||
|
Status' />
|
||||||
|
</a>
|
||||||
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
||||||
<img src='https://img.shields.io/codecov/c/github/codecov/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
<img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
||||||
</a>
|
</a>
|
||||||
<a href='https://www.npmjs.com/package/ng2-alfresco-search'>
|
<a href='https://www.npmjs.com/package/ng2-alfresco-search'>
|
||||||
<img src='https://img.shields.io/npm/dt/ng2-alfresco-search.svg' alt='npm downloads' />
|
<img src='https://img.shields.io/npm/dt/ng2-alfresco-search.svg' alt='npm downloads' />
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
||||||
"test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
"test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
||||||
"posttest": "node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
"posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
||||||
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build",
|
||||||
"travis": "npm link ng2-alfresco-core"
|
"travis": "npm link ng2-alfresco-core"
|
||||||
|
@@ -1,11 +1,15 @@
|
|||||||
# Alfresco Upload Component for Angular 2
|
# Alfresco Upload Component for Angular 2
|
||||||
<p>
|
<p>
|
||||||
<a title='Build Status' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
<a title='Build Status Travis' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
||||||
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
||||||
Status' />
|
Status' />
|
||||||
</a>
|
</a>
|
||||||
|
<a title='Build Status AppVeyor' href="https://ci.appveyor.com/project/alfresco/alfresco-ng2-components">
|
||||||
|
<img src='https://ci.appveyor.com/api/projects/status/github/Alfresco/alfresco-ng2-components' alt='travis
|
||||||
|
Status' />
|
||||||
|
</a>
|
||||||
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
||||||
<img src='https://img.shields.io/codecov/c/github/codecov/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
<img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
||||||
</a>
|
</a>
|
||||||
<a href='https://www.npmjs.com/package/ng2-alfresco-upload'>
|
<a href='https://www.npmjs.com/package/ng2-alfresco-upload'>
|
||||||
<img src='https://img.shields.io/npm/dt/ng2-alfresco-upload.svg' alt='npm downloads' />
|
<img src='https://img.shields.io/npm/dt/ng2-alfresco-upload.svg' alt='npm downloads' />
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
||||||
"test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
"test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
||||||
"posttest": "node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
"posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
||||||
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build",
|
||||||
"travis": "npm link ng2-alfresco-core"
|
"travis": "npm link ng2-alfresco-core"
|
||||||
|
@@ -24,6 +24,8 @@ export class AlfrescoSettingsServiceMock {
|
|||||||
static DEFAULT_CONTEXT_PATH: string = '/fake-path-alfresco';
|
static DEFAULT_CONTEXT_PATH: string = '/fake-path-alfresco';
|
||||||
static DEFAULT_BASE_API_PATH: string = '/fake-api/fake-public/fake-alfresco/fake-versions/1';
|
static DEFAULT_BASE_API_PATH: string = '/fake-api/fake-public/fake-alfresco/fake-versions/1';
|
||||||
|
|
||||||
|
private providers: string[] = ['ECM', 'BPM'];
|
||||||
|
|
||||||
private _host: string = AlfrescoSettingsServiceMock.DEFAULT_HOST_ADDRESS;
|
private _host: string = AlfrescoSettingsServiceMock.DEFAULT_HOST_ADDRESS;
|
||||||
private _contextPath = AlfrescoSettingsServiceMock.DEFAULT_CONTEXT_PATH;
|
private _contextPath = AlfrescoSettingsServiceMock.DEFAULT_CONTEXT_PATH;
|
||||||
private _apiBasePath: string = AlfrescoSettingsServiceMock.DEFAULT_BASE_API_PATH;
|
private _apiBasePath: string = AlfrescoSettingsServiceMock.DEFAULT_BASE_API_PATH;
|
||||||
@@ -35,4 +37,8 @@ export class AlfrescoSettingsServiceMock {
|
|||||||
getApiBaseUrl(): string {
|
getApiBaseUrl(): string {
|
||||||
return this._host + this._contextPath + this._apiBasePath;
|
return this._host + this._contextPath + this._apiBasePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getProviders(): string [] {
|
||||||
|
return this.providers;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,11 +1,15 @@
|
|||||||
# Alfresco File Viewer Component for Angular 2
|
# Alfresco File Viewer Component for Angular 2
|
||||||
<p>
|
<p>
|
||||||
<a title='Build Status' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
<a title='Build Status Travis' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
||||||
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
||||||
Status' />
|
Status' />
|
||||||
</a>
|
</a>
|
||||||
|
<a title='Build Status AppVeyor' href="https://ci.appveyor.com/project/alfresco/alfresco-ng2-components">
|
||||||
|
<img src='https://ci.appveyor.com/api/projects/status/github/Alfresco/alfresco-ng2-components' alt='travis
|
||||||
|
Status' />
|
||||||
|
</a>
|
||||||
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
||||||
<img src='https://img.shields.io/codecov/c/github/codecov/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
<img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
||||||
</a>
|
</a>
|
||||||
<a href='https://www.npmjs.com/package/ng2-alfresco-viewer'>
|
<a href='https://www.npmjs.com/package/ng2-alfresco-viewer'>
|
||||||
<img src='https://img.shields.io/npm/dt/ng2-alfresco-viewer.svg' alt='npm downloads' />
|
<img src='https://img.shields.io/npm/dt/ng2-alfresco-viewer.svg' alt='npm downloads' />
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
||||||
"test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
"test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
||||||
"posttest": "node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
"posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
||||||
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build",
|
||||||
"travis": "echo 'placeholder'"
|
"travis": "echo 'placeholder'"
|
||||||
|
@@ -2,22 +2,41 @@
|
|||||||
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
#LINK CORE
|
||||||
|
echo "====== linking component: ng2-alfresco-core ====="
|
||||||
|
cd "$DIR/../ng2-components/ng2-alfresco-core"
|
||||||
|
npm link
|
||||||
|
|
||||||
|
#LINK DATATABLE
|
||||||
|
echo "====== linking component: ng2-alfresco-datatable ====="
|
||||||
|
cd "$DIR/../ng2-components/ng2-alfresco-datatable"
|
||||||
|
npm link ng2-alfresco-core
|
||||||
|
npm link
|
||||||
|
|
||||||
|
#LINK DOCUMENTLIST
|
||||||
|
echo "====== linking component: ng2-alfresco-documentlist ====="
|
||||||
|
cd "$DIR/../ng2-components/ng2-alfresco-documentlist"
|
||||||
|
npm link ng2-alfresco-core
|
||||||
|
npm link ng2-alfresco-datatable
|
||||||
|
npm link
|
||||||
|
|
||||||
|
#LINK ALL THE OTHERS COMPONENTS
|
||||||
for PACKAGE in \
|
for PACKAGE in \
|
||||||
ng2-alfresco-core \
|
|
||||||
ng2-alfresco-datatable \
|
|
||||||
ng2-alfresco-documentlist \
|
|
||||||
ng2-alfresco-login \
|
ng2-alfresco-login \
|
||||||
ng2-alfresco-search \
|
ng2-alfresco-search \
|
||||||
ng2-alfresco-upload \
|
ng2-alfresco-upload \
|
||||||
ng2-alfresco-viewer
|
ng2-alfresco-viewer
|
||||||
do
|
do
|
||||||
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
|
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
|
||||||
echo "====== linking component: ${DESTDIR} ====="
|
echo "====== linking component: ${PACKAGE} ====="
|
||||||
npm link ${DESTDIR} --access public
|
cd "$DESTDIR"
|
||||||
|
npm link ng2-alfresco-core
|
||||||
|
npm link
|
||||||
done
|
done
|
||||||
|
|
||||||
cd "$DIR/../demo-shell-ng2"
|
|
||||||
|
|
||||||
|
#LINK ALL THE COMPONENTS INSIDE THE DEMOSHELL
|
||||||
|
cd "$DIR/../demo-shell-ng2"
|
||||||
for PACKAGE in \
|
for PACKAGE in \
|
||||||
ng2-alfresco-core \
|
ng2-alfresco-core \
|
||||||
ng2-alfresco-datatable \
|
ng2-alfresco-datatable \
|
||||||
|
Reference in New Issue
Block a user