1
1
< h3 > Create a new subscription</ h3 >
2
2
3
3
< mat-horizontal-stepper >
4
- < mat-step color ="accent ">
5
- < ng-template matStepLabel > Subscription Type</ ng-template >
6
- < p > Which type of subscription would you like to create?</ p >
7
- < mat-action-list >
8
- < button mat-list-item matStepperNext (click) ="setConfigType('pull') ">
9
- < mat-icon mat-list-icon > move_to_inbox</ mat-icon >
10
- < div mat-line > Pull Subscription</ div >
11
- < div mat-line class ="caption "> Subscribers must pull messages manually.</ div >
12
- </ button >
13
-
14
- < button mat-list-item matStepperNext (click) ="setConfigType('push') ">
15
- < mat-icon mat-list-icon > send</ mat-icon >
16
- < div mat-line > Push Subscription</ div >
17
- < div mat-line class ="caption "> Messages will be forwarded to an endpoint.</ div >
18
- </ button >
19
- </ mat-action-list >
20
- </ mat-step >
21
-
22
- < mat-step color ="accent ">
23
- < ng-template matStepLabel > Configuration</ ng-template >
24
-
25
- < div class ="final-config ">
26
- < mat-form-field appearance ="outline " [style.width] ="'100%' " class ="nameInput ">
27
- < mat-label > Enter subscription name</ mat-label >
28
- < mat-hint > becomes '/projects/project-name/subscriptions/{{this.subscriptionForm.value}}'</ mat-hint >
29
- < input matInput type ="text " autocomplete ="off " [formControl] ="this.subscriptionForm ">
30
- </ mat-form-field >
31
-
32
- < ng-container *ngIf ="this.configType === 'pull';then pullConfig; else pushConfig "> </ ng-container >
33
- </ div >
34
- </ mat-step >
4
+ < mat-step color ="accent ">
5
+ < ng-template matStepLabel > Subscription Type</ ng-template >
6
+ < p > Which type of subscription would you like to create?</ p >
7
+ < mat-action-list >
8
+ < button mat-list-item matStepperNext (click) ="setConfigType('pull') ">
9
+ < mat-icon mat-list-icon > move_to_inbox</ mat-icon >
10
+ < div mat-line > Pull Subscription</ div >
11
+ < div mat-line class ="caption "> Subscribers must pull messages manually.</ div >
12
+ </ button >
13
+
14
+ < button mat-list-item matStepperNext (click) ="setConfigType('push') ">
15
+ < mat-icon mat-list-icon > send</ mat-icon >
16
+ < div mat-line > Push Subscription</ div >
17
+ < div mat-line class ="caption "> Messages will be forwarded to an endpoint.</ div >
18
+ </ button >
19
+ </ mat-action-list >
20
+ </ mat-step >
21
+
22
+ < mat-step color ="accent ">
23
+ < ng-template matStepLabel > Configuration</ ng-template >
24
+
25
+ < div class ="final-config ">
26
+ < mat-form-field appearance ="outline " [style.width] ="'100%' " class ="nameInput ">
27
+ < mat-label > Enter subscription name</ mat-label >
28
+ < mat-hint > becomes '/projects/project-name/subscriptions/{{this.subscriptionForm.value}}'</ mat-hint >
29
+ < input matInput type ="text " autocomplete ="off " [formControl] ="this.subscriptionForm ">
30
+ </ mat-form-field >
31
+
32
+ @if (this.configType === 'pull') {
33
+ < button mat-raised-button color ="accent " (click) ="createPullSubscription() "
34
+ [disabled] ="this.subscriptionForm.invalid ">
35
+ Create Pull Subscription
36
+ < mat-icon > add</ mat-icon >
37
+ </ button >
38
+ } @else {
39
+ < mat-form-field appearance ="outline " [style.width] ="'100%' " class ="nameInput ">
40
+ < mat-label > Enter endpoint url</ mat-label >
41
+ < mat-hint > new messages will trigger this endpoint.</ mat-hint >
42
+ < input matInput type ="text " autocomplete ="off " [formControl] ="this.endpointForm ">
43
+ </ mat-form-field >
44
+ < button mat-raised-button color ="accent " (click) ="createPushSubscription() "
45
+ [disabled] ="this.subscriptionForm.invalid || this.endpointForm.invalid ">
46
+ Create Push Subscription
47
+ < mat-icon > add</ mat-icon >
48
+ </ button >
49
+ }
50
+ </ div >
51
+ </ mat-step >
35
52
</ mat-horizontal-stepper >
36
53
37
- < ng-template #pullConfig >
38
- < button mat-raised-button color ="accent " (click) ="createPullSubscription() "
39
- [disabled] ="this.subscriptionForm.invalid ">
40
- Create Pull Subscription
41
- < mat-icon > add</ mat-icon >
42
- </ button >
43
- </ ng-template >
44
-
45
- < ng-template #pushConfig >
46
-
47
- < mat-form-field appearance ="outline " [style.width] ="'100%' " class ="nameInput ">
48
- < mat-label > Enter endpoint url</ mat-label >
49
- < mat-hint > new messages will trigger this endpoint.</ mat-hint >
50
- < input matInput type ="text " autocomplete ="off " [formControl] ="this.endpointForm ">
51
- </ mat-form-field >
52
54
53
- < button mat-raised-button color ="accent " (click) ="createPushSubscription() "
54
- [disabled] ="this.subscriptionForm.invalid || this.endpointForm.invalid ">
55
- Create Push Subscription
56
- < mat-icon > add</ mat-icon >
57
- </ button >
58
- </ ng-template >
0 commit comments