-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(workbench/message-box): open message box in a dialog
A message box is a standardized dialog for presenting a message to the user, such as an info, warning or alert, or for prompting the user for confirmation. The message can be plain text or a component, allowing for structured content or input prompts. closes #438 BREAKING CHANGE: Consolidation of the MessageBox API has introduced a breaking change. Refer to the documentation for migration examples: https://github.com/SchweizerischeBundesbahnen/scion-workbench/blob/master/docs/site/howto/how-to-open-message-box.md To migrate: - `MessageBoxService` is now `WorkbenchMessageBoxService`. - `MessageBoxConfig` is now `WorkbenchMessageBoxOptions`. - Signature of `WorkbenchMessageBoxService#open` method has changed. Pass the message (text or component) as the first argument, not via options object. - `injector` option has been moved to a top-level property (previously `MessageBoxConfig#componentConstructOptions`). - `viewContainerRef` option has been removed (no replacement). - `componentInput` option has been renamed to `inputs` with the type changed to a dictionary. Inputs are now available as input properties in the component, previously via `MessageBox#input` handle. - `MessageBox` handle has been removed. Configure the message box when opening the message box. - Registration of custom action handlers has been removed (no replacement). - Button with the action key 'close' is no longer bound to the escape keystroke.
- Loading branch information
1 parent
019a4d2
commit fe690d4
Showing
62 changed files
with
1,322 additions
and
2,752 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
22 changes: 10 additions & 12 deletions
22
...ng-app/src/app/inspect-message-box-provider/inspect-message-box-intent-handler.service.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
40 changes: 9 additions & 31 deletions
40
...bench-testing-app/src/app/inspect-message-box-provider/inspect-message-box.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 |
---|---|---|
@@ -1,37 +1,15 @@ | ||
<sci-form-field label="Instance ID" title="Unique identifier of this component instance"> | ||
<span class="e2e-component-instance-id">{{uuid}}</span> | ||
</sci-form-field> | ||
<section> | ||
<header>Inputs</header> | ||
|
||
<sci-form-field label="Input" direction="column" *ngIf="messageBox.input"> | ||
<section class="input"> | ||
<sci-viewport> | ||
<output class="e2e-input">{{messageBox.input | appStringify}}</output> | ||
</sci-viewport> | ||
</section> | ||
</sci-form-field> | ||
|
||
<ng-container [formGroup]="form"> | ||
<sci-form-field label="Title" direction="column"> | ||
<input [formControl]="form.controls.title" class="e2e-title"> | ||
</sci-form-field> | ||
|
||
<sci-form-field label="Severity" direction="column"> | ||
<select [formControl]="form.controls.severity" class="e2e-severity"> | ||
<option value="info">info</option> | ||
<option value="warn">warn</option> | ||
<option value="error">error</option> | ||
</select> | ||
</sci-form-field> | ||
|
||
<sci-form-field label="CSS Class(es)" direction="column"> | ||
<input [formControl]="form.controls.cssClass" class="e2e-class" placeholder="Separate multiple CSS classes by space"> | ||
<sci-form-field label="Input"> | ||
<output class="e2e-input">{{ input }}</output> | ||
</sci-form-field> | ||
|
||
<sci-form-field label="Actions" direction="column"> | ||
<sci-key-value-field [keyValueFormArray]="form.controls.actions" [addable]="true" [removable]="true" class="e2e-actions"></sci-key-value-field> | ||
<sci-form-field label="Param1"> | ||
<output class="e2e-param1">{{ param1 }}</output> | ||
</sci-form-field> | ||
|
||
<sci-form-field label="Return Value" direction="column"> | ||
<input [formControl]="form.controls.returnValue" class="e2e-return-value"> | ||
<sci-form-field label="Param2"> | ||
<output class="e2e-param2">{{ param2 }}</output> | ||
</sci-form-field> | ||
</ng-container> | ||
</section> |
18 changes: 10 additions & 8 deletions
18
...bench-testing-app/src/app/inspect-message-box-provider/inspect-message-box.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 |
---|---|---|
@@ -1,17 +1,19 @@ | ||
:host { | ||
display: grid; | ||
grid-row-gap: 1em; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1em; | ||
|
||
> sci-form-field section.input { | ||
> section { | ||
display: flex; | ||
flex-direction: column; | ||
gap: .5em; | ||
border: 1px solid var(--sci-color-border); | ||
border-radius: var(--sci-corner); | ||
padding: 1em; | ||
max-height: 200px; | ||
|
||
> sci-viewport { | ||
white-space: pre; | ||
font-family: monospace; | ||
font-size: smaller; | ||
> header { | ||
margin-bottom: 1em; | ||
font-weight: bold; | ||
} | ||
} | ||
} |
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.