Skip to content

Commit

Permalink
Merge pull request #224 from RADAR-base/release-4.2.0
Browse files Browse the repository at this point in the history
Release 4.2.0
  • Loading branch information
blootsvoets authored Dec 23, 2022
2 parents 5ea1744 + 0a89bb7 commit 2289296
Show file tree
Hide file tree
Showing 30 changed files with 2,425 additions and 2,357 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Use Node.js 16
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: yarn
cache-dependency-path: '**/yarn.lock'

Expand Down
8 changes: 4 additions & 4 deletions authorizer-app-backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM --platform=$BUILDPLATFORM gradle:7.5-jdk17 as builder
FROM --platform=$BUILDPLATFORM gradle:7.6-jdk17 as builder

RUN mkdir /code
WORKDIR /code

ENV GRADLE_USER_HOME=/code/.gradlecache \
GRADLE_OPTS=-Djdk.lang.Process.launchMechanism=vfork
GRADLE_OPTS="-Djdk.lang.Process.launchMechanism=vfork -Dorg.gradle.vfs.watch=false"

COPY ./build.gradle.kts ./settings.gradle.kts ./gradle.properties /code/
COPY authorizer-app-backend/build.gradle.kts /code/authorizer-app-backend/
RUN gradle downloadDependencies copyDependencies startScripts --no-watch-fs
RUN gradle downloadDependencies copyDependencies startScripts

COPY authorizer-app-backend/src /code/authorizer-app-backend/src

RUN gradle jar --no-watch-fs
RUN gradle jar

FROM eclipse-temurin:17-jre

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class RestSourceUserResource(
@QueryParam("project-id") projectId: String?,
@QueryParam("source-type") sourceType: String?,
@QueryParam("search") search: String?,
@DefaultValue("true") @QueryParam("authorized") isAuthorized: Boolean?,
@DefaultValue("true") @QueryParam("authorized") isAuthorized: String,
@DefaultValue(Integer.MAX_VALUE.toString()) @QueryParam("size") pageSize: Int,
@DefaultValue("1") @QueryParam("page") pageNumber: Int,
): RestSourceUsers {
Expand Down Expand Up @@ -94,14 +94,20 @@ class RestSourceUserResource(
}
} else emptyList()

val authorizedBoolean = when (isAuthorized) {
"true", "yes" -> true
"false", "no" -> false
else -> null
}

val queryPage = Page(pageNumber = pageNumber, pageSize = pageSize)
val (records, page) = userRepository.query(
queryPage,
projectIds,
sanitizedSourceType,
sanitizedSearch,
userIds,
isAuthorized,
authorizedBoolean,
)

return userMapper.fromRestSourceUsers(records, page)
Expand Down
17 changes: 0 additions & 17 deletions authorizer-app/.browserslistrc

This file was deleted.

1 change: 1 addition & 0 deletions authorizer-app/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
dist/
.angular/cache/
1 change: 0 additions & 1 deletion authorizer-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ testem.log
# System Files
.DS_Store
Thumbs.db

2 changes: 1 addition & 1 deletion authorizer-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM node:16-alpine as builder
FROM --platform=$BUILDPLATFORM node:18-alpine as builder

RUN mkdir /app
WORKDIR /app
Expand Down
5 changes: 2 additions & 3 deletions authorizer-app/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
Expand Down Expand Up @@ -88,6 +88,5 @@
}
}
}
},
"defaultProject": "authorizer-app"
}
}
44 changes: 22 additions & 22 deletions authorizer-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "authorizer-app",
"version": "4.1.4",
"version": "4.2.0",
"description": "Simple app to authorize to collect data from third party services ",
"repository": {
"type": "git",
Expand All @@ -18,34 +18,34 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^13.3.11",
"@angular/cdk": "^13.3.9",
"@angular/common": "^13.3.11",
"@angular/compiler": "^13.3.11",
"@angular/core": "^13.3.11",
"@angular/forms": "^13.3.11",
"@angular/material": "^13.3.9",
"@angular/material-moment-adapter": "^13.3.9",
"@angular/platform-browser": "^13.3.11",
"@angular/platform-browser-dynamic": "^13.3.11",
"@angular/router": "^13.3.11",
"@auth0/angular-jwt": "~5.1.0",
"@angular/animations": "^15.0.4",
"@angular/cdk": "^15.0.3",
"@angular/common": "^15.0.4",
"@angular/compiler": "^15.0.4",
"@angular/core": "^15.0.4",
"@angular/forms": "^15.0.4",
"@angular/material": "^15.0.3",
"@angular/material-moment-adapter": "^15.0.3",
"@angular/platform-browser": "^15.0.4",
"@angular/platform-browser-dynamic": "^15.0.4",
"@angular/router": "^15.0.4",
"@auth0/angular-jwt": "~5.1.1",
"@biesbjerg/ngx-translate-extract": "^7.0.4",
"@larscom/ngx-translate-module-loader": "^3.0.6",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"moment": "^2.29.1",
"rxjs": "^6.6.7",
"tslib": "^2.3.1",
"zone.js": "~0.11.4"
"rxjs": "^7.8.0",
"tslib": "^2.4.1",
"zone.js": "~0.12.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "13.3.9",
"@angular/cli": "~13.3.9",
"@angular/compiler-cli": "^13.3.11",
"@angular/language-service": "^13.3.11",
"@types/node": "~16.11.1",
"@angular-devkit/build-angular": "15.0.4",
"@angular/cli": "^15.0.4",
"@angular/compiler-cli": "^15.0.4",
"@angular/language-service": "^15.0.4",
"@types/node": "~18.11.17",
"gzipper": "^7.1.0",
"typescript": "~4.6.4"
"typescript": "~4.8.2"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Injectable, OnDestroy} from "@angular/core";
import {MatPaginatorIntl} from "@angular/material/paginator";
import {Subject} from "rxjs";
import {TranslateService} from "@ngx-translate/core";
import {takeUntil} from "rxjs/operators";
import { MatPaginatorIntl } from "@angular/material/paginator";

@Injectable()
export class CustomMatPaginatorIntl extends MatPaginatorIntl implements OnDestroy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ng-container *ngTemplateOutlet="filtersContainer"></ng-container>
</div>
<button mat-mini-fab class="mini-fab-filters" color="primary" (click)="openTemplateSheetMenu()"><mat-icon>filter_list</mat-icon></button>
<ng-template let-bottomSheetRef="bottomSheetRef" #templateBottomSheet>
<ng-template #templateBottomSheet>
<div class="mobile-filter-container">
<ng-container *ngTemplateOutlet="filtersContainer"></ng-container>
</div>
Expand Down Expand Up @@ -122,11 +122,11 @@
</div>

<ng-template #filtersContainer>
<div>
<div class="filter-fields">
<mat-form-field *ngFor="let filter of filters"
class="form-field"
[style]="'width: '+ filter.width +'px; max-width: 100%;'"
appearance="outline">
appearance="outline" subscriptSizing="dynamic">
<mat-label>{{filter.name | translate}}</mat-label>
<mat-select *ngIf="filter.type == 'select'"
name="{{filter.columnProp}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ tr:nth-of-type(even) {
background: #f7f7f7;
}

.form-field {
margin-right: 16px;
.filter-fields {
display: flex;
flex-wrap: wrap;
gap: 12px;
}

mat-form-field, mat-label, mat-select, mat-option {
font-size: 14px;
}

.w-180 {
Expand Down Expand Up @@ -52,39 +58,25 @@ tr:nth-of-type(even) {
background-color: rgba(darkred, 0.3);
}

.reset-filters {
margin-left: 16px;
}

.filter-container{
.filter-container {
border-radius: 5px;
background-color: #f7f7f7;
padding: 8px;
gap: 8px;
display: flex;
justify-content: space-between;
align-items: center;
::ng-deep .mat-form-field-appearance-outline .mat-form-field-wrapper {
margin: 0;
}
::ng-deep .mat-form-field-wrapper {
padding-bottom: 0;
}
}

.mobile-filter-container{
::ng-deep .mat-form-field-appearance-outline .mat-form-field-wrapper {
margin: .25em 0;
}
::ng-deep .mat-form-field-wrapper {
padding-bottom: 0 ;
}
th.mat-mdc-header-cell:last-of-type, td.mat-mdc-cell:last-of-type, td.mat-mdc-footer-cell:last-of-type {
padding-right: 0;
}

th.mat-header-cell:last-of-type, td.mat-cell:last-of-type, td.mat-footer-cell:last-of-type {
padding-right: 0;
tr.mat-mdc-no-data-row {
height: 52px;
}

th.mat-header-cell:first-of-type, td.mat-cell:first-of-type, td.mat-footer-cell:first-of-type {
th.mat-mdc-header-cell:first-of-type, td.mat-mdc-cell:first-of-type, td.mat-mdc-footer-cell:first-of-type {
padding-left: 0;
}

Expand All @@ -96,6 +88,14 @@ th.mat-header-cell:first-of-type, td.mat-cell:first-of-type, td.mat-footer-cell:
z-index: 999;
}

.mobile-filter-container {
display: flex;
gap: 12px;
margin-right: 16px;
flex-wrap: nowrap;
flex-direction: column;
}

@media only screen and (max-width: 1200px){
/* [320px -> 1200px]*/
table {
Expand All @@ -122,7 +122,7 @@ th.mat-header-cell:first-of-type, td.mat-cell:first-of-type, td.mat-footer-cell:

@media only screen and (max-width: 700px){
/* [320px -> 700px] */
.filter-container{
.filter-container {
display: none;
}

Expand All @@ -133,11 +133,12 @@ th.mat-header-cell:first-of-type, td.mat-cell:first-of-type, td.mat-footer-cell:
.reset-filters {
margin-left: 0;
margin-top: 16px;
width: 100%;
}

.mobile-filter-container{
mat-form-field{width: 100% !important;}
.mobile-filter-container {
mat-form-field {
width: 100% !important;
}
}

.m-w-140{
Expand All @@ -154,8 +155,3 @@ th.mat-header-cell:first-of-type, td.mat-cell:first-of-type, td.mat-footer-cell:
display: none;
}
}

@media only screen and (max-width: 425px){
/* [320px -> 425px] */
}

Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class UsersListComponent implements AfterViewInit {
{value: 'no', label: 'ADMIN.USERS_LIST.authorizationStatus.no'},
{value: 'unset', label: 'ADMIN.USERS_LIST.authorizationStatus.unset'}
],
width: 150,
width: 180,
}
]

Expand Down Expand Up @@ -125,24 +125,24 @@ export class UsersListComponent implements AfterViewInit {
private applyTableSort(): void {
this.dataSource.sort = this.sort;
this.dataSource.sortingDataAccessor = (item: UserData, property: string) => {
if (property === 'isAuthorized') {
if (item[property]) {
return 1; //'Yes';
} else if (!item.id) {
return 4; //'Unset';
} else if (item.registrationCreatedAt) {
return 2; //'Pending';
} else {
return 3; //'No';
}
}
if (property === 'startDate' || property === 'endDate') {
return item[property] ? new Date(item[property]) : null;
}
if (property === 'registrationCreatedAt') {
return item.registrationCreatedAt ? new Date(item.registrationCreatedAt) : null;
switch (property) {
case 'isAuthorized':
if (item.isAuthorized) {
return 1; //'Yes';
} else if (!item.id) {
return 4; //'Unset';
} else if (item.registrationCreatedAt) {
return 2; //'Pending';
} else {
return 3; //'No';
}
case 'startDate': case 'endDate':
return item[property] ? new Date(item[property]) : null;
case 'registrationCreatedAt':
return item.registrationCreatedAt ? new Date(item.registrationCreatedAt) : null;
default:
return item[property].toLocaleLowerCase();
}
return item[property].toLocaleLowerCase();
};
}

Expand All @@ -162,8 +162,8 @@ export class UsersListComponent implements AfterViewInit {
.every(([key, value]) => {
switch (key) {
case 'userId':
const matchesUserId = data.userId && data.userId.toLowerCase().indexOf(value) !== -1
const matchesExternalId = !data.externalId || data.externalId.toLowerCase().indexOf(value) !== -1;
const matchesUserId = data.userId && data.userId.toLocaleLowerCase().indexOf(value) !== -1
const matchesExternalId = !data.externalId || data.externalId.toLocaleLowerCase().indexOf(value) !== -1;
return matchesUserId || matchesExternalId;
case 'isAuthorized':
if (data.isAuthorized) {
Expand Down Expand Up @@ -318,5 +318,4 @@ export class UsersListComponent implements AfterViewInit {
openTemplateSheetMenu() {
this.bottomSheet.open(this.TemplateBottomSheet);
}

}
Loading

0 comments on commit 2289296

Please sign in to comment.