@@ -11,7 +11,7 @@ const elementName = "zapier-management-dashboard";
11
11
export class ZapierManagementDashboardElement extends UmbLitElement {
12
12
#zapierContext?: typeof ZAPIER_CONTEXT_TOKEN . TYPE ;
13
13
#paginationManager = new UmbPaginationManager ( ) ;
14
- #itemList: GetAllResponse | undefined ;
14
+ #itemList: Array < SubscriptionDtoModel > = [ ] ;
15
15
#isFormsExtensionInstalled: boolean | undefined = false ;
16
16
17
17
@state ( )
@@ -60,36 +60,12 @@ export class ZapierManagementDashboardElement extends UmbLitElement {
60
60
}
61
61
62
62
async getAll ( ) {
63
- debugger ;
64
- const data = await this . #zapierContext?. getAll ( ) ;
63
+ const { data } = await this . #zapierContext! . getAll ( ) ;
65
64
if ( ! data ) return ;
66
65
67
- this . #itemList = data . data ;
68
-
69
- const lst : Array < SubscriptionDtoModel > = [ {
70
- entityId : "docType1" ,
71
- typeName : "Content" ,
72
- hookUrl : "wwww.google.com" ,
73
- id : 1 ,
74
- subscribeHook : true ,
75
- type : 1
76
- } , {
77
- entityId : "docType1" ,
78
- typeName : "Content" ,
79
- hookUrl : "wwww.google.com" ,
80
- id : 1 ,
81
- subscribeHook : true ,
82
- type : 1
83
- } , {
84
- entityId : "docType1" ,
85
- typeName : "Content" ,
86
- hookUrl : "wwww.google.com" ,
87
- id : 1 ,
88
- subscribeHook : true ,
89
- type : 1
90
- } ] ;
91
-
92
- this . #createTableItems( lst ) ;
66
+ this . #itemList = data ;
67
+
68
+ this . #createTableItems( this . #itemList) ;
93
69
}
94
70
95
71
async checkFormsExtension ( ) {
@@ -99,75 +75,68 @@ export class ZapierManagementDashboardElement extends UmbLitElement {
99
75
this . #isFormsExtensionInstalled = data . data ;
100
76
}
101
77
102
- #createTableItems( products : Array < SubscriptionDtoModel > ) {
103
- this . _tableItems = products . map ( ( product ) => {
78
+ #createTableItems( subscriptionHooks : Array < SubscriptionDtoModel > ) {
79
+ this . _tableItems = subscriptionHooks . map ( ( subscriptionHook ) => {
104
80
return {
105
- id : product . id . toString ( ) ,
81
+ id : subscriptionHook . id . toString ( ) ,
106
82
data : [ {
107
83
columnAlias : "identifer" ,
108
- value : product . entityId ,
84
+ value : subscriptionHook . entityId ,
109
85
} ,
110
86
{
111
87
columnAlias : "entityType" ,
112
- value : product . type ,
88
+ value : subscriptionHook . type ,
113
89
} ,
114
90
{
115
91
columnAlias : "hookUrl" ,
116
- value : product . hookUrl ,
92
+ value : subscriptionHook . hookUrl ,
117
93
}
118
94
]
119
95
}
120
96
} ) ;
121
97
}
122
98
123
99
override render ( ) {
124
- return html `
125
- <div class= "zapier-content" >
126
- <umb- body- layout>
127
- <uui- box headline= "Content Properties" >
128
- <p>
129
- <a href= "https://zapier.com/" > Zapier </ a> is an online platform that helps you automate workflows by connecting your apps and services you use .
130
- This allows you to automate tasks without having to build this integration yourself .
131
- When an event happens in one app , Zapier can tell another app to perform (or do) a particular action - no code necessary.
132
- </ p>
133
- <p>
134
- The heart of any automation boils down to this simple command : <b> WHEN </ b> <span> this happens </ span> <b> THEN </ b> <span> do that </ span> .
135
- </ p>
136
- <p>
137
- A Zap is an automated workflow that tells your apps to follow this simple command : "When this happens, do that."
138
- Every Zap has a trigger and one or more actions . A trigger is an event that starts a Zap , and an action is what your Zap does for you .
139
- </ p>
100
+ return html `
101
+ <umb- body- layout>
102
+ <uui- box headline= "Content Properties" >
103
+ <p>
104
+ <a href= "https://zapier.com/" > Zapier </ a> is an online platform that helps you automate workflows by connecting your apps and services you use .
105
+ This allows you to automate tasks without having to build this integration yourself .
106
+ When an event happens in one app , Zapier can tell another app to perform (or do) a particular action - no code necessary.
107
+ </ p>
108
+ <p>
109
+ The heart of any automation boils down to this simple command : <b> WHEN </ b> <span> this happens </ span> <b> THEN </ b> <span> do that </ span> .
110
+ </ p>
111
+ <p>
112
+ A Zap is an automated workflow that tells your apps to follow this simple command : "When this happens, do that."
113
+ Every Zap has a trigger and one or more actions . A trigger is an event that starts a Zap , and an action is what your Zap does for you .
114
+ </ p>
115
+ <p>
116
+ Zap triggers use webhooks to execute the actions . Webhooks are automated messages sent from apps when something happens .
117
+ </ p>
118
+ ${ ! this . #isFormsExtensionInstalled ? html `
140
119
<p>
141
- Zap triggers use webhooks to execute the actions . Webhooks are automated messages sent from apps when something happens .
120
+ You can initiate your automation when a content item of a particular document type is published in Umbraco .
142
121
</ p>
143
- ${ ! this . #isFormsExtensionInstalled ? html `
144
- <p>
145
- You can initiate your automation when a content item of a particular document type is published in Umbraco .
146
- </ p>
147
- ` : html `
148
- <p>
149
- You can initiate your automation when a content item of a particular document type is published or a form is submitted in Umbraco .
150
- </ p>
151
- `
152
- }
122
+ ` : html `
153
123
<p>
154
- The integration uses Zapier subscription hook triggers , allowing Zapier to set up and remove hook subscriptions when Zaps are created or removed on the platform .
124
+ You can initiate your automation when a content item of a particular document type is published or a form is submitted in Umbraco .
155
125
</ p>
156
- < / uui - box >
157
- < / umb - body - layout >
158
- < / div >
159
-
160
- <div >
161
- <umb - body - layout >
162
- <uui- box headline= "Registed Subscription Hooks" >
163
- <umb- table
126
+ `
127
+ }
128
+ <p >
129
+ The integration uses Zapier subscription hook triggers , allowing Zapier to set up and remove hook subscriptions when Zaps are created or removed on the platform .
130
+ < / p >
131
+ </ uui - box >
132
+ <uui- box id = "subscriptionHooks" headline = "Registed Subscription Hooks" >
133
+ <umb- table
164
134
.columns = ${ this . _tableColumns }
165
135
.items = ${ this . _tableItems } >
166
136
</ umb- table>
167
137
${ this . #renderPagination( ) }
168
138
</ uui- box>
169
- </ umb- body- layout>
170
- </ div>
139
+ </ umb- body- layout>
171
140
` ;
172
141
}
173
142
@@ -198,8 +167,8 @@ export class ZapierManagementDashboardElement extends UmbLitElement {
198
167
}
199
168
200
169
static styles = [ css `
201
- . zapier-content p : first-child {
202
- margin-top : 0 !important ;
170
+ # subscriptionHooks {
171
+ margin-top : 20 px ;
203
172
}
204
173
` ] ;
205
174
}
0 commit comments