forked from vmware-tanzu/tanzu-framework
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kickstart UI: Refactor step description changes to use events
- Loading branch information
1 parent
96d3537
commit 2b3c557
Showing
51 changed files
with
1,371 additions
and
840 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
pkg/v1/tkg/web/src/app/testing/data-service-registrar.testextension.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import DataServiceRegistrar from '../shared/service/data-service-registrar'; | ||
import { TkgEventType } from '../shared/service/Messenger'; | ||
import { Observable } from 'rxjs'; | ||
|
||
export class DataServiceRegistrarTestExtension extends DataServiceRegistrar { | ||
public hasEntry(eventType: TkgEventType): boolean { | ||
const eventEntry = this.getEntry(eventType); | ||
return eventEntry !== null && eventEntry !== undefined; | ||
} | ||
|
||
public simulateError(eventType: TkgEventType, errMsg: string) { | ||
if (!this.hasEntry(eventType)) { | ||
console.log('No event registration found for ' + eventType); | ||
} | ||
this.getEntry(eventType).errorStream.next(errMsg); | ||
} | ||
|
||
public simulateData(eventType: TkgEventType, data: any) { | ||
if (!this.hasEntry(eventType)) { | ||
console.log('No event registration found for ' + eventType); | ||
} | ||
this.getEntry(eventType).dataStream.next(data); | ||
} | ||
|
||
public simulateRegistration<OBJ>(eventType: TkgEventType) { | ||
this.register<OBJ>(eventType, () => new Observable<OBJ[]>()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.