Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
81fa9ad31c | |||
3f871e406a | |||
5340a71776 | |||
d3dc53c56d | |||
2cec643728 | |||
f97458bbdd | |||
13f3255c8d | |||
e1673cac97 | |||
7388e167a7 | |||
496b377b57 | |||
2f07af219c | |||
4daf4a6d48 |
16
.island/release.bash
Executable file
16
.island/release.bash
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
version_file="version.txt"
|
||||||
|
|
||||||
|
new_version=$(cat $version_file)
|
||||||
|
sed -i "s|\"version\":.*\".*\"|\"version\":\"$new_version\"|" package.json
|
||||||
|
|
||||||
|
if grep -q "dev" "$version_file"; then
|
||||||
|
# update all dependency
|
||||||
|
pnpm install
|
||||||
|
pnpm run update_packages
|
||||||
|
else
|
||||||
|
# in case of release ==> can not do it automatically ...
|
||||||
|
echo not implemented
|
||||||
|
fi
|
||||||
|
|
24
package.json
24
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kangaroo-and-rabbit/kar-cw",
|
"name": "@kangaroo-and-rabbit/kar-cw",
|
||||||
"version": "0.2.2",
|
"version": "0.4.1",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "ng build kar-cw --watch --configuration development",
|
"dev": "ng build kar-cw --watch --configuration development",
|
||||||
@ -13,13 +13,13 @@
|
|||||||
"install_dependency": "pnpm install --force"
|
"install_dependency": "pnpm install --force"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/common": "^17.3.6",
|
"@angular/common": "^18.0.0",
|
||||||
"@angular/compiler": "^17.3.6",
|
"@angular/compiler": "^18.0.0",
|
||||||
"@angular/core": "^17.3.6",
|
"@angular/core": "^18.0.0",
|
||||||
"@angular/forms": "^17.3.6",
|
"@angular/forms": "^18.0.0",
|
||||||
"@angular/platform-browser": "^17.3.6",
|
"@angular/platform-browser": "^18.0.0",
|
||||||
"@angular/platform-browser-dynamic": "^17.3.6",
|
"@angular/platform-browser-dynamic": "^18.0.0",
|
||||||
"@angular/router": "^17.3.6",
|
"@angular/router": "^18.0.0",
|
||||||
"rxjs": "~7.8.1",
|
"rxjs": "~7.8.1",
|
||||||
"zone.js": "~0.14.5"
|
"zone.js": "~0.14.5"
|
||||||
},
|
},
|
||||||
@ -27,9 +27,9 @@
|
|||||||
"tslib": "^2.6.2"
|
"tslib": "^2.6.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "^17.3.6",
|
"@angular-devkit/build-angular": "^18.0.1",
|
||||||
"@angular/cli": "^17.3.6",
|
"@angular/cli": "^18.0.1",
|
||||||
"@angular/compiler-cli": "^17.3.6",
|
"@angular/compiler-cli": "^18.0.0",
|
||||||
"@types/jasmine": "~5.1.4",
|
"@types/jasmine": "~5.1.4",
|
||||||
"jasmine-core": "~5.1.2",
|
"jasmine-core": "~5.1.2",
|
||||||
"karma": "~6.4.3",
|
"karma": "~6.4.3",
|
||||||
@ -37,7 +37,7 @@
|
|||||||
"karma-coverage": "~2.2.1",
|
"karma-coverage": "~2.2.1",
|
||||||
"karma-jasmine": "~5.1.0",
|
"karma-jasmine": "~5.1.0",
|
||||||
"karma-jasmine-html-reporter": "~2.1.0",
|
"karma-jasmine-html-reporter": "~2.1.0",
|
||||||
"ng-packagr": "^17.3.0",
|
"ng-packagr": "^18.0.0",
|
||||||
"typescript": "~5.4.5",
|
"typescript": "~5.4.5",
|
||||||
"npm-check-updates": "^16.14.20"
|
"npm-check-updates": "^16.14.20"
|
||||||
},
|
},
|
||||||
|
2838
pnpm-lock.yaml
generated
2838
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
79
src/model/settings-item.ts
Normal file
79
src/model/settings-item.ts
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
import { CheckerParameter } from "../component/entry-validator/entry-validator";
|
||||||
|
import { isInArray, isNullOrUndefined, isObject, isString, isOptionalOf, isBoolean, isNumber, isUndefined } from "../utils";
|
||||||
|
|
||||||
|
|
||||||
|
export enum SettingType {
|
||||||
|
VALUE = 'VALUE',
|
||||||
|
LINE = 'LINE',
|
||||||
|
BOOLEAN = 'BOOLEAN',
|
||||||
|
NUMBER = 'NUMBER',
|
||||||
|
STRING = 'STRING',
|
||||||
|
PASSWORD = 'PASSWORD',
|
||||||
|
}
|
||||||
|
export function isSettingType(data: any): data is SettingType {
|
||||||
|
return isInArray(data, ['VALUE', 'LINE', 'NUMBER', 'BOOLEAN', 'STRING', 'PASSWORD']);
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SettingsItem {
|
||||||
|
// Type of the menu Node
|
||||||
|
type: SettingType;
|
||||||
|
// Unique key reference
|
||||||
|
key?: string;
|
||||||
|
// Displayed Title
|
||||||
|
title?: string;
|
||||||
|
// Description of the parameter
|
||||||
|
description?: string;
|
||||||
|
// placeholder of the parameter
|
||||||
|
placeholder?: string;
|
||||||
|
// Parameter key to SET/GET or the sub-menu
|
||||||
|
value?: boolean | string | Number;
|
||||||
|
// when data is change the value is set here undefined if not correct (must be set @ undefined):
|
||||||
|
newValue?: boolean | string | Number;
|
||||||
|
// checker to validate the data:
|
||||||
|
checker?: CheckerParameter
|
||||||
|
// result of the checker (must be set @ undefined):
|
||||||
|
state?: boolean | string;
|
||||||
|
// The element is require to have a valid form.
|
||||||
|
require?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isSettingsItem(data: any): data is SettingsItem {
|
||||||
|
if (isNullOrUndefined(data)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!isObject(data)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!isSettingType(data.type)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!isString(data.key)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!isOptionalOf(data.title, isString)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!isOptionalOf(data.description, isString)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!isOptionalOf(data.placeholder, isString)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
!isOptionalOf(data.value, isBoolean) &&
|
||||||
|
!isOptionalOf(data.value, isString) &&
|
||||||
|
!isOptionalOf(data.value, isNumber)
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!isUndefined(data.newValue)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!isOptionalOf(data.state, isString)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!isOptionalOf(data.require, isBoolean)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
@ -47,7 +47,7 @@ export class SSOService {
|
|||||||
) {
|
) {
|
||||||
return this.utf8_to_b64(data);
|
return this.utf8_to_b64(data);
|
||||||
}
|
}
|
||||||
const pathName = getApplicationLocation();
|
const pathName = getApplicationLocation(this.environment);
|
||||||
if (isInArray(pathName, ['sso', '/sso', '/sso/'])) {
|
if (isInArray(pathName, ['sso', '/sso', '/sso/'])) {
|
||||||
return this.utf8_to_b64('home');
|
return this.utf8_to_b64('home');
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import { SSOService } from './sso';
|
|||||||
import { getApplicationLocation, isNullOrUndefined, sha512 } from '../utils';
|
import { getApplicationLocation, isNullOrUndefined, sha512 } from '../utils';
|
||||||
import { HttpWrapperService, HTTPRequestModel, HTTPMimeType, ModelResponseHttp } from './http-wrapper_kjdhqslkjf';
|
import { HttpWrapperService, HTTPRequestModel, HTTPMimeType, ModelResponseHttp } from './http-wrapper_kjdhqslkjf';
|
||||||
import { Environment } from '../model/environment';
|
import { Environment } from '../model/environment';
|
||||||
|
import { APP_BASE_HREF } from '@angular/common';
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -76,7 +77,7 @@ export class UserService {
|
|||||||
* Check if the system can be connected
|
* Check if the system can be connected
|
||||||
*/
|
*/
|
||||||
checkAutoConnect(): Promise<void> {
|
checkAutoConnect(): Promise<void> {
|
||||||
let locationOrigin = getApplicationLocation();
|
let locationOrigin = getApplicationLocation(this.environment);
|
||||||
const self = this;
|
const self = this;
|
||||||
return new Promise<void>((resolve, reject) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
// Need to use the windows global route to prevent the log in cycle ...
|
// Need to use the windows global route to prevent the log in cycle ...
|
||||||
@ -91,7 +92,7 @@ export class UserService {
|
|||||||
}
|
}
|
||||||
console.log(' ==> Check if need reconnect?');
|
console.log(' ==> Check if need reconnect?');
|
||||||
let rememberMe = self.getRememberMe();
|
let rememberMe = self.getRememberMe();
|
||||||
// TODO: in case of jest reload ==> no need to manage the SSO ==> just keep the token ... it in enought...
|
// TODO: in case of jest reload ==> no need to manage the SSO ==> just keep the token ... it in enough...
|
||||||
let token: undefined | string = undefined;
|
let token: undefined | string = undefined;
|
||||||
if (
|
if (
|
||||||
isNullOrUndefined(this.environment.tokenStoredInPermanentStorage) ||
|
isNullOrUndefined(this.environment.tokenStoredInPermanentStorage) ||
|
||||||
@ -109,7 +110,7 @@ export class UserService {
|
|||||||
self.startSession(token ?? '', rememberMe)
|
self.startSession(token ?? '', rememberMe)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
self.router.navigateByUrl(locationOrigin);
|
self.router.navigateByUrl(locationOrigin);
|
||||||
console.log(`update global URL = ${locationOrigin}`);
|
console.log(`update global URL = ${locationOrigin} APP_BASE_HREF=${APP_BASE_HREF}`);
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
//import { environment } from 'environments/environment';
|
//import { environment } from 'environments/environment';
|
||||||
|
|
||||||
export function getApplicationLocation(): string {
|
import { Environment } from "../model";
|
||||||
|
|
||||||
|
export function getApplicationLocation(environment: Environment): string {
|
||||||
let pathName = location.pathname;
|
let pathName = location.pathname;
|
||||||
return pathName;
|
|
||||||
//console.log("start Path-name: '" + pathName + "'");
|
//console.log("start Path-name: '" + pathName + "'");
|
||||||
//console.log("check with: '" + environment.applName + "/sso/" + "'");
|
//console.log("check with: '" + environment.applName + "/sso/" + "'");
|
||||||
/*
|
|
||||||
|
|
||||||
if (pathName.startsWith('/' + environment.applName + '/')) {
|
if (pathName.startsWith('/' + environment.applName + '/')) {
|
||||||
pathName = pathName.substring(environment.applName.length + 2);
|
pathName = pathName.substring(environment.applName.length + 2);
|
||||||
} else if (pathName.startsWith('/' + environment.applName)) {
|
} else if (pathName.startsWith('/' + environment.applName)) {
|
||||||
@ -17,5 +16,4 @@ export function getApplicationLocation(): string {
|
|||||||
pathName = pathName.substring(environment.applName.length);
|
pathName = pathName.substring(environment.applName.length);
|
||||||
}
|
}
|
||||||
return pathName;
|
return pathName;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
1
version.txt
Normal file
1
version.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
0.4.1
|
Loading…
x
Reference in New Issue
Block a user