[DEV] update angular17 and correct right get
This commit is contained in:
parent
05972126e7
commit
55fccf1848
@ -6,8 +6,8 @@
|
||||
<version>0.5.0</version>
|
||||
<properties>
|
||||
<maven.compiler.version>3.1</maven.compiler.version>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<maven.dependency.version>3.1.1</maven.dependency.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
|
@ -185,7 +185,7 @@ public class ApplicationResource {
|
||||
final List<ApplicationSmall> out = new ArrayList<>();
|
||||
for (final Application app : tmp) {
|
||||
if (regular.indexOf(app.id) != -1) {
|
||||
out.add(new ApplicationSmall(app.name, app.description, app.redirect));
|
||||
out.add(new ApplicationSmall(app.id, app.name, app.description, app.redirect));
|
||||
}
|
||||
}
|
||||
return out;
|
||||
|
@ -36,31 +36,39 @@ public class RightResource {
|
||||
}
|
||||
|
||||
public static List<Right> getRawUserRight(final long userId, final long applicationId) throws Exception {
|
||||
return DataAccess.getsWhere(Right.class, new Condition(new QueryAnd(new QueryCondition("applicationId", "=", applicationId), new QueryCondition("userId", "=", userId))));
|
||||
// Formatter:off
|
||||
return DataAccess.getsWhere(Right.class,
|
||||
new Condition(
|
||||
new QueryAnd(
|
||||
new QueryCondition("applicationId", "=", applicationId),
|
||||
new QueryCondition("userId", "=", userId)
|
||||
)));
|
||||
// Formatter:on
|
||||
}
|
||||
|
||||
public static Map<String, Object> getUserRight(final long userId, final long applicationId) throws Exception {
|
||||
final Map<String, Object> out = new HashMap<>();
|
||||
final List<RightDescription> rightsDescriptions = getApplicationRightDecription(applicationId);
|
||||
logger.debug("Get some descriptions: {} applicationId={}", rightsDescriptions.size(), applicationId);
|
||||
logger.trace("Get some descriptions: {} applicationId={}", rightsDescriptions.size(), applicationId);
|
||||
if (rightsDescriptions != null && rightsDescriptions.size() != 0) {
|
||||
final List<Right> rights = getRawUserRight(userId, applicationId);
|
||||
logger.debug("Get some user right: count={} userID={}", rights.size(), userId);
|
||||
logger.debug("Rights:");
|
||||
logger.trace("Get some user right: count={} userID={} applicationId={}", rights.size(), userId, applicationId);
|
||||
logger.trace("Rights:");
|
||||
for (final Right elem : rights) {
|
||||
logger.debug(" - applId={} rightDescriptionId={} value={}", elem.applicationId, elem.rightDescriptionId, elem.value);
|
||||
}
|
||||
logger.debug("RightDescription:");
|
||||
for (final RightDescription elem : rightsDescriptions) {
|
||||
logger.debug(" - id={} key={} type={} default={}", elem.id, elem.key, elem.type, elem.defaultValue);
|
||||
logger.trace(" - applId={} rightDescriptionId={} value={}", elem.applicationId, elem.rightDescriptionId, elem.value);
|
||||
}
|
||||
logger.trace("RightDescription:");
|
||||
for (final RightDescription description : rightsDescriptions) {
|
||||
|
||||
if (description == null) {
|
||||
// TODO: this is a really strange case to manage later...
|
||||
continue;
|
||||
}
|
||||
final Right right = rights.stream().filter(elem -> elem.rightDescriptionId == description.id).findAny().orElse(null);
|
||||
logger.trace(" - id={} key={} type={} default={}", description.id, description.key, description.type, description.defaultValue);
|
||||
}
|
||||
for (final RightDescription description : rightsDescriptions) {
|
||||
if (description == null) {
|
||||
continue;
|
||||
}
|
||||
final Right right = rights.stream().filter(elem -> elem.rightDescriptionId.equals(description.id)).findAny().orElse(null);
|
||||
if (right != null) {
|
||||
out.put(description.key, Transform.convertToType(description.type, right.value));
|
||||
} else if (description.defaultValue != null) {
|
||||
@ -83,7 +91,7 @@ public class RightResource {
|
||||
throw new IllegalArgumentException("Request change right on an application that does not manage any right");
|
||||
}
|
||||
final List<Right> rights = getRawUserRight(userId, applicationId);
|
||||
logger.debug("Get some user right: {}userID={}", rights.size(), userId);
|
||||
logger.debug("Get some user right: count={} userID={}", rights.size(), userId);
|
||||
for (final RightDescription description : rightsDescriptions) {
|
||||
if (description == null) {
|
||||
// TODO: this is a really strange case to manage later...
|
||||
@ -98,8 +106,16 @@ public class RightResource {
|
||||
if (convertedValue == null) {
|
||||
throw new IllegalArgumentException("Uncompatible value:'" + description.type + "'");
|
||||
}
|
||||
Right right = rights.stream().filter(elem -> elem.rightDescriptionId == description.id).findAny().orElse(null);
|
||||
if (right != null) {
|
||||
List<Right> allRights = rights.stream().filter(elem -> elem.rightDescriptionId.equals(description.id)).toList();
|
||||
if (allRights.size() > 1) {
|
||||
// special case of error somewhere else ... ==> remove all elements (except the first)
|
||||
for (int iii=1; iii<allRights.size(); iii++) {
|
||||
logger.error("Remove starnge element in Right id={} ", allRights.get(iii).id);
|
||||
DataAccess.delete(Right.class, allRights.get(iii).id);
|
||||
}
|
||||
}
|
||||
if (allRights.size() == 1 ) {
|
||||
Right right = allRights.get(0);
|
||||
// The value exist, we need to update it
|
||||
logger.debug("Request update a knonwn parameter: {} with {}", description.key, newValue);
|
||||
right.value = convertedValue;
|
||||
@ -107,7 +123,7 @@ public class RightResource {
|
||||
} else {
|
||||
// we need to create it
|
||||
logger.debug("Request create parameter: {} with {}", description.key, newValue);
|
||||
right = new Right();
|
||||
Right right = new Right();
|
||||
right.applicationId = applicationId;
|
||||
right.userId = userId;
|
||||
right.rightDescriptionId = description.id;
|
||||
|
@ -105,7 +105,7 @@ public class UserResource {
|
||||
@RolesAllowed("ADMIN")
|
||||
public Map<String, Object> patchApplicationRight(@Context final SecurityContext sc, @PathParam("userId") final long userId, @PathParam("applicationId") final long applicationId,
|
||||
final Map<String, Object> data) throws Exception {
|
||||
this.logger.info("get data from FRONT: {}", data);
|
||||
this.logger.info("Patch data from FRONT: {}", data);
|
||||
RightResource.updateUserRight(userId, applicationId, data);
|
||||
return RightResource.getUserRight(userId, applicationId);
|
||||
}
|
||||
|
@ -1,14 +1,16 @@
|
||||
package org.kar.karso.model;
|
||||
|
||||
public class ApplicationSmall {
|
||||
public Long id;
|
||||
public String name;
|
||||
public String description;
|
||||
public String redirect;
|
||||
|
||||
public ApplicationSmall() {}
|
||||
|
||||
public ApplicationSmall(String name, String description, String redirect) {
|
||||
public ApplicationSmall(Long id, String name, String description, String redirect) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.redirect = redirect;
|
||||
|
@ -15,7 +15,9 @@
|
||||
"index": "src/index.html",
|
||||
"main": "src/app-root/main.ts",
|
||||
"tsConfig": "src/tsconfig.app-root.json",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"polyfills": [
|
||||
"zone.js"
|
||||
],
|
||||
"assets": [
|
||||
"src/assets",
|
||||
"src/favicon.ico"
|
||||
@ -83,7 +85,9 @@
|
||||
"options": {
|
||||
"main": "src/test.ts",
|
||||
"karmaConfig": "./karma.conf.js",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"polyfills": [
|
||||
"zone.js"
|
||||
],
|
||||
"tsConfig": "src/tsconfig.spec.json",
|
||||
"scripts": [],
|
||||
"styles": [
|
||||
@ -161,7 +165,9 @@
|
||||
"index": "src/index.html",
|
||||
"main": "src/app-edge/main.ts",
|
||||
"tsConfig": "src/tsconfig.app-edge.json",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"polyfills": [
|
||||
"zone.js"
|
||||
],
|
||||
"assets": [
|
||||
"src/assets",
|
||||
"src/favicon.ico"
|
||||
|
24680
front/package-lock.json
generated
24680
front/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -12,44 +12,47 @@
|
||||
"test-coverage": "ng test karso --code-coverage",
|
||||
"lint": "ng lint",
|
||||
"style": "prettier --write .",
|
||||
"e2e": "ng e2e"
|
||||
"e2e": "ng e2e",
|
||||
"update_packages": "ncu --upgrade",
|
||||
"install_dependency": "npm install"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^14.2.10",
|
||||
"@angular/cdk": "^14.2.7",
|
||||
"@angular/common": "^14.2.10",
|
||||
"@angular/compiler": "^14.2.10",
|
||||
"@angular/core": "^14.2.10",
|
||||
"@angular/forms": "^14.2.10",
|
||||
"@angular/material": "^14.2.7",
|
||||
"@angular/platform-browser": "^14.2.10",
|
||||
"@angular/platform-browser-dynamic": "^14.2.10",
|
||||
"@angular/router": "^14.2.10",
|
||||
"rxjs": "^7.5.7",
|
||||
"zone.js": "^0.12.0"
|
||||
"@angular/animations": "^17.2.2",
|
||||
"@angular/cdk": "^17.2.1",
|
||||
"@angular/common": "^17.2.2",
|
||||
"@angular/compiler": "^17.2.2",
|
||||
"@angular/core": "^17.2.2",
|
||||
"@angular/forms": "^17.2.2",
|
||||
"@angular/material": "^17.2.1",
|
||||
"@angular/platform-browser": "^17.2.2",
|
||||
"@angular/platform-browser-dynamic": "^17.2.2",
|
||||
"@angular/router": "^17.2.2",
|
||||
"rxjs": "^7.8.1",
|
||||
"zone.js": "^0.14.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "^14.2.9",
|
||||
"@angular-eslint/builder": "14.2.0",
|
||||
"@angular-eslint/eslint-plugin": "14.2.0",
|
||||
"@angular-eslint/eslint-plugin-template": "14.2.0",
|
||||
"@angular-eslint/schematics": "14.2.0",
|
||||
"@angular-eslint/template-parser": "14.2.0",
|
||||
"@angular/cli": "^14.2.9",
|
||||
"@angular/compiler-cli": "^14.2.10",
|
||||
"@angular/language-service": "^14.2.10",
|
||||
"@playwright/test": "^1.28.1",
|
||||
"@types/jest": "^29.2.4",
|
||||
"jasmine": "^4.5.0",
|
||||
"jasmine-core": "^4.5.0",
|
||||
"karma": "^6.4.1",
|
||||
"karma-coverage": "^2.2.0",
|
||||
"@angular-devkit/build-angular": "^17.2.1",
|
||||
"@angular-eslint/builder": "17.2.1",
|
||||
"@angular-eslint/eslint-plugin": "17.2.1",
|
||||
"@angular-eslint/eslint-plugin-template": "17.2.1",
|
||||
"@angular-eslint/schematics": "17.2.1",
|
||||
"@angular-eslint/template-parser": "17.2.1",
|
||||
"@angular/cli": "^17.2.1",
|
||||
"@angular/compiler-cli": "^17.2.2",
|
||||
"@angular/language-service": "^17.2.2",
|
||||
"@playwright/test": "^1.41.2",
|
||||
"@types/jest": "^29.5.12",
|
||||
"jasmine": "^5.1.0",
|
||||
"jasmine-core": "^5.1.2",
|
||||
"karma": "^6.4.2",
|
||||
"karma-coverage": "^2.2.1",
|
||||
"karma-coverage-istanbul-reporter": "^3.0.3",
|
||||
"karma-firefox-launcher": "^2.1.2",
|
||||
"karma-jasmine": "^5.1.0",
|
||||
"karma-jasmine-html-reporter": "^2.0.0",
|
||||
"karma-jasmine-html-reporter": "^2.1.0",
|
||||
"karma-spec-reporter": "^0.0.36",
|
||||
"prettier": "^2.8.1"
|
||||
"prettier": "^3.2.5",
|
||||
"npm-check-updates": "^16.14.15"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,5 +2,7 @@
|
||||
<app-top-menu [menu]="currentMenu" (callback)="eventOnMenu($event)"></app-top-menu>
|
||||
<!-- all interfaced pages -->
|
||||
<div class="main-content">
|
||||
<router-outlet *ngIf="autoConnectedDone"></router-outlet>
|
||||
@if(autoConnectedDone) {
|
||||
<router-outlet></router-outlet>
|
||||
}
|
||||
</div>
|
||||
|
@ -2,5 +2,7 @@
|
||||
<app-top-menu [menu]="currentMenu" (callback)="eventOnMenu($event)"></app-top-menu>
|
||||
<!-- all interfaced pages -->
|
||||
<div class="main-content">
|
||||
<router-outlet *ngIf="autoConnectedDone"></router-outlet>
|
||||
@if(autoConnectedDone) {
|
||||
<router-outlet></router-outlet>
|
||||
}
|
||||
</div>
|
||||
|
@ -5,13 +5,16 @@
|
||||
<name>Application properties</name>
|
||||
<description>Update property of the application:</description>
|
||||
<body>
|
||||
<spiner *ngIf="editApplicationMenu===undefined"></spiner>
|
||||
<app-render-form
|
||||
*ngIf="editApplicationMenu!==undefined"
|
||||
[values]="editApplicationMenu"
|
||||
(deltaValues)="onEditValues($event)"
|
||||
(changeState)="onEditState($event)"
|
||||
></app-render-form>
|
||||
@if(editApplicationMenu===undefined) {
|
||||
<spiner></spiner>
|
||||
}
|
||||
@else {
|
||||
<app-render-form
|
||||
[values]="editApplicationMenu"
|
||||
(deltaValues)="onEditValues($event)"
|
||||
(changeState)="onEditState($event)"
|
||||
></app-render-form>
|
||||
}
|
||||
</body>
|
||||
<footer>
|
||||
<button
|
||||
@ -39,20 +42,22 @@
|
||||
<th>Token</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
<tr *ngFor="let token of tokens">
|
||||
<td>{{token.id}}</td>
|
||||
<td>{{token.name}}</td>
|
||||
<td>{{formatTimestamp(token.endValidityTime)}}</td>
|
||||
<td>{{token.token}}</td>
|
||||
<td>
|
||||
<button
|
||||
class="square-button login color-button-cancel color-shadow-black"
|
||||
(click)="onRemoveApplicationToken($event, token)"
|
||||
type="submit">
|
||||
<i class="material-icons">delete_forever</i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@for (token of tokens; track token.id;) {
|
||||
<tr>
|
||||
<td>{{token.id}}</td>
|
||||
<td>{{token.name}}</td>
|
||||
<td>{{formatTimestamp(token.endValidityTime)}}</td>
|
||||
<td>{{token.token}}</td>
|
||||
<td>
|
||||
<button
|
||||
class="square-button login color-button-cancel color-shadow-black"
|
||||
(click)="onRemoveApplicationToken($event, token)"
|
||||
type="submit">
|
||||
<i class="material-icons">delete_forever</i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</body>
|
||||
</burger-property>
|
||||
|
@ -61,7 +61,7 @@ export class ApplicationEditScene implements OnInit {
|
||||
this.configureInput();
|
||||
}
|
||||
|
||||
formatTimestamp(unix_timestamp: number) {
|
||||
formatTimestamp(unix_timestamp: string) {
|
||||
return new Date(unix_timestamp).toISOString().replace("T", " ").replace("Z", " GMT").replace(".000", "");
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ export class ApplicationEditScene implements OnInit {
|
||||
type: SettingType.STRING,
|
||||
title: 'Redirect:',
|
||||
description: "Redirect when login (http://):",
|
||||
placeholder: 'Enter http redirect adresses',
|
||||
placeholder: 'Enter http redirect addresses',
|
||||
key: 'redirect',
|
||||
value: this.application?.redirect,
|
||||
checker: (value: CheckerParameterType) => { return this.checkRedirect(value) },
|
||||
@ -104,7 +104,7 @@ export class ApplicationEditScene implements OnInit {
|
||||
type: SettingType.STRING,
|
||||
title: 'Redirect (dev):',
|
||||
description: "Redirect development (http://):",
|
||||
placeholder: 'Enter http redirect adresses',
|
||||
placeholder: 'Enter http redirect addresses',
|
||||
key: 'redirectDev',
|
||||
value: this.application?.redirectDev,
|
||||
},
|
||||
|
@ -12,20 +12,22 @@
|
||||
<th>login</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
<tr *ngFor="let user of users">
|
||||
<td>{{user.id}}</td>
|
||||
<td>{{user.login}}</td>
|
||||
<td>
|
||||
<button class="square-button login color-shadow-black"
|
||||
(click)="onEditUserRight($event, user)" type="submit">
|
||||
<i class="material-icons">edit</i>
|
||||
</button>
|
||||
<button class="square-button login color-button-cancel color-shadow-black"
|
||||
(click)="onRemoveApplicationUser($event, user)" type="submit">
|
||||
<i class="material-icons">delete</i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@for (user of users; track user.id;) {
|
||||
<tr>
|
||||
<td>{{user.id}}</td>
|
||||
<td>{{user.login}}</td>
|
||||
<td>
|
||||
<button class="square-button login color-shadow-black"
|
||||
(click)="onEditUserRight($event, user)" type="submit">
|
||||
<i class="material-icons">edit</i>
|
||||
</button>
|
||||
<button class="square-button login color-button-cancel color-shadow-black"
|
||||
(click)="onRemoveApplicationUser($event, user)" type="submit">
|
||||
<i class="material-icons">delete</i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</body>
|
||||
</burger-property>
|
||||
@ -43,16 +45,18 @@
|
||||
<th>login</th>
|
||||
<th>add</th>
|
||||
</tr>
|
||||
<tr *ngFor="let user of notUsers">
|
||||
<td>{{user.id}}</td>
|
||||
<td>{{user.login}}</td>
|
||||
<td>
|
||||
<button class="square-button color-button-validate color-shadow-black"
|
||||
(click)="onAddApplicationUser($event, user)" type="submit">
|
||||
<i class="material-icons">add</i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@for (user of notUsers; track user.id;) {
|
||||
<tr>
|
||||
<td>{{user.id}}</td>
|
||||
<td>{{user.login}}</td>
|
||||
<td>
|
||||
<button class="square-button color-button-validate color-shadow-black"
|
||||
(click)="onAddApplicationUser($event, user)" type="submit">
|
||||
<i class="material-icons">add</i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</body>
|
||||
</burger-property>
|
||||
|
@ -4,17 +4,7 @@
|
||||
<burger-property>
|
||||
<name>User right: {{applicationName}} / {{userName}}</name>
|
||||
<description>Update the user rights:</description>
|
||||
|
||||
<body>
|
||||
<!--
|
||||
<spiner *ngIf="editApplicationMenu===undefined"></spiner>
|
||||
<app-render-form
|
||||
*ngIf="editApplicationMenu!==undefined"
|
||||
[values]="editApplicationMenu"
|
||||
(deltaValues)="onEditValues($event)"
|
||||
(changeState)="onEditState($event)"
|
||||
></app-render-form>
|
||||
-->
|
||||
<app-render-settings [values]="editMenu" (deltaValues)="onEditValues($event)"
|
||||
(changeState)="onEditState($event)"></app-render-settings>
|
||||
</body>
|
||||
|
@ -16,29 +16,33 @@
|
||||
<th>Notification</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
<tr *ngFor="let application of applications">
|
||||
<td>{{application.id}}</td>
|
||||
<td>{{application.name}}</td>
|
||||
<td>{{application.description}}</td>
|
||||
<td>{{application.redirect}}</td>
|
||||
<td>{{application.ttl}}</td>
|
||||
<td>{{application.notification}}</td>
|
||||
<td>
|
||||
<button class="square-button login color-shadow-black"
|
||||
(click)="onEditApplication($event, application)" type="submit">
|
||||
<i class="material-icons">edit</i>
|
||||
</button>
|
||||
<button class="square-button login color-shadow-black"
|
||||
(click)="onEditRightApplication($event, application)" type="submit">
|
||||
<i class="material-icons">admin_panel_settings</i>
|
||||
</button>
|
||||
<button *ngIf="application.id !== 0"
|
||||
class="square-button login color-button-cancel color-shadow-black"
|
||||
(click)="onRemoveApplication($event, application)" type="submit">
|
||||
<i class="material-icons">delete_forever</i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@for (application of applications; track application.id;) {
|
||||
<tr>
|
||||
<td>{{application.id}}</td>
|
||||
<td>{{application.name}}</td>
|
||||
<td>{{application.description}}</td>
|
||||
<td>{{application.redirect}}</td>
|
||||
<td>{{application.ttl}}</td>
|
||||
<td>{{application.notification}}</td>
|
||||
<td>
|
||||
<button class="square-button login color-shadow-black"
|
||||
(click)="onEditApplication($event, application)" type="submit">
|
||||
<i class="material-icons">edit</i>
|
||||
</button>
|
||||
<button class="square-button login color-shadow-black"
|
||||
(click)="onEditRightApplication($event, application)" type="submit">
|
||||
<i class="material-icons">admin_panel_settings</i>
|
||||
</button>
|
||||
@if(application.id !== 0) {
|
||||
<button class="square-button login color-button-cancel color-shadow-black"
|
||||
(click)="onRemoveApplication($event, application)"
|
||||
type="submit">
|
||||
<i class="material-icons">delete_forever</i>
|
||||
</button>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</body>
|
||||
</burger-property>
|
||||
|
@ -6,69 +6,77 @@
|
||||
<div class="imgContainer">
|
||||
<img src="assets/images/avatar_generic.svg" alt="Avatar" class="avatar" />
|
||||
</div>
|
||||
<div class="container" *ngIf="updateState==='filling'">
|
||||
<!-- Previous password section -->
|
||||
<label for="passwordOld"><b>Previous password</b></label>
|
||||
<app-password-entry
|
||||
[value]="passwordOld"
|
||||
placeholder="Enter current password"
|
||||
[hasError]="passwordOldState !== true"
|
||||
(changeValue)="checkPasswordOld($event)"></app-password-entry>
|
||||
<app-error-message-state [value]="passwordOldState"></app-error-message-state>
|
||||
|
||||
<!-- New password section -->
|
||||
<label for="password1"><b>New password</b></label>
|
||||
<app-password-entry
|
||||
[value]="password1"
|
||||
placeholder="Enter new password"
|
||||
[hasError]="password1State !== true"
|
||||
(changeValue)="checkPassword($event)"></app-password-entry>
|
||||
<app-error-message-state [value]="password1State"></app-error-message-state>
|
||||
@if(updateState==='filling') {
|
||||
<div class="container">
|
||||
<!-- Previous password section -->
|
||||
<label for="passwordOld"><b>Previous password</b></label>
|
||||
<app-password-entry
|
||||
[value]="passwordOld"
|
||||
placeholder="Enter current password"
|
||||
[hasError]="passwordOldState !== true"
|
||||
(changeValue)="checkPasswordOld($event)"></app-password-entry>
|
||||
<app-error-message-state [value]="passwordOldState"></app-error-message-state>
|
||||
|
||||
<!-- New password section -->
|
||||
<label for="password1"><b>New password</b></label>
|
||||
<app-password-entry
|
||||
[value]="password1"
|
||||
placeholder="Enter new password"
|
||||
[hasError]="password1State !== true"
|
||||
(changeValue)="checkPassword($event)"></app-password-entry>
|
||||
<app-error-message-state [value]="password1State"></app-error-message-state>
|
||||
|
||||
<!-- New password section (verify) -->
|
||||
<label for="password2"><b>New password (2<sup>nd</sup> time)</b></label>
|
||||
<app-password-entry
|
||||
[value]="password2"
|
||||
placeholder="Enter new password (verify)"
|
||||
[hasError]="password2State !== true"
|
||||
(changeValue)="checkPassword2($event)"></app-password-entry>
|
||||
<app-error-message-state [value]="password2State"></app-error-message-state>
|
||||
</div>
|
||||
<div class="container" *ngIf="updateState==='filling'">
|
||||
<button class="button cancel color-button-cancel color-shadow-black" (click)="onCancel()">Cancel</button>
|
||||
<button
|
||||
class="button login color-button-validate color-shadow-black"
|
||||
id="login-button"
|
||||
[disabled]="validateButtonDisabled"
|
||||
(click)="onChangePassword()"
|
||||
type="submit">
|
||||
Change Password
|
||||
</button>
|
||||
</div>
|
||||
<div class="container-fix-height" *ngIf="updateState==='sending'">
|
||||
<label><br/><br/><b>Updating ...</b></label><br/><br/>
|
||||
<spiner></spiner>
|
||||
</div>
|
||||
<div class="container-fix-height" *ngIf="updateState==='done'">
|
||||
<label><br/><br/><br/><b>Update is done.</b></label>
|
||||
</div>
|
||||
<div class="container" *ngIf="updateState==='done'">
|
||||
<button
|
||||
class="button retry color-button-validate color-shadow-black"
|
||||
(click)="onRetry()">
|
||||
Change again ...
|
||||
</button>
|
||||
</div>
|
||||
<div class="container-fix-height" *ngIf="updateState==='error'">
|
||||
<label><b>Update FAIL with error:</b></label>
|
||||
<label>{{error}}</label>
|
||||
</div>
|
||||
<div class="container" *ngIf="updateState==='error'">
|
||||
<button
|
||||
class="button retry color-button-validate color-shadow-black"
|
||||
(click)="onRetry()">
|
||||
Retry
|
||||
</button>
|
||||
</div>
|
||||
<!-- New password section (verify) -->
|
||||
<label for="password2"><b>New password (2<sup>nd</sup> time)</b></label>
|
||||
<app-password-entry
|
||||
[value]="password2"
|
||||
placeholder="Enter new password (verify)"
|
||||
[hasError]="password2State !== true"
|
||||
(changeValue)="checkPassword2($event)"></app-password-entry>
|
||||
<app-error-message-state [value]="password2State"></app-error-message-state>
|
||||
</div>
|
||||
<div class="container">
|
||||
<button class="button cancel color-button-cancel color-shadow-black" (click)="onCancel()">Cancel</button>
|
||||
<button
|
||||
class="button login color-button-validate color-shadow-black"
|
||||
id="login-button"
|
||||
[disabled]="validateButtonDisabled"
|
||||
(click)="onChangePassword()"
|
||||
type="submit">
|
||||
Change Password
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
@else if(updateState==='sending') {
|
||||
<div class="container-fix-height">
|
||||
<label><br/><br/><b>Updating ...</b></label><br/><br/>
|
||||
<spiner></spiner>
|
||||
</div>
|
||||
}
|
||||
@else if (updateState==='done') {
|
||||
<div class="container-fix-height">
|
||||
<label><br/><br/><br/><b>Update is done.</b></label>
|
||||
</div>
|
||||
<div class="container">
|
||||
<button
|
||||
class="button retry color-button-validate color-shadow-black"
|
||||
(click)="onRetry()">
|
||||
Change again ...
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
@else if (updateState==='error') {
|
||||
<div class="container-fix-height">
|
||||
<label><b>Update FAIL with error:</b></label>
|
||||
<label>{{error}}</label>
|
||||
</div>
|
||||
<div class="container">
|
||||
<button
|
||||
class="button retry color-button-validate color-shadow-black"
|
||||
(click)="onRetry()">
|
||||
Retry
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -5,10 +5,12 @@
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="global-help">
|
||||
<div class="image" *ngFor="let data of dataList">
|
||||
<button class="button unselectable" (click)="onClick($event, data)" (auxclick)="onClick($event, data)">
|
||||
{{data.name}}
|
||||
</button>
|
||||
</div>
|
||||
@for (data of dataList; track data;) {
|
||||
<div class="image">
|
||||
<button class="button unselectable" (click)="onClick($event, data)" (auxclick)="onClick($event, data)">
|
||||
{{data.name}}
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -15,33 +15,37 @@
|
||||
<th>avatar</th>
|
||||
<th>lastConnection</th>
|
||||
</tr>
|
||||
<tr *ngFor="let user of users">
|
||||
<td>{{user.id}}</td>
|
||||
<td>{{user.login}}</td>
|
||||
<td>{{user.email}}</td>
|
||||
<td>
|
||||
<app-checkbox
|
||||
[value]="user.admin"
|
||||
*ngIf="adminLogin !== user.login && user.adminState === undefined"
|
||||
(changeValue)="onSetAdmin($event, user)"></app-checkbox>
|
||||
{{adminLogin === user.login?"yes":""}}
|
||||
<app-async-status-component
|
||||
*ngIf="user.adminState !== undefined"
|
||||
[value]="user.adminState"
|
||||
></app-async-status-component>
|
||||
</td>
|
||||
<td>
|
||||
<app-checkbox
|
||||
[value]="user.blocked"
|
||||
*ngIf="adminLogin !== user.login && user.blockedState === undefined"
|
||||
(changeValue)="onSetBlocked($event, user)"></app-checkbox>
|
||||
<app-async-status-component
|
||||
*ngIf="user.blockedState !== undefined"
|
||||
[value]="user.blockedState"
|
||||
></app-async-status-component></td>
|
||||
<td>{{user.avatar?"yes":"---"}}</td>
|
||||
<td>{{formatTimestamp(user.lastConnection)}}</td>
|
||||
</tr>
|
||||
@for (user of users; track user.id;) {
|
||||
<tr>
|
||||
<td>{{user.id}}</td>
|
||||
<td>{{user.login}}</td>
|
||||
<td>{{user.email}}</td>
|
||||
<td>
|
||||
@if(adminLogin !== user.login && user.adminState === undefined) {
|
||||
<app-checkbox
|
||||
[value]="user.admin"
|
||||
(changeValue)="onSetAdmin($event, user)"/>
|
||||
}
|
||||
{{adminLogin === user.login?"yes":""}}
|
||||
@if(user.adminState !== undefined) {
|
||||
<app-async-status-component
|
||||
[value]="user.adminState" />
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if(adminLogin !== user.login && user.blockedState === undefined) {
|
||||
<app-checkbox
|
||||
[value]="user.blocked"
|
||||
(changeValue)="onSetBlocked($event, user)"/>
|
||||
}
|
||||
@if(user.blockedState !== undefined) {
|
||||
<app-async-status-component [value]="user.blockedState"/>
|
||||
}
|
||||
</td>
|
||||
<td>{{user.avatar?"yes":"---"}}</td>
|
||||
<td>{{formatTimestamp(user.lastConnection)}}</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</body>
|
||||
</burger-property>
|
||||
|
@ -1,28 +1,32 @@
|
||||
<div class="generic-page">
|
||||
<div class="title">Global SSO Management</div>
|
||||
<div class="fill-all">
|
||||
<burger-property *ngFor="let data of menu">
|
||||
<name>{{data.title}}</name>
|
||||
<description>{{data.description}}</description>
|
||||
<body>
|
||||
<spiner *ngIf="data.values===undefined"></spiner>
|
||||
<app-render-settings
|
||||
*ngIf="data.values!==undefined"
|
||||
[values]="data.values"
|
||||
(deltaValues)="onDeltaValues($event, data)"
|
||||
(changeState)="onState($event, data)"
|
||||
></app-render-settings>
|
||||
</body>
|
||||
<footer>
|
||||
<button
|
||||
class="button login color-button-validate color-shadow-black"
|
||||
[disabled]="data.state !== 0"
|
||||
(click)="onUpdate(data)"
|
||||
type="submit">
|
||||
Update ...
|
||||
</button>
|
||||
</footer>
|
||||
</burger-property>
|
||||
@for (data of menu; track data;) {
|
||||
<burger-property>
|
||||
<name>{{data.title}}</name>
|
||||
<description>{{data.description}}</description>
|
||||
<body>
|
||||
@if(data.values===undefined) {
|
||||
<spiner/>
|
||||
}
|
||||
@else {
|
||||
<app-render-settings
|
||||
[values]="data.values"
|
||||
(deltaValues)="onDeltaValues($event, data)"
|
||||
(changeState)="onState($event, data)"/>
|
||||
}
|
||||
</body>
|
||||
<footer>
|
||||
<button
|
||||
class="button login color-button-validate color-shadow-black"
|
||||
[disabled]="data.state !== 0"
|
||||
(click)="onUpdate(data)"
|
||||
type="submit">
|
||||
Update ...
|
||||
</button>
|
||||
</footer>
|
||||
</burger-property>
|
||||
}
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -36,20 +36,22 @@
|
||||
</div>
|
||||
<div class="container">
|
||||
<button class="button cancel color-button-cancel color-shadow-black" (click)="onCancel()">Cancel</button>
|
||||
<button
|
||||
class="button login color-button-validate color-shadow-black"
|
||||
*ngIf="ssoReady"
|
||||
id="login-button"
|
||||
[disabled]="loginButtonDisabled"
|
||||
(click)="onLogin()">
|
||||
Login
|
||||
</button>
|
||||
<button
|
||||
class="button login color-button-validate color-shadow-black"
|
||||
*ngIf="!ssoReady"
|
||||
[disabled]="true">
|
||||
Login (wait info)
|
||||
</button>
|
||||
@if(ssoReady) {
|
||||
<button
|
||||
class="button login color-button-validate color-shadow-black"
|
||||
id="login-button"
|
||||
[disabled]="loginButtonDisabled"
|
||||
(click)="onLogin()">
|
||||
Login
|
||||
</button>
|
||||
}
|
||||
@else {
|
||||
<button
|
||||
class="button login color-button-validate color-shadow-black"
|
||||
[disabled]="true">
|
||||
Login (wait info)
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
<div class="container">{{error}}</div>
|
||||
</div>
|
||||
|
@ -1,84 +1,93 @@
|
||||
<div class="full-mode" *ngIf="!signUpEnable">
|
||||
<div class="global-help">
|
||||
<div class="sso"><label class="unselectable">Sign-up is disable !!! </label></div>
|
||||
@if(!signUpEnable) {
|
||||
<div class="full-mode">
|
||||
<div class="global-help">
|
||||
<div class="sso"><label class="unselectable">Sign-up is disable !!! </label></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@else {
|
||||
<div class="left">
|
||||
<div class="global-help">
|
||||
<div class="sso"><label class="unselectable">Single Sign On interface (SSO)</label></div>
|
||||
<div><label class="unselectable">For:</label></div>
|
||||
<div class="time"><label class="unselectable">Karideo (Video streaming)</label></div>
|
||||
<div class="time"><label class="unselectable">Karusic (Music streaming)</label></div>
|
||||
<div class="time"><label class="unselectable">Karoto (Picture / Photo)</label></div>
|
||||
<div class="comment"><label class="unselectable">Karcom (Messaging)</label></div>
|
||||
<div class="time"><label class="unselectable">Karidiary (Parsonal diary)</label></div>
|
||||
<!--
|
||||
<div class="comment"><label class="unselectable">Rate and comment your medias</label></div>
|
||||
<div class="time"><label class="unselectable">Keep last view position</label></div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="modal-content color-background-vignette container-global">
|
||||
<div class="logo"></div>
|
||||
<div class="containerCenter">
|
||||
<label><b>Sign-up</b></label>
|
||||
</div>
|
||||
<div class="container">
|
||||
<label for="login_field"><b>Login</b></label>
|
||||
<input
|
||||
id="username"
|
||||
name="username"
|
||||
class="{{loginIcon}}"
|
||||
type="text"
|
||||
required=""
|
||||
placeholder="Pick a Username"
|
||||
[value]="login"
|
||||
(input)="checkLogin($event.target.value)" />
|
||||
@if(loginHelp) {
|
||||
<div class="error color-shadow-black">{{loginHelp}}</div>
|
||||
}
|
||||
<label for="login_field"><b>E-mail</b></label>
|
||||
<input
|
||||
id="email"
|
||||
name="e-mail"
|
||||
class="{{emailIcon}}"
|
||||
type="text"
|
||||
required=""
|
||||
placeholder="you@example.com"
|
||||
[value]="email"
|
||||
(input)="checkEmail($event.target.value)" />
|
||||
@if(emailHelp) {
|
||||
<div class="error color-shadow-black">{{emailHelp}}</div>
|
||||
}
|
||||
<label for="password"><b>Password</b></label>
|
||||
<input
|
||||
type="password"
|
||||
id="password"
|
||||
name="password"
|
||||
class="{{passIcon}}"
|
||||
placeholder="Enter Password"
|
||||
required=""
|
||||
[value]="password"
|
||||
(input)="checkPassword($event.target.value)" />
|
||||
@if(passHelp) {
|
||||
<div class="error color-shadow-black">{{passHelp}}</div>
|
||||
}
|
||||
</div>
|
||||
<div class="container">
|
||||
<button
|
||||
class="button fill-x color-button-validate color-shadow-black"
|
||||
id="onSignUp-button"
|
||||
[disabled]="signUpButtonDisabled"
|
||||
(click)="onSignUp()"
|
||||
type="submit">
|
||||
<i class="material-icons">mode_edit</i> Sign up for Karideo
|
||||
</button>
|
||||
</div>
|
||||
<div class="container commmon-policy">
|
||||
By clicking "Sign up for Karideo", you agree to our <a href="help/terms">terms of service</a> and
|
||||
<a href="help/privacy">privacy policy</a>.<br />
|
||||
Well occasionally send you account related emails.
|
||||
</div>
|
||||
<div class="container">
|
||||
<a class="forgot" href="forgot-password">Forgot password?</a>
|
||||
</div>
|
||||
|
||||
<div class="left" *ngIf="signUpEnable">
|
||||
<div class="global-help">
|
||||
<div class="sso"><label class="unselectable">Single Sign On interface (SSO)</label></div>
|
||||
<div><label class="unselectable">For:</label></div>
|
||||
<div class="time"><label class="unselectable">Karideo (Video streaming)</label></div>
|
||||
<div class="time"><label class="unselectable">Karusic (Music streaming)</label></div>
|
||||
<div class="time"><label class="unselectable">Karoto (Picture / Photo)</label></div>
|
||||
<div class="comment"><label class="unselectable">Karcom (Messaging)</label></div>
|
||||
<div class="time"><label class="unselectable">Karidiary (Parsonal diary)</label></div>
|
||||
<!--
|
||||
<div class="comment"><label class="unselectable">Rate and comment your medias</label></div>
|
||||
<div class="time"><label class="unselectable">Keep last view position</label></div>
|
||||
-->
|
||||
<div class="container">{{error}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right" *ngIf="signUpEnable">
|
||||
<div class="modal-content color-background-vignette container-global">
|
||||
<div class="logo"></div>
|
||||
<div class="containerCenter">
|
||||
<label><b>Sign-up</b></label>
|
||||
</div>
|
||||
<div class="container">
|
||||
<label for="login_field"><b>Login</b></label>
|
||||
<input
|
||||
id="username"
|
||||
name="username"
|
||||
class="{{loginIcon}}"
|
||||
type="text"
|
||||
required=""
|
||||
placeholder="Pick a Username"
|
||||
[value]="login"
|
||||
(input)="checkLogin($event.target.value)" />
|
||||
<div class="error color-shadow-black" *ngIf="loginHelp">{{loginHelp}}</div>
|
||||
<label for="login_field"><b>E-mail</b></label>
|
||||
<input
|
||||
id="email"
|
||||
name="e-mail"
|
||||
class="{{emailIcon}}"
|
||||
type="text"
|
||||
required=""
|
||||
placeholder="you@example.com"
|
||||
[value]="email"
|
||||
(input)="checkEmail($event.target.value)" />
|
||||
<div class="error color-shadow-black" *ngIf="emailHelp">{{emailHelp}}</div>
|
||||
<label for="password"><b>Password</b></label>
|
||||
<input
|
||||
type="password"
|
||||
id="password"
|
||||
name="password"
|
||||
class="{{passIcon}}"
|
||||
placeholder="Enter Password"
|
||||
required=""
|
||||
[value]="password"
|
||||
(input)="checkPassword($event.target.value)" />
|
||||
<div class="error color-shadow-black" *ngIf="passHelp">{{passHelp}}</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<button
|
||||
class="button fill-x color-button-validate color-shadow-black"
|
||||
id="onSignUp-button"
|
||||
[disabled]="signUpButtonDisabled"
|
||||
(click)="onSignUp()"
|
||||
type="submit">
|
||||
<i class="material-icons">mode_edit</i> Sign up for Karideo
|
||||
</button>
|
||||
</div>
|
||||
<div class="container commmon-policy">
|
||||
By clicking "Sign up for Karideo", you agree to our <a href="help/terms">terms of service</a> and
|
||||
<a href="help/privacy">privacy policy</a>.<br />
|
||||
Well occasionally send you account related emails.
|
||||
</div>
|
||||
<div class="container">
|
||||
<a class="forgot" href="forgot-password">Forgot password?</a>
|
||||
</div>
|
||||
|
||||
<div class="container">{{error}}</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
@ -30,6 +30,7 @@ export interface SpecificReturnResponse {
|
||||
url: string;
|
||||
}
|
||||
export interface GetApplicationSmallResponse {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
redirect: string;
|
||||
@ -204,7 +205,7 @@ export class ApplicationService {
|
||||
.then((response: ModelResponseHttp) => {
|
||||
// TODO: check type ...
|
||||
console.log(
|
||||
`retreive return for application : get some data to check: ${JSON.stringify(response.data)}`
|
||||
`retrieve return for application : get some data to check: ${JSON.stringify(response.data)}`
|
||||
);
|
||||
// tODO: check the format...
|
||||
resolve(response.data);
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit c3489422f2df7f16465b4358e868664af9cda81c
|
||||
Subproject commit 147a955b195eb7c90e445d404f043d9a363087ca
|
@ -1,29 +0,0 @@
|
||||
/**
|
||||
* Required to support Web Animations `@angular/platform-browser/animations`.
|
||||
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
|
||||
**/
|
||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||
|
||||
/**
|
||||
* By default, zone.js will patch all possible macroTask and DomEvents
|
||||
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
||||
*/
|
||||
|
||||
// (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
||||
// (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
||||
// (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
||||
|
||||
/*
|
||||
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
||||
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
||||
*/
|
||||
// (window as any).__Zone_enable_cross_context_check = true;
|
||||
|
||||
/** *************************************************************************************************
|
||||
* Zone JS is required by default for Angular itself.
|
||||
*/
|
||||
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
||||
|
||||
/** *************************************************************************************************
|
||||
* APPLICATION IMPORTS
|
||||
*/
|
@ -3,8 +3,16 @@
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/spec",
|
||||
"baseUrl": "./",
|
||||
"types": ["jest", "node"]
|
||||
"types": [
|
||||
"jest",
|
||||
"node"
|
||||
]
|
||||
},
|
||||
"files": ["test.ts", "polyfills.ts"],
|
||||
"include": ["**/*.spec.ts", "**/*.d.ts"]
|
||||
}
|
||||
"files": [
|
||||
"test.ts"
|
||||
],
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user