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": { "serve": {
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
"options": { "options": {
"browserTarget": "red-ui:build" "browserTarget": "red-ui:build",
"proxyConfig": "proxy.config.json"
}, },
"configurations": { "configurations": {
"production": { "production": {

View File

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

View File

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

View File

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