-
Notifications
You must be signed in to change notification settings - Fork 38
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
1d63fad
commit 07049b5
Showing
4 changed files
with
120 additions
and
17 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
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(); | ||
}); | ||
}); |
30 changes: 30 additions & 0 deletions
30
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,30 @@ | ||
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: [], | ||
template: ` | ||
<div class="modal-header"> | ||
<h2 class="modal-title">Code modifications detected</h2> | ||
</div> | ||
<div class="modal-body"> | ||
<p>Do you want to use it or restart from scratch?</p> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-outline-danger me-5" (click)="activeModal.close(false)">Restart from scratch</button> | ||
<button type="button" class="btn btn-primary" ngbAutofocus (click)="activeModal.close(true)">Use saved code</button> | ||
</div> | ||
` | ||
}) | ||
export class SaveCodeDialogComponent { | ||
public readonly activeModal = inject(NgbActiveModal); | ||
} |