Skip to content

Commit

Permalink
Fix delete theme and moved generate to shared (#59)
Browse files Browse the repository at this point in the history
* fix: delete theme

* fix: move generated to shared
  • Loading branch information
HenryT-CG authored Jan 31, 2024
1 parent 7af04be commit 3e7376d
Show file tree
Hide file tree
Showing 56 changed files with 35 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .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
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/*
7 changes: 1 addition & 6 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,7 @@
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": [],
"codeCoverageExclude": [
"**/*.module.ts",
"src/app/test/**",
"src/app/environments/**",
"src/app/generated/**"
]
"codeCoverageExclude": ["**/*.module.ts", "src/app/environments/**", "src/app/shared/generated/**"]
}
},
"lint": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"config": {
"openapiYaml": "src/assets/api/themes-bff-api.yaml",
"openapiOutput": "src/app/generated"
"openapiOutput": "src/app/shared/generated"
},
"scripts": {
"build": "ng build",
Expand Down
2 changes: 1 addition & 1 deletion sonar-local-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sonar.testExecutionReportPaths=reports/sonarqube_report.xml
sonar.sourceEncoding=UTF-8
#sonar.sources=src/app
#sonar.working.directory=dist/sonar
sonar.coverage.exclusions=*.ts,*.js,src/*.ts,src/**/*.module.ts,src/environments/*,src/assets/**/*,src/app/generated/**/*,src/app/test/*
sonar.coverage.exclusions=*.ts,*.js,src/*.ts,src/**/*.module.ts,src/environments/*,src/assets/**/*,src/app/shared/generated/**/*
#sonar.exclusions=src/app/generated/**/*
#sonar.cpd.exclusions=
#sonar.tests=src/app
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'
import { Location } from '@angular/common'
import { environment } from '../../../environments/environment'
import { environment } from 'src/environments/environment'

@Component({
selector: 'app-image-container',
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
PortalApiConfiguration
} from '@onecx/portal-integration-angular'

import { Configuration } from 'src/app/generated'
import { Configuration } from 'src/app/shared/generated'
import { LabelResolver } from './label.resolver'
import { environment } from 'src/environments/environment'
import { ImageContainerComponent } from './image-container/image-container.component'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ConfirmDialog, ConfirmDialogModule } from 'primeng/confirmdialog'

import { ConfigurationService, PortalMessageService, ThemeService } from '@onecx/portal-integration-angular'

import { ThemesAPIService } from 'src/app/generated'
import { ThemesAPIService } from 'src/app/shared/generated'
import { prepareUrl } from 'src/app/shared/utils'
import { themeVariables } from './theme-variables'
import { ThemeDesignerComponent } from './theme-designer.component'
Expand Down
8 changes: 7 additions & 1 deletion src/app/theme/theme-designer/theme-designer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import { ConfirmationService, SelectItem } from 'primeng/api'

import { Action, AppStateService, PortalMessageService, ThemeService } from '@onecx/portal-integration-angular'
import { dropDownSortItemsByLabel, dropDownGetLabelByValue, prepareUrl } from 'src/app/shared/utils'
import { GetThemeResponse, Theme, ThemesAPIService, ThemeUpdateCreate, UpdateThemeResponse } from 'src/app/generated'
import {
GetThemeResponse,
Theme,
ThemesAPIService,
ThemeUpdateCreate,
UpdateThemeResponse
} from 'src/app/shared/generated'
import { themeVariables } from './theme-variables'

@Component({
Expand Down
2 changes: 1 addition & 1 deletion src/app/theme/theme-detail/theme-detail.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import FileSaver from 'file-saver'
import { ConfigurationService, PortalMessageService } from '@onecx/portal-integration-angular'

import { prepareUrl } from 'src/app/shared/utils'
import { ThemesAPIService } from 'src/app/generated'
import { ThemesAPIService } from 'src/app/shared/generated'
import { ThemeDetailComponent } from './theme-detail.component'

describe('ThemeDetailComponent', () => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/theme/theme-detail/theme-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import FileSaver from 'file-saver'
import { Action, ObjectDetailItem, PortalMessageService, UserService } from '@onecx/portal-integration-angular'

import { limitText, prepareUrl, sortByLocale } from 'src/app/shared/utils'
import { ExportThemeRequest, Theme, ThemesAPIService, Workspace } from 'src/app/generated'
import { ExportThemeRequest, Theme, ThemesAPIService, Workspace } from 'src/app/shared/generated'

@Component({
templateUrl: './theme-detail.component.html',
Expand All @@ -18,7 +18,6 @@ export class ThemeDetailComponent implements OnInit {
theme: Theme | undefined
usedInWorkspace: Workspace[] | undefined
themeName!: string
themeId!: string
themeDeleteVisible = false
themeDeleteMessage = ''
themePortalList = ''
Expand Down Expand Up @@ -174,7 +173,7 @@ export class ThemeDetailComponent implements OnInit {
}

private deleteTheme(): void {
this.themeApi.deleteTheme({ id: this.themeId }).subscribe({
this.themeApi.deleteTheme({ id: this.theme?.id! }).subscribe({
next: () => {
this.router.navigate(['..'], { relativeTo: this.route })
this.msgService.success({ summaryKey: 'ACTIONS.DELETE.THEME_OK' })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,59 @@
pInputText
type="text"
readonly
id="portal_detail_item_creationDate"
id="theme_detail_item_creationDate"
class="w-full pt-3 pb-2"
[value]="theme?.creationDate | date : dateFormat"
[pTooltip]="'DETAIL.TOOLTIPS.CREATION_DATE' | translate"
tooltipPosition="top"
tooltipEvent="focus"
/>
<label for="portal_detail_item_creationDate">{{ 'DETAIL.CREATION_DATE' | translate }}</label>
<label for="theme_detail_item_creationDate">{{ 'DETAIL.CREATION_DATE' | translate }}</label>
</span>

<span class="p-float-label mb-1">
<input
pInputText
type="text"
readonly
id="portal_detail_item_creationUser"
id="theme_detail_item_creationUser"
class="w-full pt-3 pb-2"
[value]="theme?.creationUser"
[pTooltip]="'DETAIL.TOOLTIPS.CREATION_USER' | translate"
tooltipPosition="top"
tooltipEvent="focus"
/>
<label for="portal_detail_item_creationUser">{{ 'DETAIL.CREATION_USER' | translate }}</label>
<label for="theme_detail_item_creationUser">{{ 'DETAIL.CREATION_USER' | translate }}</label>
</span>

<span class="p-float-label mb-1">
<input
pInputText
type="text"
readonly
id="portal_detail_item_modificationDate"
id="theme_detail_item_modificationDate"
class="w-full pt-3 pb-2"
[value]="theme?.modificationDate | date : dateFormat"
[pTooltip]="'DETAIL.TOOLTIPS.MODIFICATION_DATE' | translate"
tooltipPosition="top"
tooltipEvent="focus"
/>
<label for="portal_detail_item_modificationDate">{{ 'DETAIL.MODIFICATION_DATE' | translate }}</label>
<label for="theme_detail_item_modificationDate">{{ 'DETAIL.MODIFICATION_DATE' | translate }}</label>
</span>

<span class="p-float-label mb-1">
<input
pInputText
type="text"
readonly
id="portal_detail_item_modificationUser"
id="theme_detail_item_modificationUser"
class="w-full pt-3 pb-2"
[value]="theme?.modificationUser"
[pTooltip]="'DETAIL.TOOLTIPS.MODIFICATION_USER' | translate"
tooltipPosition="top"
tooltipEvent="focus"
/>
<label for="portal_detail_item_modificationUser">{{ 'DETAIL.MODIFICATION_USER' | translate }}</label>
<label for="theme_detail_item_modificationUser">{{ 'DETAIL.MODIFICATION_USER' | translate }}</label>
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Input } from '@angular/core'
import { TranslateService } from '@ngx-translate/core'

import { Theme } from 'src/app/generated'
import { Theme } from 'src/app/shared/generated'

@Component({
selector: 'app-theme-intern',
Expand Down
2 changes: 1 addition & 1 deletion src/app/theme/theme-import/theme-import.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { of, throwError } from 'rxjs'

import { PortalMessageService } from '@onecx/portal-integration-angular'

import { ThemesAPIService } from 'src/app/generated'
import { ThemesAPIService } from 'src/app/shared/generated'
import { ThemeImportComponent } from './theme-import.component'

describe('ThemeImportComponent', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/theme/theme-import/theme-import.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ActivatedRoute, Router } from '@angular/router'

import { PortalMessageService } from '@onecx/portal-integration-angular'

import { Theme, ThemesAPIService, ThemeSnapshot } from 'src/app/generated'
import { Theme, ThemesAPIService, ThemeSnapshot } from 'src/app/shared/generated'

@Component({
selector: 'app-theme-import',
Expand Down
2 changes: 1 addition & 1 deletion src/app/theme/theme-search/theme-search.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TranslateTestingModule } from 'ngx-translate-testing'
import { DataViewModule } from 'primeng/dataview'
import { of } from 'rxjs'

import { ThemesAPIService } from 'src/app/generated'
import { ThemesAPIService } from 'src/app/shared/generated'
import { ThemeSearchComponent } from './theme-search.component'

describe('ThemeSearchComponent', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/theme/theme-search/theme-search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { DataView } from 'primeng/dataview'

import { Action, DataViewControlTranslations } from '@onecx/portal-integration-angular'

import { GetThemesResponse, ThemesAPIService } from 'src/app/generated'
import { GetThemesResponse, ThemesAPIService } from 'src/app/shared/generated'
import { limitText } from 'src/app/shared/utils'

@Component({
Expand Down
4 changes: 2 additions & 2 deletions src/app/theme/theme.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { ConfirmationService } from 'primeng/api'

import { addInitializeModuleGuard, InitializeModuleGuard, PortalCoreModule } from '@onecx/portal-integration-angular'

import { LabelResolver } from '../shared/label.resolver'
import { SharedModule } from '../shared/shared.module'
import { LabelResolver } from 'src/app/shared/label.resolver'
import { SharedModule } from 'src/app/shared/shared.module'

import { ThemeSearchComponent } from './theme-search/theme-search.component'
import { ThemeImportComponent } from './theme-import/theme-import.component'
Expand Down
9 changes: 1 addition & 8 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,5 @@
},
"files": ["src/main.ts", "src/polyfills.ts", "src/app/onecx-theme-remote.module.ts"],
"include": ["src/**/*.ts", "src/**/*.d.ts"],
"exclude": [
"src/test.ts",
"src/test-setup.ts",
"src/app/test/**/*",
"src/**/*.spec.ts",
"src/**/*.stories.ts",
"src/**/*.stories.js"
]
"exclude": ["src/test.ts", "src/test-setup.ts", "src/**/*.spec.ts", "src/**/*.stories.ts", "src/**/*.stories.js"]
}
2 changes: 1 addition & 1 deletion tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"useDefineForClassFields": false
},
"files": ["src/test.ts", "src/polyfills.ts"],
"exclude": ["src/app/generated/**/*", "node_modules"],
"exclude": ["src/app/shared/generated/**/*", "node_modules"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}

0 comments on commit 3e7376d

Please sign in to comment.