Skip to content

Commit

Permalink
fix: show help structure (#59)
Browse files Browse the repository at this point in the history
* refactor: refactor remote components structure

* fix: comment out harnesses until tests are ready

* fix: removed logs
  • Loading branch information
markuczy authored Apr 10, 2024
1 parent 5e408e0 commit fcffac9
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 137 deletions.
53 changes: 0 additions & 53 deletions src/app/remotes/harnesses/a.harness.ts

This file was deleted.

41 changes: 0 additions & 41 deletions src/app/remotes/harnesses/i.harness.ts

This file was deleted.

27 changes: 0 additions & 27 deletions src/app/remotes/harnesses/show-help.harness.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/app/remotes/service/helpsRemote.service.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ import {
import { UserService, AppStateService } from '@onecx/angular-integration-interface'
import { createRemoteComponentTranslateLoader } from '@onecx/angular-accelerator'
import { PortalMessageService, PortalCoreModule } from '@onecx/portal-integration-angular'
import { NoHelpItemComponent } from '../no-help-item/no-help-item.component'
import { Configuration, Help } from 'src/app/shared/generated'
import { HelpsRemoteAPIService } from '../../service/helpsRemote.service'
import { NoHelpItemComponent } from './no-help-item/no-help-item.component'
import { Configuration, Help, HelpsInternalAPIService } from 'src/app/shared/generated'
import { environment } from 'src/environments/environment'
import { SharedModule } from 'src/app/shared/shared.module'
import { Router } from '@angular/router'
Expand All @@ -39,11 +38,10 @@ import { Router } from '@angular/router'
TranslateModule,
SharedModule,
PortalCoreModule,
AngularRemoteComponentsModule,
SharedModule
AngularRemoteComponentsModule
],
providers: [
HelpsRemoteAPIService,
HelpsInternalAPIService,
DialogService,
{
provide: BASE_URL,
Expand Down Expand Up @@ -74,7 +72,7 @@ export class OneCXShowHelpComponent implements ocxRemoteComponent {
private appStateService: AppStateService,
private userService: UserService,
private router: Router,
private helpDataService: HelpsRemoteAPIService,
private helpDataService: HelpsInternalAPIService,
private dialogService: DialogService,
private portalMessageService: PortalMessageService,
private translateService: TranslateService
Expand Down
25 changes: 25 additions & 0 deletions src/app/remotes/show-help/show-help.harness.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// import { ComponentHarness } from '@angular/cdk/testing'

// export class OneCXShowHelpHarness extends ComponentHarness {
// static hostSelector = 'app-ocx-show-help'

// getHelpButton = this.locatorForOptional('#show-help-button')
// getHelpIcon = this.locatorForOptional('#show-help-button-icon')

// async getHelpButtonTitle(): Promise<string | null | undefined> {
// return await (await this.getHelpButton())?.getAttribute('ng-reflect-text')
// // return (await (await this.getHelpButton())?.host())?.getAttribute('title')
// }

// async clickHelpButton() {
// await (await this.getHelpButton())?.click()
// }

// async hasHelpButtonClass(c: string): Promise<boolean | undefined> {
// return (await (await this.getHelpButton())?.getAttribute('class'))?.includes(c)
// }

// async hasHelpIconClass(c: string): Promise<boolean | undefined> {
// return (await (await this.getHelpIcon())?.getAttribute('class'))?.includes(c)
// }
// }
2 changes: 1 addition & 1 deletion tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"src/main.ts",
"src/polyfills.ts",
"src/app/onecx-help-remote.module.ts",
"src/app/remotes/components/show-help/show-help.component.ts"
"src/app/remotes/show-help/show-help.component.ts"
],
"include": ["src/**/*.ts", "src/**/*.d.ts"],
"exclude": ["src/test.ts", "src/test-setup.ts", "src/**/*.spec.ts", "src/**/*.stories.ts", "src/**/*.stories.js"]
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config = withModuleFederationPlugin({
filename: 'remoteEntry.js',
exposes: {
'./OneCXHelpModule': 'src/app/onecx-help-remote.module.ts',
'./OneCXShowHelpComponent': 'src/app/remotes/components/show-help/show-help.component.ts'
'./OneCXShowHelpComponent': 'src/app/remotes/show-help/show-help.component.ts'
},
shared: share({
'@angular/core': { singleton: true, requiredVersion: 'auto' },
Expand Down

0 comments on commit fcffac9

Please sign in to comment.