Skip to content

Commit

Permalink
fix: use pia lib v4 and reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryT-CG committed Jan 30, 2024
1 parent 33a77a6 commit 83a37da
Show file tree
Hide file tree
Showing 57 changed files with 189 additions and 340 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dist/**",
"helm/**",
"node_modules/**",
"src/app/generated/**",
"src/app/shared/generated/**",
"src/app/api/*",
"src/app/model/*",
"src/**/*.ico",
Expand Down Expand Up @@ -39,15 +39,15 @@
"error",
{
"type": "attribute",
"prefix": "am",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"warn",
{
"type": "element",
"prefix": "am",
"prefix": "app",
"style": "kebab-case"
}
],
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ README.md
Dockerfile
*.log
*.sh
src/app/generated/**
src/app/shared/generated/**
src/app/api/*
src/app/model/*
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY dist/onecx-announcement-ui/ $DIR_HTML

# Application environments default values
ENV BFF_URL http://onecx-announcement-bff:8080/
ENV APP_BASE_HREF /announcement/
ENV APP_BASE_HREF /

RUN chmod 775 -R "$DIR_HTML"/assets
USER 1001
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "hm",
"prefix": "app",
"architect": {
"build": {
"builder": "ngx-build-plus:browser",
Expand Down
2 changes: 1 addition & 1 deletion nginx/locations.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
location @@APP_BASE_HREF {
location @@APP_BASE_HREFbff {
proxy_pass @@BFF_URL;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
Expand Down
46 changes: 23 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"config": {
"openapiYaml": "src/assets/api/announcement-bff-api.yaml",
"openapiOutput": "src/app/generated"
"openapiOutput": "src/app/shared/generated"
},
"scripts": {
"build": "ng build",
Expand Down Expand Up @@ -49,11 +49,11 @@
"@ngneat/falso": "^6.4.0",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@onecx/accelerator": "^3.7.1",
"@onecx/integration-interface": "^3.7.1",
"@onecx/keycloak-auth": "^3.7.1",
"@onecx/portal-integration-angular": "^3.7.1",
"@onecx/portal-layout-styles": "^3.7.1",
"@onecx/accelerator": "^4.1.2",
"@onecx/integration-interface": "^4.1.2",
"@onecx/keycloak-auth": "^4.1.2",
"@onecx/portal-integration-angular": "^4.1.2",
"@onecx/portal-layout-styles": "^4.1.2",
"file-saver": "^2.0.5",
"i18n-iso-countries": "^7.6.0",
"ngx-color": "^8.0.3",
Expand Down
4 changes: 2 additions & 2 deletions proxy.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const bypassFn = function (req, res) {
}

const PROXY_CONFIG = {
'/announcement-bff': {
'/bff': {
target: 'http://onecx-announcement-bff',
secure: false,
pathRewrite: {
'^.*/announcement-bff': ''
'^.*/bff': ''
},
changeOrigin: true,
logLevel: 'debug',
Expand Down
22 changes: 0 additions & 22 deletions src/app/announcement-mgmt-remote.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { TranslateService } from '@ngx-translate/core'
import { finalize, Observable, map, of } from 'rxjs'
import { SelectItem } from 'primeng/api'

import { Action, ConfigurationService, PortalMessageService } from '@onecx/portal-integration-angular'
import { PortalService } from '../../services/portalService'
import { Action, PortalMessageService, UserService } from '@onecx/portal-integration-angular'
import { PortalService } from 'src/app/shared/services/portalService'
import {
CreateAnnouncementRequest,
UpdateAnnouncementRequest,
Expand All @@ -15,7 +15,7 @@ import {
AnnouncementStatus,
AnnouncementType,
AnnouncementInternalAPIService
} from '../../generated'
} from 'src/app/shared/generated'

export function dateRangeValidator(fg: FormGroup): ValidatorFn {
return (): ValidationErrors | null => {
Expand All @@ -30,7 +30,7 @@ export function dateRangeValidator(fg: FormGroup): ValidatorFn {
}

@Component({
selector: 'am-announcement-detail',
selector: 'app-announcement-detail',
templateUrl: './announcement-detail.component.html',
styleUrls: ['./announcement-detail.component.scss']
})
Expand All @@ -57,16 +57,16 @@ export class AnnouncementDetailComponent implements OnInit, OnChanges {
originallyAssignedTo = 'Workspace'

constructor(
private user: UserService,
private portalApi: PortalService,
private announcementApi: AnnouncementInternalAPIService,
private fb: FormBuilder,
private router: Router,
private route: ActivatedRoute,
public config: ConfigurationService,
private translate: TranslateService,
private msgService: PortalMessageService
) {
this.dateFormat = this.config.lang === 'de' ? 'dd.MM.yyyy HH:mm' : 'short'
this.dateFormat = this.user.lang$.getValue() === 'de' ? 'dd.MM.yyyy HH:mm:ss' : 'medium'
this.prepareDropDownOptions()
this.formGroup = fb.nonNullable.group({
id: new FormControl(null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { TranslateService } from '@ngx-translate/core'
import { SelectItem } from 'primeng/api'
import { Observable, map, of } from 'rxjs'

import { Action, ConfigurationService } from '@onecx/portal-integration-angular'
import { Action, UserService } from '@onecx/portal-integration-angular'
import {
AnnouncementPriorityType,
AnnouncementStatus,
AnnouncementType,
GetAnnouncementsRequestParams
} from '../../../generated'
} from 'src/app/shared/generated'

export interface AnnouncementCriteriaForm {
title: FormControl<string | null>
Expand All @@ -22,7 +22,7 @@ export interface AnnouncementCriteriaForm {
}

@Component({
selector: 'am-announcement-criteria',
selector: 'app-announcement-criteria',
templateUrl: './announcement-criteria.component.html',
styleUrls: ['./announcement-criteria.component.scss']
})
Expand All @@ -39,8 +39,8 @@ export class AnnouncementCriteriaComponent implements OnInit {
public statusOptions$: Observable<SelectItem[]> = of([])
public priorityType$: Observable<SelectItem[]> = of([])

constructor(public config: ConfigurationService, public translate: TranslateService) {
this.dateFormatForRange = this.config.lang === 'de' ? 'dd.mm.yy' : 'm/d/yy'
constructor(private user: UserService, public translate: TranslateService) {
this.dateFormatForRange = this.user.lang$.getValue() === 'de' ? 'dd.mm.yy' : 'm/d/yy'
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<ocx-portal-page permission="ANNOUNCEMENT#SEARCH" helpArticleId="PAGE_ANNOUNCEMENT_SEARCH">
<am-announcement-criteria
<app-announcement-criteria
[actions]="actions"
[availablePortals]="availablePortals"
(criteriaEmitter)="search($event)"
></am-announcement-criteria>
></app-announcement-criteria>

<ocx-page-content styleClass="px-3">
<p-table
Expand Down Expand Up @@ -177,9 +177,9 @@
</ng-template>
</p-dialog>

<am-announcement-detail
<app-announcement-detail
[displayDetailDialog]="displayDetailDialog"
(hideDialogAndChanged)="onCloseDetail($event)"
[announcement]="announcement"
[changeMode]="changeMode"
></am-announcement-detail>
></app-announcement-detail>
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ import { finalize } from 'rxjs'
import { Table } from 'primeng/table'
import { SelectItem } from 'primeng/api'

import { Action, Column, PortalMessageService, UserService } from '@onecx/portal-integration-angular'
import {
Announcement,
AnnouncementInternalAPIService,
GetAnnouncementsRequestParams,
AnnouncementSearchCriteria
} from '../../generated'
import { Action, Column, ConfigurationService, PortalMessageService } from '@onecx/portal-integration-angular'
import { PortalService } from '../../services/portalService'
import { limitText } from '../../shared/utils'
} from 'src/app/shared/generated'
import { PortalService } from 'src/app/shared/services/portalService'
import { limitText } from 'src/app/shared/utils'

type ExtendedColumn = Column & { isDate?: boolean; isDropdown?: true; css?: string; limit?: boolean }
type ChangeMode = 'VIEW' | 'NEW' | 'EDIT'

@Component({
selector: 'am-announcement-search',
selector: 'app-announcement-search',
templateUrl: './announcement-search.component.html',
styleUrls: ['./announcement-search.component.scss']
})
Expand Down Expand Up @@ -101,15 +101,15 @@ export class AnnouncementSearchComponent implements OnInit {
]

constructor(
private user: UserService,
private router: Router,
private route: ActivatedRoute,
private portalApi: PortalService,
private announcementApi: AnnouncementInternalAPIService,
private config: ConfigurationService,
private msgService: PortalMessageService,
private translate: TranslateService
) {
this.dateFormat = this.config.lang === 'de' ? 'dd.MM.yyyy HH:mm' : 'short'
this.dateFormat = this.user.lang$.getValue() === 'de' ? 'dd.MM.yyyy HH:mm:ss' : 'medium'
}

ngOnInit(): void {
Expand Down
Loading

0 comments on commit 83a37da

Please sign in to comment.