mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
Merge pull request #599 from Alfresco/dev-denys-534
#534 login customisation support
This commit is contained in:
commit
dd12931f15
@ -45,7 +45,7 @@ Components included:
|
|||||||
* Alfresco Login Component
|
* Alfresco Login Component
|
||||||
* Alfresco Authentication Service
|
* Alfresco Authentication Service
|
||||||
|
|
||||||
#### Dependencies
|
## Dependencies
|
||||||
|
|
||||||
Add the following dependency to your index.html:
|
Add the following dependency to your index.html:
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ Please refer to the following example to have an idea of how your systemjs.confi
|
|||||||
|
|
||||||
https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-alfresco-login/demo/systemjs.config.js
|
https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-alfresco-login/demo/systemjs.config.js
|
||||||
|
|
||||||
#### Style
|
## Style
|
||||||
The style of this component is based on material design, so if you want to visualize it correctly you have to add the material
|
The style of this component is based on material design, so if you want to visualize it correctly you have to add the material
|
||||||
design dependency to your project:
|
design dependency to your project:
|
||||||
|
|
||||||
@ -80,8 +80,7 @@ Also make sure you include these dependencies in your .html page:
|
|||||||
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
|
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Basic usage
|
## Basic usage
|
||||||
|
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<alfresco-login [providers]="['ECM','BPM']"></alfresco-login>
|
<alfresco-login [providers]="['ECM','BPM']"></alfresco-login>
|
||||||
@ -89,7 +88,7 @@ Also make sure you include these dependencies in your .html page:
|
|||||||
|
|
||||||
Example of an App that use Alfresco login component :
|
Example of an App that use Alfresco login component :
|
||||||
|
|
||||||
main.ts
|
**main.ts**
|
||||||
```ts
|
```ts
|
||||||
|
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
@ -136,13 +135,16 @@ bootstrap(AppComponent, [
|
|||||||
|
|
||||||
```
|
```
|
||||||
#### Events
|
#### Events
|
||||||
**onSuccess**: The event is emitted when the login is done
|
|
||||||
**onError**: The event is emitted when the login fails<br />
|
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| onSuccess | The event is emitted when the login is done |
|
||||||
|
| onError | The event is emitted when the login fails |
|
||||||
|
|
||||||
#### Options
|
#### Options
|
||||||
|
|
||||||
**providers**: { string[] } optional) default ECM.
|
**providers**: { string[] } optional) default ECM.
|
||||||
|
|
||||||
Using the providers attribute, you can specify in which system
|
Using the providers attribute, you can specify in which system
|
||||||
(ECM or BPM) you want to be logged in.
|
(ECM or BPM) you want to be logged in.
|
||||||
By selecting one of the options only the relative components will be
|
By selecting one of the options only the relative components will be
|
||||||
@ -151,7 +153,29 @@ By selecting one of the options only the relative components will be
|
|||||||
You can also specify ECM and BPM, in this case both system components
|
You can also specify ECM and BPM, in this case both system components
|
||||||
are accessible.<br />
|
are accessible.<br />
|
||||||
|
|
||||||
|
|
||||||
|
## Custom logo and background
|
||||||
|
|
||||||
|
It is possible changing logo and background images to custom values.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<style>
|
||||||
|
alfresco-login >>> .login-content {
|
||||||
|
background-image: url(http://images.freeimages.com/images/previews/638/wood-wall-for-background-1634466.jpg) !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<alfresco-login
|
||||||
|
[logoImageUrl]="'http://images.freeimages.com/images/previews/eac/honeybee-with-a-house-1633609.jpg'"
>
|
||||||
|
</alfresco-login>
|
||||||
|
```
|
||||||
|
|
||||||
|
Should give you something like the following:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Build from sources
|
## Build from sources
|
||||||
|
|
||||||
Alternatively you can build component from sources with the following commands:
|
Alternatively you can build component from sources with the following commands:
|
||||||
|
|
||||||
|
|
||||||
@ -160,11 +184,11 @@ npm install
|
|||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
##Build the files and keep watching for changes
|
### Build the files and keep watching for changes
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ npm run build:w
|
$ npm run build:w
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running unit tests
|
## Running unit tests
|
||||||
|
|
||||||
@ -172,7 +196,7 @@ npm run build
|
|||||||
npm test
|
npm test
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running unit tests in browser
|
### Running unit tests in browser
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm test-browser
|
npm test-browser
|
||||||
@ -181,7 +205,7 @@ npm test-browser
|
|||||||
This task rebuilds all the code, runs tslint, license checks and other quality check tools
|
This task rebuilds all the code, runs tslint, license checks and other quality check tools
|
||||||
before performing unit testing.
|
before performing unit testing.
|
||||||
|
|
||||||
## Code coverage
|
### Code coverage
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm run coverage
|
npm run coverage
|
||||||
@ -197,3 +221,6 @@ npm install
|
|||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE)
|
||||||
|
BIN
ng2-components/ng2-alfresco-login/assets/custom-login.png
Normal file
BIN
ng2-components/ng2-alfresco-login/assets/custom-login.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 MiB |
@ -51,6 +51,10 @@
|
|||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:host .alfresco-logo > img {
|
||||||
|
max-height: 43px;
|
||||||
|
}
|
||||||
|
|
||||||
:host .mdl-button--raised.mdl-button--colored {
|
:host .mdl-button--raised.mdl-button--colored {
|
||||||
width: 98%;
|
width: 98%;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<div class="content-grid mdl-grid content-layout">
|
<div class="content-grid mdl-grid content-layout login-content">
|
||||||
<div class="login-card-wide mdl-card mdl-shadow--4dp">
|
<div class="login-card-wide mdl-card mdl-shadow--4dp">
|
||||||
<form [ngFormModel]="form" (submit)="onSubmit(form.value, $event)">
|
<form [ngFormModel]="form" (submit)="onSubmit(form.value, $event)">
|
||||||
<div class="mdl-card__title alfresco-logo">
|
<div class="mdl-card__title alfresco-logo">
|
||||||
<img class="center" [src]="baseComponentPath + '/../assets/images/alfresco-logo.svg'" alt="{{'LOGIN.LOGO' | translate }}">
|
<img class="center" [src]="logoImageUrl || baseComponentPath + '/../assets/images/alfresco-logo.svg'" alt="{{'LOGIN.LOGO' | translate }}">
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-card__supporting-text">
|
<div class="mdl-card__supporting-text">
|
||||||
<div>
|
<div>
|
||||||
|
@ -41,11 +41,15 @@ export class AlfrescoLoginComponent {
|
|||||||
|
|
||||||
isPasswordShow: boolean = false;
|
isPasswordShow: boolean = false;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
logoImageUrl: string;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
providers: string [] ;
|
providers: string [] ;
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
onSuccess = new EventEmitter();
|
onSuccess = new EventEmitter();
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
onError = new EventEmitter();
|
onError = new EventEmitter();
|
||||||
|
|
||||||
@ -55,8 +59,7 @@ export class AlfrescoLoginComponent {
|
|||||||
|
|
||||||
formError: { [id: string]: string };
|
formError: { [id: string]: string };
|
||||||
|
|
||||||
private _message: { [id: string]: { [id: string]: string }
|
private _message: { [id: string]: { [id: string]: string } };
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -91,7 +94,6 @@ export class AlfrescoLoginComponent {
|
|||||||
translate.addTranslationFolder('node_modules/ng2-alfresco-login/dist/src');
|
translate.addTranslationFolder('node_modules/ng2-alfresco-login/dist/src');
|
||||||
|
|
||||||
this.form.valueChanges.subscribe(data => this.onValueChanged(data));
|
this.form.valueChanges.subscribe(data => this.onValueChanged(data));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user