forked from AmadeusITGroup/otter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(training): persistence of code modifications
- Loading branch information
1 parent
2e1374e
commit e5f498a
Showing
8 changed files
with
160 additions
and
42 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
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
1 change: 1 addition & 0 deletions
1
apps/showcase/src/components/training/save-code-dialog/index.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 @@ | ||
export * from './save-code-dialog.component'; |
26 changes: 26 additions & 0 deletions
26
apps/showcase/src/components/training/save-code-dialog/save-code-dialog.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,26 @@ | ||
import { | ||
ComponentFixture, | ||
TestBed, | ||
} from '@angular/core/testing'; | ||
import { | ||
SaveCodeDialogComponent, | ||
} from './save-code-dialog.component'; | ||
|
||
describe('ViewComponent', () => { | ||
let component: SaveCodeDialogComponent; | ||
let fixture: ComponentFixture<SaveCodeDialogComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [SaveCodeDialogComponent] | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(SaveCodeDialogComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
apps/showcase/src/components/training/save-code-dialog/save-code-dialog.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,19 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
inject, | ||
} from '@angular/core'; | ||
import { | ||
NgbActiveModal, | ||
} from '@ng-bootstrap/ng-bootstrap'; | ||
|
||
@Component({ | ||
selector: 'code-editor-terminal', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [], | ||
templateUrl: './save-code-dialog.template.html' | ||
}) | ||
export class SaveCodeDialogComponent { | ||
public readonly activeModal = inject(NgbActiveModal); | ||
Check failure on line 18 in apps/showcase/src/components/training/save-code-dialog/save-code-dialog.component.ts GitHub Actions / UT Tests report-ubuntu-latestViewComponent ► apps/showcase/src/components/training/save-code-dialog/save-code-dialog.component.spec.ts ► ViewComponent should create
Raw output
|
||
} |
10 changes: 10 additions & 0 deletions
10
apps/showcase/src/components/training/save-code-dialog/save-code-dialog.template.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,10 @@ | ||
<div class="modal-header"> | ||
<h2 class="modal-title">Code modifications detected</h2> | ||
</div> | ||
<div class="modal-body"> | ||
<p>Do you want to resume your training or discard your changes?</p> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-outline-danger me-5" (click)="activeModal.close(false)">Discard</button> | ||
<button type="button" class="btn btn-primary" ngbAutofocus (click)="activeModal.close(true)">Resume</button> | ||
</div> |
4 changes: 2 additions & 2 deletions
4
apps/showcase/src/components/training/training-step/training-step-pres.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