[DEV] update angular17 and correct right get

This commit is contained in:
Edouard DUPIN 2024-02-25 19:05:06 +01:00
parent 05972126e7
commit 55fccf1848
25 changed files with 9664 additions and 15829 deletions

View File

@ -6,8 +6,8 @@
<version>0.5.0</version> <version>0.5.0</version>
<properties> <properties>
<maven.compiler.version>3.1</maven.compiler.version> <maven.compiler.version>3.1</maven.compiler.version>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>21</maven.compiler.target>
<maven.dependency.version>3.1.1</maven.dependency.version> <maven.dependency.version>3.1.1</maven.dependency.version>
</properties> </properties>
<repositories> <repositories>

View File

@ -185,7 +185,7 @@ public class ApplicationResource {
final List<ApplicationSmall> out = new ArrayList<>(); final List<ApplicationSmall> out = new ArrayList<>();
for (final Application app : tmp) { for (final Application app : tmp) {
if (regular.indexOf(app.id) != -1) { 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; return out;

View File

@ -36,31 +36,39 @@ public class RightResource {
} }
public static List<Right> getRawUserRight(final long userId, final long applicationId) throws Exception { 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 { public static Map<String, Object> getUserRight(final long userId, final long applicationId) throws Exception {
final Map<String, Object> out = new HashMap<>(); final Map<String, Object> out = new HashMap<>();
final List<RightDescription> rightsDescriptions = getApplicationRightDecription(applicationId); 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) { if (rightsDescriptions != null && rightsDescriptions.size() != 0) {
final List<Right> rights = getRawUserRight(userId, applicationId); final List<Right> rights = getRawUserRight(userId, applicationId);
logger.debug("Get some user right: count={} userID={}", rights.size(), userId); logger.trace("Get some user right: count={} userID={} applicationId={}", rights.size(), userId, applicationId);
logger.debug("Rights:"); logger.trace("Rights:");
for (final Right elem : rights) { for (final Right elem : rights) {
logger.debug(" - applId={} rightDescriptionId={} value={}", elem.applicationId, elem.rightDescriptionId, elem.value); logger.trace(" - 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("RightDescription:");
for (final RightDescription description : rightsDescriptions) { for (final RightDescription description : rightsDescriptions) {
if (description == null) { if (description == null) {
// TODO: this is a really strange case to manage later...
continue; 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) { if (right != null) {
out.put(description.key, Transform.convertToType(description.type, right.value)); out.put(description.key, Transform.convertToType(description.type, right.value));
} else if (description.defaultValue != null) { } 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"); throw new IllegalArgumentException("Request change right on an application that does not manage any right");
} }
final List<Right> rights = getRawUserRight(userId, applicationId); 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) { for (final RightDescription description : rightsDescriptions) {
if (description == null) { if (description == null) {
// TODO: this is a really strange case to manage later... // TODO: this is a really strange case to manage later...
@ -98,8 +106,16 @@ public class RightResource {
if (convertedValue == null) { if (convertedValue == null) {
throw new IllegalArgumentException("Uncompatible value:'" + description.type + "'"); throw new IllegalArgumentException("Uncompatible value:'" + description.type + "'");
} }
Right right = rights.stream().filter(elem -> elem.rightDescriptionId == description.id).findAny().orElse(null); List<Right> allRights = rights.stream().filter(elem -> elem.rightDescriptionId.equals(description.id)).toList();
if (right != null) { 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 // The value exist, we need to update it
logger.debug("Request update a knonwn parameter: {} with {}", description.key, newValue); logger.debug("Request update a knonwn parameter: {} with {}", description.key, newValue);
right.value = convertedValue; right.value = convertedValue;
@ -107,7 +123,7 @@ public class RightResource {
} else { } else {
// we need to create it // we need to create it
logger.debug("Request create parameter: {} with {}", description.key, newValue); logger.debug("Request create parameter: {} with {}", description.key, newValue);
right = new Right(); Right right = new Right();
right.applicationId = applicationId; right.applicationId = applicationId;
right.userId = userId; right.userId = userId;
right.rightDescriptionId = description.id; right.rightDescriptionId = description.id;

View File

@ -105,7 +105,7 @@ public class UserResource {
@RolesAllowed("ADMIN") @RolesAllowed("ADMIN")
public Map<String, Object> patchApplicationRight(@Context final SecurityContext sc, @PathParam("userId") final long userId, @PathParam("applicationId") final long applicationId, 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 { 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); RightResource.updateUserRight(userId, applicationId, data);
return RightResource.getUserRight(userId, applicationId); return RightResource.getUserRight(userId, applicationId);
} }

View File

@ -1,14 +1,16 @@
package org.kar.karso.model; package org.kar.karso.model;
public class ApplicationSmall { public class ApplicationSmall {
public Long id;
public String name; public String name;
public String description; public String description;
public String redirect; public String redirect;
public ApplicationSmall() {} public ApplicationSmall() {}
public ApplicationSmall(String name, String description, String redirect) { public ApplicationSmall(Long id, String name, String description, String redirect) {
super(); super();
this.id = id;
this.name = name; this.name = name;
this.description = description; this.description = description;
this.redirect = redirect; this.redirect = redirect;

View File

@ -15,7 +15,9 @@
"index": "src/index.html", "index": "src/index.html",
"main": "src/app-root/main.ts", "main": "src/app-root/main.ts",
"tsConfig": "src/tsconfig.app-root.json", "tsConfig": "src/tsconfig.app-root.json",
"polyfills": "src/polyfills.ts", "polyfills": [
"zone.js"
],
"assets": [ "assets": [
"src/assets", "src/assets",
"src/favicon.ico" "src/favicon.ico"
@ -83,7 +85,9 @@
"options": { "options": {
"main": "src/test.ts", "main": "src/test.ts",
"karmaConfig": "./karma.conf.js", "karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts", "polyfills": [
"zone.js"
],
"tsConfig": "src/tsconfig.spec.json", "tsConfig": "src/tsconfig.spec.json",
"scripts": [], "scripts": [],
"styles": [ "styles": [
@ -161,7 +165,9 @@
"index": "src/index.html", "index": "src/index.html",
"main": "src/app-edge/main.ts", "main": "src/app-edge/main.ts",
"tsConfig": "src/tsconfig.app-edge.json", "tsConfig": "src/tsconfig.app-edge.json",
"polyfills": "src/polyfills.ts", "polyfills": [
"zone.js"
],
"assets": [ "assets": [
"src/assets", "src/assets",
"src/favicon.ico" "src/favicon.ico"

24680
front/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,44 +12,47 @@
"test-coverage": "ng test karso --code-coverage", "test-coverage": "ng test karso --code-coverage",
"lint": "ng lint", "lint": "ng lint",
"style": "prettier --write .", "style": "prettier --write .",
"e2e": "ng e2e" "e2e": "ng e2e",
"update_packages": "ncu --upgrade",
"install_dependency": "npm install"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^14.2.10", "@angular/animations": "^17.2.2",
"@angular/cdk": "^14.2.7", "@angular/cdk": "^17.2.1",
"@angular/common": "^14.2.10", "@angular/common": "^17.2.2",
"@angular/compiler": "^14.2.10", "@angular/compiler": "^17.2.2",
"@angular/core": "^14.2.10", "@angular/core": "^17.2.2",
"@angular/forms": "^14.2.10", "@angular/forms": "^17.2.2",
"@angular/material": "^14.2.7", "@angular/material": "^17.2.1",
"@angular/platform-browser": "^14.2.10", "@angular/platform-browser": "^17.2.2",
"@angular/platform-browser-dynamic": "^14.2.10", "@angular/platform-browser-dynamic": "^17.2.2",
"@angular/router": "^14.2.10", "@angular/router": "^17.2.2",
"rxjs": "^7.5.7", "rxjs": "^7.8.1",
"zone.js": "^0.12.0" "zone.js": "^0.14.4"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "^14.2.9", "@angular-devkit/build-angular": "^17.2.1",
"@angular-eslint/builder": "14.2.0", "@angular-eslint/builder": "17.2.1",
"@angular-eslint/eslint-plugin": "14.2.0", "@angular-eslint/eslint-plugin": "17.2.1",
"@angular-eslint/eslint-plugin-template": "14.2.0", "@angular-eslint/eslint-plugin-template": "17.2.1",
"@angular-eslint/schematics": "14.2.0", "@angular-eslint/schematics": "17.2.1",
"@angular-eslint/template-parser": "14.2.0", "@angular-eslint/template-parser": "17.2.1",
"@angular/cli": "^14.2.9", "@angular/cli": "^17.2.1",
"@angular/compiler-cli": "^14.2.10", "@angular/compiler-cli": "^17.2.2",
"@angular/language-service": "^14.2.10", "@angular/language-service": "^17.2.2",
"@playwright/test": "^1.28.1", "@playwright/test": "^1.41.2",
"@types/jest": "^29.2.4", "@types/jest": "^29.5.12",
"jasmine": "^4.5.0", "jasmine": "^5.1.0",
"jasmine-core": "^4.5.0", "jasmine-core": "^5.1.2",
"karma": "^6.4.1", "karma": "^6.4.2",
"karma-coverage": "^2.2.0", "karma-coverage": "^2.2.1",
"karma-coverage-istanbul-reporter": "^3.0.3", "karma-coverage-istanbul-reporter": "^3.0.3",
"karma-firefox-launcher": "^2.1.2", "karma-firefox-launcher": "^2.1.2",
"karma-jasmine": "^5.1.0", "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", "karma-spec-reporter": "^0.0.36",
"prettier": "^2.8.1" "prettier": "^3.2.5",
"npm-check-updates": "^16.14.15"
} }
} }

View File

@ -2,5 +2,7 @@
<app-top-menu [menu]="currentMenu" (callback)="eventOnMenu($event)"></app-top-menu> <app-top-menu [menu]="currentMenu" (callback)="eventOnMenu($event)"></app-top-menu>
<!-- all interfaced pages --> <!-- all interfaced pages -->
<div class="main-content"> <div class="main-content">
<router-outlet *ngIf="autoConnectedDone"></router-outlet> @if(autoConnectedDone) {
<router-outlet></router-outlet>
}
</div> </div>

View File

@ -2,5 +2,7 @@
<app-top-menu [menu]="currentMenu" (callback)="eventOnMenu($event)"></app-top-menu> <app-top-menu [menu]="currentMenu" (callback)="eventOnMenu($event)"></app-top-menu>
<!-- all interfaced pages --> <!-- all interfaced pages -->
<div class="main-content"> <div class="main-content">
<router-outlet *ngIf="autoConnectedDone"></router-outlet> @if(autoConnectedDone) {
<router-outlet></router-outlet>
}
</div> </div>

View File

@ -5,13 +5,16 @@
<name>Application properties</name> <name>Application properties</name>
<description>Update property of the application:</description> <description>Update property of the application:</description>
<body> <body>
<spiner *ngIf="editApplicationMenu===undefined"></spiner> @if(editApplicationMenu===undefined) {
<app-render-form <spiner></spiner>
*ngIf="editApplicationMenu!==undefined" }
[values]="editApplicationMenu" @else {
(deltaValues)="onEditValues($event)" <app-render-form
(changeState)="onEditState($event)" [values]="editApplicationMenu"
></app-render-form> (deltaValues)="onEditValues($event)"
(changeState)="onEditState($event)"
></app-render-form>
}
</body> </body>
<footer> <footer>
<button <button
@ -39,20 +42,22 @@
<th>Token</th> <th>Token</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
<tr *ngFor="let token of tokens"> @for (token of tokens; track token.id;) {
<td>{{token.id}}</td> <tr>
<td>{{token.name}}</td> <td>{{token.id}}</td>
<td>{{formatTimestamp(token.endValidityTime)}}</td> <td>{{token.name}}</td>
<td>{{token.token}}</td> <td>{{formatTimestamp(token.endValidityTime)}}</td>
<td> <td>{{token.token}}</td>
<button <td>
class="square-button login color-button-cancel color-shadow-black" <button
(click)="onRemoveApplicationToken($event, token)" class="square-button login color-button-cancel color-shadow-black"
type="submit"> (click)="onRemoveApplicationToken($event, token)"
<i class="material-icons">delete_forever</i> type="submit">
</button> <i class="material-icons">delete_forever</i>
</td> </button>
</tr> </td>
</tr>
}
</table> </table>
</body> </body>
</burger-property> </burger-property>

View File

@ -61,7 +61,7 @@ export class ApplicationEditScene implements OnInit {
this.configureInput(); this.configureInput();
} }
formatTimestamp(unix_timestamp: number) { formatTimestamp(unix_timestamp: string) {
return new Date(unix_timestamp).toISOString().replace("T", " ").replace("Z", " GMT").replace(".000", ""); 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, type: SettingType.STRING,
title: 'Redirect:', title: 'Redirect:',
description: "Redirect when login (http://):", description: "Redirect when login (http://):",
placeholder: 'Enter http redirect adresses', placeholder: 'Enter http redirect addresses',
key: 'redirect', key: 'redirect',
value: this.application?.redirect, value: this.application?.redirect,
checker: (value: CheckerParameterType) => { return this.checkRedirect(value) }, checker: (value: CheckerParameterType) => { return this.checkRedirect(value) },
@ -104,7 +104,7 @@ export class ApplicationEditScene implements OnInit {
type: SettingType.STRING, type: SettingType.STRING,
title: 'Redirect (dev):', title: 'Redirect (dev):',
description: "Redirect development (http://):", description: "Redirect development (http://):",
placeholder: 'Enter http redirect adresses', placeholder: 'Enter http redirect addresses',
key: 'redirectDev', key: 'redirectDev',
value: this.application?.redirectDev, value: this.application?.redirectDev,
}, },

View File

@ -12,20 +12,22 @@
<th>login</th> <th>login</th>
<th>actions</th> <th>actions</th>
</tr> </tr>
<tr *ngFor="let user of users"> @for (user of users; track user.id;) {
<td>{{user.id}}</td> <tr>
<td>{{user.login}}</td> <td>{{user.id}}</td>
<td> <td>{{user.login}}</td>
<button class="square-button login color-shadow-black" <td>
(click)="onEditUserRight($event, user)" type="submit"> <button class="square-button login color-shadow-black"
<i class="material-icons">edit</i> (click)="onEditUserRight($event, user)" type="submit">
</button>&nbsp; <i class="material-icons">edit</i>
<button class="square-button login color-button-cancel color-shadow-black" </button>&nbsp;
(click)="onRemoveApplicationUser($event, user)" type="submit"> <button class="square-button login color-button-cancel color-shadow-black"
<i class="material-icons">delete</i> (click)="onRemoveApplicationUser($event, user)" type="submit">
</button> <i class="material-icons">delete</i>
</td> </button>
</tr> </td>
</tr>
}
</table> </table>
</body> </body>
</burger-property> </burger-property>
@ -43,16 +45,18 @@
<th>login</th> <th>login</th>
<th>add</th> <th>add</th>
</tr> </tr>
<tr *ngFor="let user of notUsers"> @for (user of notUsers; track user.id;) {
<td>{{user.id}}</td> <tr>
<td>{{user.login}}</td> <td>{{user.id}}</td>
<td> <td>{{user.login}}</td>
<button class="square-button color-button-validate color-shadow-black" <td>
(click)="onAddApplicationUser($event, user)" type="submit"> <button class="square-button color-button-validate color-shadow-black"
<i class="material-icons">add</i> (click)="onAddApplicationUser($event, user)" type="submit">
</button> <i class="material-icons">add</i>
</td> </button>
</tr> </td>
</tr>
}
</table> </table>
</body> </body>
</burger-property> </burger-property>

View File

@ -4,17 +4,7 @@
<burger-property> <burger-property>
<name>User right: {{applicationName}} / {{userName}}</name> <name>User right: {{applicationName}} / {{userName}}</name>
<description>Update the user rights:</description> <description>Update the user rights:</description>
<body> <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)" <app-render-settings [values]="editMenu" (deltaValues)="onEditValues($event)"
(changeState)="onEditState($event)"></app-render-settings> (changeState)="onEditState($event)"></app-render-settings>
</body> </body>

View File

@ -16,29 +16,33 @@
<th>Notification</th> <th>Notification</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
<tr *ngFor="let application of applications"> @for (application of applications; track application.id;) {
<td>{{application.id}}</td> <tr>
<td>{{application.name}}</td> <td>{{application.id}}</td>
<td>{{application.description}}</td> <td>{{application.name}}</td>
<td>{{application.redirect}}</td> <td>{{application.description}}</td>
<td>{{application.ttl}}</td> <td>{{application.redirect}}</td>
<td>{{application.notification}}</td> <td>{{application.ttl}}</td>
<td> <td>{{application.notification}}</td>
<button class="square-button login color-shadow-black" <td>
(click)="onEditApplication($event, application)" type="submit"> <button class="square-button login color-shadow-black"
<i class="material-icons">edit</i> (click)="onEditApplication($event, application)" type="submit">
</button>&nbsp; <i class="material-icons">edit</i>
<button class="square-button login color-shadow-black" </button>&nbsp;
(click)="onEditRightApplication($event, application)" type="submit"> <button class="square-button login color-shadow-black"
<i class="material-icons">admin_panel_settings</i> (click)="onEditRightApplication($event, application)" type="submit">
</button>&nbsp; <i class="material-icons">admin_panel_settings</i>
<button *ngIf="application.id !== 0" </button>&nbsp;
class="square-button login color-button-cancel color-shadow-black" @if(application.id !== 0) {
(click)="onRemoveApplication($event, application)" type="submit"> <button class="square-button login color-button-cancel color-shadow-black"
<i class="material-icons">delete_forever</i> (click)="onRemoveApplication($event, application)"
</button> type="submit">
</td> <i class="material-icons">delete_forever</i>
</tr> </button>
}
</td>
</tr>
}
</table> </table>
</body> </body>
</burger-property> </burger-property>

View File

@ -6,69 +6,77 @@
<div class="imgContainer"> <div class="imgContainer">
<img src="assets/images/avatar_generic.svg" alt="Avatar" class="avatar" /> <img src="assets/images/avatar_generic.svg" alt="Avatar" class="avatar" />
</div> </div>
<div class="container" *ngIf="updateState==='filling'"> @if(updateState==='filling') {
<!-- Previous password section --> <div class="container">
<label for="passwordOld"><b>Previous password</b></label> <!-- Previous password section -->
<app-password-entry <label for="passwordOld"><b>Previous password</b></label>
[value]="passwordOld" <app-password-entry
placeholder="Enter current password" [value]="passwordOld"
[hasError]="passwordOldState !== true" placeholder="Enter current password"
(changeValue)="checkPasswordOld($event)"></app-password-entry> [hasError]="passwordOldState !== true"
<app-error-message-state [value]="passwordOldState"></app-error-message-state> (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> <!-- New password section -->
<app-password-entry <label for="password1"><b>New password</b></label>
[value]="password1" <app-password-entry
placeholder="Enter new password" [value]="password1"
[hasError]="password1State !== true" placeholder="Enter new password"
(changeValue)="checkPassword($event)"></app-password-entry> [hasError]="password1State !== true"
<app-error-message-state [value]="password1State"></app-error-message-state> (changeValue)="checkPassword($event)"></app-password-entry>
<app-error-message-state [value]="password1State"></app-error-message-state>
<!-- New password section (verify) --> <!-- New password section (verify) -->
<label for="password2"><b>New password (2<sup>nd</sup> time)</b></label> <label for="password2"><b>New password (2<sup>nd</sup> time)</b></label>
<app-password-entry <app-password-entry
[value]="password2" [value]="password2"
placeholder="Enter new password (verify)" placeholder="Enter new password (verify)"
[hasError]="password2State !== true" [hasError]="password2State !== true"
(changeValue)="checkPassword2($event)"></app-password-entry> (changeValue)="checkPassword2($event)"></app-password-entry>
<app-error-message-state [value]="password2State"></app-error-message-state> <app-error-message-state [value]="password2State"></app-error-message-state>
</div> </div>
<div class="container" *ngIf="updateState==='filling'"> <div class="container">
<button class="button cancel color-button-cancel color-shadow-black" (click)="onCancel()">Cancel</button> <button class="button cancel color-button-cancel color-shadow-black" (click)="onCancel()">Cancel</button>
<button <button
class="button login color-button-validate color-shadow-black" class="button login color-button-validate color-shadow-black"
id="login-button" id="login-button"
[disabled]="validateButtonDisabled" [disabled]="validateButtonDisabled"
(click)="onChangePassword()" (click)="onChangePassword()"
type="submit"> type="submit">
Change Password Change Password
</button> </button>
</div> </div>
<div class="container-fix-height" *ngIf="updateState==='sending'"> }
<label><br/><br/><b>Updating ...</b></label><br/><br/> @else if(updateState==='sending') {
<spiner></spiner> <div class="container-fix-height">
</div> <label><br/><br/><b>Updating ...</b></label><br/><br/>
<div class="container-fix-height" *ngIf="updateState==='done'"> <spiner></spiner>
<label><br/><br/><br/><b>Update is done.</b></label> </div>
</div> }
<div class="container" *ngIf="updateState==='done'"> @else if (updateState==='done') {
<button <div class="container-fix-height">
class="button retry color-button-validate color-shadow-black" <label><br/><br/><br/><b>Update is done.</b></label>
(click)="onRetry()"> </div>
Change again ... <div class="container">
</button> <button
</div> class="button retry color-button-validate color-shadow-black"
<div class="container-fix-height" *ngIf="updateState==='error'"> (click)="onRetry()">
<label><b>Update FAIL with error:</b></label> Change again ...
<label>{{error}}</label> </button>
</div> </div>
<div class="container" *ngIf="updateState==='error'"> }
<button @else if (updateState==='error') {
class="button retry color-button-validate color-shadow-black" <div class="container-fix-height">
(click)="onRetry()"> <label><b>Update FAIL with error:</b></label>
Retry <label>{{error}}</label>
</button> </div>
</div> <div class="container">
<button
class="button retry color-button-validate color-shadow-black"
(click)="onRetry()">
Retry
</button>
</div>
}
</div> </div>
</div> </div>

View File

@ -5,10 +5,12 @@
</div> </div>
<div class="right"> <div class="right">
<div class="global-help"> <div class="global-help">
<div class="image" *ngFor="let data of dataList"> @for (data of dataList; track data;) {
<button class="button unselectable" (click)="onClick($event, data)" (auxclick)="onClick($event, data)"> <div class="image">
{{data.name}} <button class="button unselectable" (click)="onClick($event, data)" (auxclick)="onClick($event, data)">
</button> {{data.name}}
</div> </button>
</div>
}
</div> </div>
</div> </div>

View File

@ -15,33 +15,37 @@
<th>avatar</th> <th>avatar</th>
<th>lastConnection</th> <th>lastConnection</th>
</tr> </tr>
<tr *ngFor="let user of users"> @for (user of users; track user.id;) {
<td>{{user.id}}</td> <tr>
<td>{{user.login}}</td> <td>{{user.id}}</td>
<td>{{user.email}}</td> <td>{{user.login}}</td>
<td> <td>{{user.email}}</td>
<app-checkbox <td>
[value]="user.admin" @if(adminLogin !== user.login && user.adminState === undefined) {
*ngIf="adminLogin !== user.login && user.adminState === undefined" <app-checkbox
(changeValue)="onSetAdmin($event, user)"></app-checkbox> [value]="user.admin"
{{adminLogin === user.login?"yes":""}} (changeValue)="onSetAdmin($event, user)"/>
<app-async-status-component }
*ngIf="user.adminState !== undefined" {{adminLogin === user.login?"yes":""}}
[value]="user.adminState" @if(user.adminState !== undefined) {
></app-async-status-component> <app-async-status-component
</td> [value]="user.adminState" />
<td> }
<app-checkbox </td>
[value]="user.blocked" <td>
*ngIf="adminLogin !== user.login && user.blockedState === undefined" @if(adminLogin !== user.login && user.blockedState === undefined) {
(changeValue)="onSetBlocked($event, user)"></app-checkbox> <app-checkbox
<app-async-status-component [value]="user.blocked"
*ngIf="user.blockedState !== undefined" (changeValue)="onSetBlocked($event, user)"/>
[value]="user.blockedState" }
></app-async-status-component></td> @if(user.blockedState !== undefined) {
<td>{{user.avatar?"yes":"---"}}</td> <app-async-status-component [value]="user.blockedState"/>
<td>{{formatTimestamp(user.lastConnection)}}</td> }
</tr> </td>
<td>{{user.avatar?"yes":"---"}}</td>
<td>{{formatTimestamp(user.lastConnection)}}</td>
</tr>
}
</table> </table>
</body> </body>
</burger-property> </burger-property>

View File

@ -1,28 +1,32 @@
<div class="generic-page"> <div class="generic-page">
<div class="title">Global SSO Management</div> <div class="title">Global SSO Management</div>
<div class="fill-all"> <div class="fill-all">
<burger-property *ngFor="let data of menu"> @for (data of menu; track data;) {
<name>{{data.title}}</name> <burger-property>
<description>{{data.description}}</description> <name>{{data.title}}</name>
<body> <description>{{data.description}}</description>
<spiner *ngIf="data.values===undefined"></spiner> <body>
<app-render-settings @if(data.values===undefined) {
*ngIf="data.values!==undefined" <spiner/>
[values]="data.values" }
(deltaValues)="onDeltaValues($event, data)" @else {
(changeState)="onState($event, data)" <app-render-settings
></app-render-settings> [values]="data.values"
</body> (deltaValues)="onDeltaValues($event, data)"
<footer> (changeState)="onState($event, data)"/>
<button }
class="button login color-button-validate color-shadow-black" </body>
[disabled]="data.state !== 0" <footer>
(click)="onUpdate(data)" <button
type="submit"> class="button login color-button-validate color-shadow-black"
Update ... [disabled]="data.state !== 0"
</button> (click)="onUpdate(data)"
</footer> type="submit">
</burger-property> Update ...
</button>
</footer>
</burger-property>
}
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>

View File

@ -36,20 +36,22 @@
</div> </div>
<div class="container"> <div class="container">
<button class="button cancel color-button-cancel color-shadow-black" (click)="onCancel()">Cancel</button> <button class="button cancel color-button-cancel color-shadow-black" (click)="onCancel()">Cancel</button>
<button @if(ssoReady) {
class="button login color-button-validate color-shadow-black" <button
*ngIf="ssoReady" class="button login color-button-validate color-shadow-black"
id="login-button" id="login-button"
[disabled]="loginButtonDisabled" [disabled]="loginButtonDisabled"
(click)="onLogin()"> (click)="onLogin()">
Login Login
</button> </button>
<button }
class="button login color-button-validate color-shadow-black" @else {
*ngIf="!ssoReady" <button
[disabled]="true"> class="button login color-button-validate color-shadow-black"
Login (wait info) [disabled]="true">
</button> Login (wait info)
</button>
}
</div> </div>
<div class="container">{{error}}</div> <div class="container">{{error}}</div>
</div> </div>

View File

@ -1,84 +1,93 @@
<div class="full-mode" *ngIf="!signUpEnable"> @if(!signUpEnable) {
<div class="global-help"> <div class="full-mode">
<div class="sso"><label class="unselectable">Sign-up is disable !!! </label></div> <div class="global-help">
<div class="sso"><label class="unselectable">Sign-up is disable !!! </label></div>
</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="container">{{error}}</div>
<div class="global-help"> </div>
<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> }
<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>

View File

@ -30,6 +30,7 @@ export interface SpecificReturnResponse {
url: string; url: string;
} }
export interface GetApplicationSmallResponse { export interface GetApplicationSmallResponse {
id: number;
name: string; name: string;
description: string; description: string;
redirect: string; redirect: string;
@ -204,7 +205,7 @@ export class ApplicationService {
.then((response: ModelResponseHttp) => { .then((response: ModelResponseHttp) => {
// TODO: check type ... // TODO: check type ...
console.log( 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... // tODO: check the format...
resolve(response.data); resolve(response.data);

@ -1 +1 @@
Subproject commit c3489422f2df7f16465b4358e868664af9cda81c Subproject commit 147a955b195eb7c90e445d404f043d9a363087ca

View File

@ -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
*/

View File

@ -3,8 +3,16 @@
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/spec", "outDir": "../out-tsc/spec",
"baseUrl": "./", "baseUrl": "./",
"types": ["jest", "node"] "types": [
"jest",
"node"
]
}, },
"files": ["test.ts", "polyfills.ts"], "files": [
"include": ["**/*.spec.ts", "**/*.d.ts"] "test.ts"
} ],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}