-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: Create a yaml tab for Trials (#2011)
* Create a dedicated yaml tab for Trials. Signed-off-by: Elena Zioga <elena@arrikto.com>
- Loading branch information
Showing
7 changed files
with
84 additions
and
5 deletions.
There are no files selected for viewing
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
6 changes: 6 additions & 0 deletions
6
...pp/pages/experiment-details/trials-table/trial-modal/trial-yaml/trial-yaml.component.html
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,6 @@ | ||
<lib-monaco-editor | ||
[(text)]="yaml" | ||
[language]="'yaml'" | ||
[readOnly]="true" | ||
[height]="500" | ||
></lib-monaco-editor> |
4 changes: 4 additions & 0 deletions
4
...pp/pages/experiment-details/trials-table/trial-modal/trial-yaml/trial-yaml.component.scss
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,4 @@ | ||
:host { | ||
display: block; | ||
overflow: auto; | ||
} |
30 changes: 30 additions & 0 deletions
30
...pages/experiment-details/trials-table/trial-modal/trial-yaml/trial-yaml.component.spec.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,30 @@ | ||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; | ||
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { EditorModule } from 'kubeflow'; | ||
import { TrialYamlComponent } from './trial-yaml.component'; | ||
|
||
describe('TrialYamlComponent', () => { | ||
let component: TrialYamlComponent; | ||
let fixture: ComponentFixture<TrialYamlComponent>; | ||
|
||
beforeEach( | ||
waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [CommonModule, NoopAnimationsModule, EditorModule], | ||
declarations: [TrialYamlComponent], | ||
}).compileComponents(); | ||
}), | ||
); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(TrialYamlComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
17 changes: 17 additions & 0 deletions
17
.../app/pages/experiment-details/trials-table/trial-modal/trial-yaml/trial-yaml.component.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,17 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { TrialK8s } from 'src/app/models/trial.k8s.model'; | ||
import { dump } from 'js-yaml'; | ||
|
||
@Component({ | ||
selector: 'app-trial-yaml', | ||
templateUrl: './trial-yaml.component.html', | ||
styleUrls: ['./trial-yaml.component.scss'], | ||
}) | ||
export class TrialYamlComponent { | ||
public yaml = ''; | ||
|
||
@Input() | ||
set trialJson(trial: TrialK8s) { | ||
this.yaml = dump(trial); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...src/app/pages/experiment-details/trials-table/trial-modal/trial-yaml/trial-yaml.module.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,12 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { TrialYamlComponent } from './trial-yaml.component'; | ||
import { EditorModule } from 'kubeflow'; | ||
|
||
@NgModule({ | ||
declarations: [TrialYamlComponent], | ||
imports: [CommonModule, EditorModule], | ||
exports: [TrialYamlComponent], | ||
}) | ||
export class TrialYamlModule {} |