Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • anis/anis-next
1 result
Show changes
......@@ -255,7 +255,12 @@ describe('[Instance][Search][Component][Result] DatatableComponent', () => {
order: PaginationOrder.a
};
const spy = jest.spyOn(component.retrieveData, 'emit');
component.changeNbItems(20);
const mockEvent: Event = <Event><any>{
currentTarget: {
value: 20
}
};
component.changeNbItems(mockEvent);
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith(expectedPagination);
});
......
......@@ -273,12 +273,14 @@ export class DatatableComponent implements OnInit, OnChanges {
/**
* Emits event to change datatable displayed items.
*
* @param {number} nb - The number of items to display.
* @param {Event} event - The event that contains number of items to display.
*
* @fires EventEmitter<Pagination>
*/
changeNbItems(nb: number): void {
this.nbItems = nb;
changeNbItems(event: Event): void {
const element = event.currentTarget as HTMLInputElement;
this.nbItems = +element.value;
this.changePage(1);
}
......
......@@ -28,9 +28,6 @@ import { hookParsers, dynamicComponents } from './dynamic-content';
dummiesComponents,
dynamicComponents
],
entryComponents: [
dynamicComponents
],
providers: [
hookParsers
]
......
......@@ -28,9 +28,6 @@ import { hookParsers, dynamicComponents } from './dynamic-content';
dummiesComponents,
dynamicComponents
],
entryComponents: [
dynamicComponents
],
providers: [
hookParsers
]
......
......@@ -39,9 +39,6 @@ import { hookParsers, dynamicComponents } from './dynamic-content';
sharedPipes,
dynamicComponents
],
entryComponents: [
dynamicComponents
],
providers: [
hookParsers
],
......
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
"module": "es2020",
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true,
"strictDomEventTypes": false
}
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": false,
"noImplicitOverride": false,
"noPropertyAccessFromIndexSignature": false,
"allowSyntheticDefaultImports": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2020",
"module": "es2020",
"lib": [
"es2020",
"dom"
]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
......@@ -3,12 +3,17 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"module": "CommonJs",
"types": [
"jest"
],
"esModuleInterop": true,
"emitDecoratorMetadata": true
]
},
"files": ["src/test.ts", "src/polyfills.ts"],
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
This diff is collapsed.
......@@ -2,14 +2,14 @@
set -e
# Get Keycloak Admin token
admin_token=$(curl --location --request POST 'http://keycloak:8180/auth/realms/master/protocol/openid-connect/token' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'username=admin' --data-urlencode 'password=admin' --data-urlencode 'grant_type=password' --data-urlencode 'client_id=admin-cli' | jq -r '.access_token')
admin_token=$(curl --location --request POST 'http://keycloak:8180/realms/master/protocol/openid-connect/token' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'username=admin' --data-urlencode 'password=admin' --data-urlencode 'grant_type=password' --data-urlencode 'client_id=admin-cli' | jq -r '.access_token')
# Create cesamsi user
curl --location --request POST 'http://keycloak:8180/auth/admin/realms/anis/users' --header 'Content-Type: application/json' --header "Authorization: Bearer $admin_token" --data-raw '{"firstName":"cesam-si","lastName":"cesam-si", "email":"cesamsi@lam.fr", "enabled":"true", "emailVerified":"true", "credentials":[{"type":"password","value":"admin","temporary":false}]}'
curl --location --request POST 'http://keycloak:8180/admin/realms/anis/users' --header 'Content-Type: application/json' --header "Authorization: Bearer $admin_token" --data-raw '{"firstName":"cesam-si","lastName":"cesam-si", "email":"cesamsi@lam.fr", "enabled":"true", "emailVerified":"true", "credentials":[{"type":"password","value":"admin","temporary":false}]}'
# Get anis_admin role and id_user
anis_admin_role=$(curl --location --request GET 'http://keycloak:8180/auth/admin/realms/anis/roles/anis_admin' --header 'Content-Type: application/json' --header "Authorization: Bearer $admin_token")
id_user=$(curl --location --request GET 'http://keycloak:8180/auth/admin/realms/anis/users' --header 'Content-Type: application/json' --header "Authorization: Bearer $admin_token" | jq -r '.[0]' | jq -r '.id')
anis_admin_role=$(curl --location --request GET 'http://keycloak:8180/admin/realms/anis/roles/anis_admin' --header 'Content-Type: application/json' --header "Authorization: Bearer $admin_token")
id_user=$(curl --location --request GET 'http://keycloak:8180/admin/realms/anis/users' --header 'Content-Type: application/json' --header "Authorization: Bearer $admin_token" | jq -r '.[0]' | jq -r '.id')
# Add anis_admin role to cesamsi user
curl --location --request POST "http://keycloak:8180/auth/admin/realms/anis/users/${id_user}/role-mappings/realm" --header 'Content-Type: application/json' --header "Authorization: Bearer $admin_token" --data-raw "[${anis_admin_role}]"
curl --location --request POST "http://keycloak:8180/admin/realms/anis/users/${id_user}/role-mappings/realm" --header 'Content-Type: application/json' --header "Authorization: Bearer $admin_token" --data-raw "[${anis_admin_role}]"
#!/bin/bash
set -e
kc.sh import --file /tmp/keycloak-anis-realm.json
\ No newline at end of file
......@@ -32,11 +32,11 @@ services:
LOGGER_LEVEL: "debug"
SERVICES_URL: "http://localhost:5000"
BASE_HREF: "/"
SSO_AUTH_URL: "http://localhost:8180/auth"
SSO_AUTH_URL: "http://localhost:8180"
SSO_REALM: "anis"
SSO_CLIENT_ID: "anis-client"
TOKEN_ENABLED: 0
TOKEN_JWKS_URL: "http://keycloak:8180/auth/realms/anis/protocol/openid-connect/certs"
TOKEN_JWKS_URL: "http://keycloak:8180/realms/anis/protocol/openid-connect/certs"
TOKEN_ADMIN_ROLES: anis_admin,superuser
RMQ_HOST: rmq
RMQ_PORT: 5672
......@@ -84,22 +84,23 @@ services:
- ./data:/data
command: /bin/bash -c "source /project/venv/bin/activate && exec python src/anis_tasks/app.py"
keycloak:
image: jboss/keycloak
image: bitnami/keycloak:18
environment:
DB_VENDOR: POSTGRES
DB_ADDR: db
DB_DATABASE: keycloakdb
DB_USER: keycloak
DB_PASSWORD: keycloak
DB_SCHEMA: public
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
KEYCLOAK_IMPORT: /tmp/keycloak-anis-realm.json
KEYCLOAK_DATABASE_HOST: db
KEYCLOAK_DATABASE_PORT: 5432
KEYCLOAK_DATABASE_NAME: keycloakdb
KEYCLOAK_DATABASE_USER: keycloak
KEYCLOAK_DATABASE_PASSWORD: keycloak
KEYCLOAK_DATABASE_SCHEMA: public
KEYCLOAK_ADMIN_USER: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KEYCLOAK_BIND_ADDRESS: 0.0.0.0
KEYCLOAK_HTTP_PORT: 8180
KEYCLOAK_EXTRA_ARGS: -Dkeycloak.import=/tmp/keycloak-anis-realm.json
ports:
- 8180:8180
volumes:
- ./conf-dev/keycloak-anis-realm.json:/tmp/keycloak-anis-realm.json
command: -b 0.0.0.0 -Djboss.http.port=8180
db:
image: postgres
environment:
......