Pull request #239: change password

Merge in RED/ui from change-password-RED-681 to master

* commit '4bfb3229680a3749bb0c498f80198ff69c6ebc61':
  change password
This commit is contained in:
Timo Bejan 2021-07-14 15:42:17 +02:00
commit 8b7dda7730
6 changed files with 35 additions and 5 deletions

View File

@ -95,7 +95,8 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "red-ui:build"
"browserTarget": "red-ui:build",
"proxyConfig": "proxy.config.json"
},
"configurations": {
"production": {

View File

@ -24,9 +24,7 @@
</div>
<div class="red-input-group">
<label
translate="
top-bar.navigation-items.my-account.children.language.label
"
translate="top-bar.navigation-items.my-account.children.language.label"
></label>
<mat-select formControlName="language">
<mat-option *ngFor="let language of languages" [value]="language">
@ -39,6 +37,7 @@
</div>
</div>
</div>
<div class="dialog-actions">
<button
[disabled]="formGroup.invalid || !(profileChanged || languageChanged)"
@ -48,6 +47,9 @@
>
{{ 'user-profile.actions.save' | translate }}
</button>
<a [href]="changePasswordUrl" target="_blank">
{{ 'user-profile.actions.change-password' | translate }}</a
>
</div>
</form>
</div>

View File

@ -16,3 +16,11 @@
height: calc(100% + 50px);
z-index: 1;
}
iframe {
background: white;
width: 500px;
height: 500px;
position: absolute;
z-index: 100;
}

View File

@ -5,6 +5,8 @@ import { PermissionsService } from '@services/permissions.service';
import { LanguageService } from '@i18n/language.service';
import { TranslateService } from '@ngx-translate/core';
import { UserControllerService } from '@redaction/red-ui-http';
import { AppConfigKey, AppConfigService } from '@app-config/app-config.service';
import { DomSanitizer } from '@angular/platform-browser';
@Component({
selector: 'redaction-user-profile-screen',
@ -14,14 +16,18 @@ import { UserControllerService } from '@redaction/red-ui-http';
export class UserProfileScreenComponent implements OnInit {
viewReady = false;
formGroup: FormGroup;
changePasswordUrl: any;
private _profileModel: ProfileModel;
constructor(
readonly permissionsService: PermissionsService,
private readonly _formBuilder: FormBuilder,
private readonly _userService: UserService,
private readonly _appConfigService: AppConfigService,
private readonly _userControllerService: UserControllerService,
private readonly _languageService: LanguageService,
private readonly _domSanitizer: DomSanitizer,
private readonly _translateService: TranslateService
) {
this.formGroup = this._formBuilder.group({
@ -30,6 +36,10 @@ export class UserProfileScreenComponent implements OnInit {
lastName: [undefined],
language: [undefined]
});
this.changePasswordUrl = this._domSanitizer.bypassSecurityTrustResourceUrl(
this._appConfigService.getConfig(AppConfigKey.OAUTH_URL) + '/account/password'
);
}
get languageChanged(): boolean {

View File

@ -1345,7 +1345,8 @@
"user-management": "User Management",
"user-profile": {
"actions": {
"save": "Save profile"
"save": "Save profile",
"change-password": "Change Password"
},
"form": {
"email": "Email",

8
proxy.config.json Normal file
View File

@ -0,0 +1,8 @@
{
"/auth/*": {
"target": "http://localhost:8080/",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
}
}