Skip to content

Commit f3c438e

Browse files
Updated headerText to headerLabel.
Renamed `elRef` to `elementRef`.
1 parent bf40260 commit f3c438e

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/modal/alert-modal.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import { ModalService } from "./modal.service";
4141
* openModal() {
4242
* this.modalService.show({
4343
* modalType: "default" | "danger",
44-
* headerText: "optional header text",
44+
* headerLabel: "optional header text",
4545
* title: "Modal title",
4646
* text: "Modal text",
4747
* buttons: [{
@@ -63,7 +63,7 @@ import { ModalService } from "./modal.service";
6363
template: `
6464
<ibm-modal [modalType]="modalType">
6565
<ibm-modal-header (closeSelect)="closeModal()">
66-
<p class="bx--modal-header__label bx--type-delta">{{headerText}}</p>
66+
<p class="bx--modal-header__label bx--type-delta">{{headerLabel}}</p>
6767
<p class="bx--modal-header__heading bx--type-beta">{{title}}</p>
6868
</ibm-modal-header>
6969
<div class="bx--modal-content">
@@ -79,7 +79,7 @@ import { ModalService } from "./modal.service";
7979
export class AlertModalComponent implements AfterViewInit {
8080

8181
modalType = "default";
82-
headerText: string;
82+
headerLabel: string;
8383
title: string;
8484
text: string;
8585
buttons = [];
@@ -91,10 +91,10 @@ export class AlertModalComponent implements AfterViewInit {
9191
*/
9292
constructor(
9393
private injector: Injector,
94-
private elRef: ElementRef,
94+
private elementRef: ElementRef,
9595
) {
9696
this.modalType = this.injector.get("modalType");
97-
this.headerText = this.injector.get("headerText");
97+
this.headerLabel = this.injector.get("headerLabel");
9898
this.title = this.injector.get("title");
9999
this.text = this.injector.get("text");
100100

@@ -116,7 +116,7 @@ export class AlertModalComponent implements AfterViewInit {
116116
const primaryButtonIndex = this.buttons.findIndex(
117117
button => button.type.indexOf("primary") !== -1) || 0;
118118
const primaryButton = this.buttons[primaryButtonIndex];
119-
const buttonNode = this.elRef.nativeElement.querySelector(`#${primaryButton.id}`);
119+
const buttonNode = this.elementRef.nativeElement.querySelector(`#${primaryButton.id}`);
120120
if (buttonNode) {
121121
buttonNode.focus();
122122
}

src/modal/modal.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ export class ModalService {
8282
* @returns {ComponentRef<any>}
8383
* @memberof ModalService
8484
*/
85-
show(data: {modalType?: string, headerText?: string, title: string, text: string, buttons?: null}) {
85+
show(data: {modalType?: string, headerLabel?: string, title: string, text: string, buttons?: null}) {
8686
return this.create({
8787
component: AlertModalComponent,
8888
inputs: {
8989
modalType: data.modalType,
90-
headerText: data.headerText,
90+
headerLabel: data.headerLabel,
9191
title: data.title,
9292
text: data.text,
9393
buttons: data.buttons || [],

src/modal/modal.stories.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Modal, ModalService } from "../";
1313
selector: "app-sample-modal",
1414
template: `
1515
<ibm-modal>
16-
<ibm-modal-header (closeSelect)="closeModal()">Header text</ibm-modal-header>
16+
<ibm-modal-header (closeSelect)="closeModal()">header label</ibm-modal-header>
1717
<section class="bx--modal-content">
1818
<h1>Sample modal works.</h1>
1919
<p class="bx--modal-content__text">{{modalText}}</p>
@@ -65,7 +65,7 @@ class ModalStory {
6565
class AlertModalStory {
6666

6767
@Input() modalType: string;
68-
@Input() headerText: string;
68+
@Input() headerLabel: string;
6969
@Input() title: string;
7070
@Input() text: string;
7171
@Input() buttons: any;
@@ -75,7 +75,7 @@ class AlertModalStory {
7575
openModal() {
7676
this.modalService.show({
7777
modalType: this.modalType,
78-
headerText: this.headerText,
78+
headerLabel: this.headerLabel,
7979
title: this.title,
8080
text: this.text,
8181
buttons: this.buttons
@@ -128,13 +128,13 @@ storiesOf("Modal", module)
128128
.addDecorator(withKnobs)
129129
.add("Transactional", () => ({
130130
template: `
131-
<app-alert-modal-story [modalType]="modalType" [headerText]="headerText" [title]="title" [text]="text"
131+
<app-alert-modal-story [modalType]="modalType" [headerLabel]="headerLabel" [title]="title" [text]="text"
132132
[buttons]="buttons"></app-alert-modal-story>
133133
<ibm-modal-placeholder></ibm-modal-placeholder>
134134
`,
135135
props: {
136136
modalType: select("modalType", ["default", "danger"], "default"),
137-
headerText: text("headerText", "optional header text"),
137+
headerLabel: text("headerLabel", "optional header label"),
138138
title: text("title", "Delete service from application"),
139139
text: text("text", `Are you sure you want to remove the Speech to Text service from the node-test app?`),
140140
buttons: [{
@@ -165,13 +165,13 @@ storiesOf("Modal", module)
165165
.addDecorator(withKnobs)
166166
.add("Passive", () => ({
167167
template: `
168-
<app-alert-modal-story [modalType]="modalType" [headerText]="headerText" [title]="title" [text]="text"
168+
<app-alert-modal-story [modalType]="modalType" [headerLabel]="headerLabel" [title]="title" [text]="text"
169169
></app-alert-modal-story>
170170
<ibm-modal-placeholder></ibm-modal-placeholder>
171171
`,
172172
props: {
173173
modalType: select("modalType", ["default", "danger"], "default"),
174-
headerText: text("headerText", "optional header text"),
174+
headerLabel: text("headerLabel", "optional header label"),
175175
title: text("title", "Passive modal title"),
176176
text: text("text", "Passive modal notifications should only appear if there is an action " +
177177
"the user needs to address immediately. Passive modal notifications are persistent on screen"),

0 commit comments

Comments
 (0)