Skip to content

Commit 7bc431c

Browse files
authored
Merge pull request #27 from fleetbase/dev-v0.2.3
v0.2.3
2 parents 0c5c4da + 7243c9d commit 7bc431c

24 files changed

Lines changed: 794 additions & 379 deletions

File tree

addon/components/api-event/details.hbs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
<ContentPanel @prefixTitle={{t "developers.component.api-event.details.prefixTitle"}} @title={{@apiEvent.event}} @prefixTitleRight={{@apiEvent.public_id}} @titleContainerClass="flex-col" @panelTitleClass="text-sm" @prefixTitleClass="ml-4 flex flex-row items-center text-sm" @prefixTitleRightClass="font-mono" @panelHeaderClass="items-stretch-i" @panelHeaderRightClass="items-start-i" @prefixTitleRightContainerClass="py-2" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800 text-sm">
1+
<ContentPanel
2+
@prefixTitle={{t "developers.component.api-event.details.prefixTitle"}}
3+
@title={{@apiEvent.event}}
4+
@prefixTitleRight={{@apiEvent.public_id}}
5+
@titleContainerClass="flex-col"
6+
@panelTitleClass="text-sm"
7+
@prefixTitleClass="ml-4 flex flex-row items-center text-sm"
8+
@prefixTitleRightClass="font-mono"
9+
@panelHeaderClass="items-stretch-i"
10+
@panelHeaderRightClass="items-start-i"
11+
@prefixTitleRightContainerClass="py-2"
12+
@open={{true}}
13+
@pad={{true}}
14+
@panelBodyClass="bg-white dark:bg-gray-800 text-sm"
15+
>
216
<table class="border-none table-fixed dark:text-gray-100 table-spaced-y-2 table-cells-valign-top">
317
<tbody>
418
<tr>

addon/components/api-request-log/details.hbs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
<ContentPanel @prefixTitle={{t "developers.component.api-request-log.details.prefixTitle"}} @title={{@apiRequest.description}} @titleStatus={{@apiRequest.status_code}} @prefixTitleRight={{@apiRequest.public_id}} @titleContainerClass="flex-col" @panelTitleClass="ml-4 flex flex-row items-center text-sm" @prefixTitleClass="text-sm" @prefixTitleRightClass="font-mono" @panelHeaderClass="items-stretch-i" @panelHeaderRightClass="items-start-i" @prefixTitleRightContainerClass="py-2" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800 text-sm">
1+
<ContentPanel
2+
@prefixTitle={{t "developers.component.api-request-log.details.prefixTitle"}}
3+
@title={{@apiRequest.description}}
4+
@titleStatus={{@apiRequest.status_code}}
5+
@prefixTitleRight={{@apiRequest.public_id}}
6+
@titleContainerClass="flex-col"
7+
@panelTitleClass="ml-4 flex flex-row items-center text-sm"
8+
@prefixTitleClass="text-sm"
9+
@prefixTitleRightClass="font-mono"
10+
@panelHeaderClass="items-stretch-i"
11+
@panelHeaderRightClass="items-start-i"
12+
@prefixTitleRightContainerClass="py-2"
13+
@open={{true}}
14+
@pad={{true}}
15+
@panelBodyClass="bg-white dark:bg-gray-800 text-sm"
16+
>
217
<table class="border-none table-fixed dark:text-gray-100 table-spaced-y-2 table-cells-valign-top">
318
<tbody>
419
<tr>

addon/components/api-request-log/request-body.hbs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
<ContentPanel @title={{concat (t "developers.component.api-request-log.request-body.title") @apiRequest.method (t "developers.component.api-request-log.request-body.title-second-part")}} @panelTitleClass="text-sm" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
1+
<ContentPanel
2+
@title={{concat (t "developers.component.api-request-log.request-body.title") @apiRequest.method (t "developers.component.api-request-log.request-body.title-second-part")}}
3+
@panelTitleClass="text-sm"
4+
@open={{true}}
5+
@pad={{true}}
6+
@panelBodyClass="bg-white dark:bg-gray-800"
7+
>
28
{{#if @apiRequest.request_body}}
39
<CodeBlock @code={{or (json-stringify @apiRequest.request_body) ""}} @language="json" class="line-numbers" />
410
{{else}}

addon/components/modals/api-key-form.hbs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
<label>
55
{{t "developers.common.name"}}
66
</label>
7-
<Input @value={{options.apiKey.name}} @type="text" aria-label={{t "developers.component.modals.api-key-form.api-name-aria-label"}} class="w-full form-input" placeholder={{t "developers.component.modals.api-key-form.name-placeholder"}} />
7+
<Input
8+
@value={{options.apiKey.name}}
9+
@type="text"
10+
aria-label={{t "developers.component.modals.api-key-form.api-name-aria-label"}}
11+
class="w-full form-input"
12+
placeholder={{t "developers.component.modals.api-key-form.name-placeholder"}}
13+
/>
814
</div>
915
<div class="input-group">
1016
<InputLabel @labelText={{t "developers.component.modals.api-key-form.expiration-label"}} @helpText={{t "developers.component.modals.api-key-form.expiration-help-text"}} />
@@ -24,12 +30,6 @@
2430
</p>
2531
</div>
2632

27-
<div class="input-group">
28-
<ArrayInput @data={{@options.apiKey.browser_origins}} @placeholder={{t "developers.component.modals.api-key-form.enter-domain-placeholder"}} @onDataChanged={{fn (mut @options.apiKey.browser_origins)}}>
29-
<InputLabel @labelText={{t "developers.component.modals.api-key-form.allowed-browser-label"}} @helpText={{t "developers.component.modals.api-key-form.allowed-browser-help-text"}} />
30-
</ArrayInput>
31-
</div>
32-
3333
<div class="flex flex-col input-group">
3434
{{#if @options.testMode}}
3535
<Badge @status="test">
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<Modal::Default @modalIsOpened={{@modalIsOpened}} @options={{@options}} @confirm={{@onConfirm}} @decline={{@onDecline}} as |options|>
22
<div class="modal-body-container">
3-
<InputGroup @name={{t "developers.component.modals.listen-custom-channel.name"}} @value={{@options.channelId}} @helpText={{t "developers.component.modals.listen-custom-channel.name-help-text"}} />
3+
<InputGroup
4+
@name={{t "developers.component.modals.listen-custom-channel.name"}}
5+
@value={{@options.channelId}}
6+
@helpText={{t "developers.component.modals.listen-custom-channel.name-help-text"}}
7+
/>
48
</div>
59
</Modal::Default>

addon/components/modals/rename-api-key-form.hbs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
<label>
55
{{t "developers.common.name"}}
66
</label>
7-
<Input @value={{options.apiKey.name}} @type="text" aria-label={{t "developers.component.modals.rename-api-key-form.api-key-label"}} class="w-full form-input" placeholder={{t "developers.component.modals.rename-api-key-form.api-key-placeholder"}} />
7+
<Input
8+
@value={{options.apiKey.name}}
9+
@type="text"
10+
aria-label={{t "developers.component.modals.rename-api-key-form.api-key-label"}}
11+
class="w-full form-input"
12+
placeholder={{t "developers.component.modals.rename-api-key-form.api-key-placeholder"}}
13+
/>
814
</div>
915
</div>
1016
</Modal::Default>

addon/components/modals/roll-api-key-form.hbs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
<div class="mb-2 dark:text-gray-100">
1111
{{@options.apiKey.key}}
1212
</div>
13-
<Button @text={{t "developers.component.modals.roll-api-key-form.view-button-text"}} @size="xs" @icon="arrow-right" @onClick={{fn @options.viewRequestLogs @options.apiKey}} />
13+
<Button
14+
@text={{t "developers.component.modals.roll-api-key-form.view-button-text"}}
15+
@size="xs"
16+
@icon="arrow-right"
17+
@onClick={{fn @options.viewRequestLogs @options.apiKey}}
18+
/>
1419
</div>
1520
</div>
1621
</div>
@@ -36,7 +41,11 @@
3641
</span>
3742
</div>
3843
<div class="w-3/4">
39-
<select class="w-full mb-2 form-select form-input-sm" aria-label={{t "developers.component.modals.roll-api-key-form.api-key-expiration-label"}} {{on "change" @options.setExpiration}}>
44+
<select
45+
class="w-full mb-2 form-select form-input-sm"
46+
aria-label={{t "developers.component.modals.roll-api-key-form.api-key-expiration-label"}}
47+
{{on "change" @options.setExpiration}}
48+
>
4049
<option selected disabled>
4150
{{t "developers.component.modals.roll-api-key-form.select-date"}}
4251
</option>
@@ -74,7 +83,13 @@
7483
<label>
7584
{{t "developers.common.password"}}
7685
</label>
77-
<Input @type="password" @value={{@options.password}} aria-label={{t "developers.component.modals.roll-api-key-form.user-password"}} placeholder={{t "developers.component.modals.roll-api-key-form.user-password-placeholder"}} class="w-full form-input" />
86+
<Input
87+
@type="password"
88+
@value={{@options.password}}
89+
aria-label={{t "developers.component.modals.roll-api-key-form.user-password"}}
90+
placeholder={{t "developers.component.modals.roll-api-key-form.user-password-placeholder"}}
91+
class="w-full form-input"
92+
/>
7893
</div>
7994
</div>
8095
</Modal::Default>

addon/components/modals/webhook-form.hbs

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
11
<Modal::Default @modalIsOpened={{@modalIsOpened}} @options={{@options}} @confirm={{@onConfirm}} @decline={{@onDecline}} as |options|>
22
<div class="px-5 border-b border-gray-200 dark:border-gray-800">
33
<div class="input-group">
4-
<InputLabel @labelText={{t "developers.component.modals.webhook-form.endpoint-url"}} @helpText={{t "developers.component.modals.webhook-form.endpoint-url-help-text"}} @required={{true}} />
5-
<Input @value={{options.webhook.url}} @type="url" aria-label="Webhook URL" class="w-full form-input" placeholder={{t "developers.component.modals.webhook-form.endpoint-url-placeholder"}} />
4+
<InputLabel
5+
@labelText={{t "developers.component.modals.webhook-form.endpoint-url"}}
6+
@helpText={{t "developers.component.modals.webhook-form.endpoint-url-help-text"}}
7+
@required={{true}}
8+
/>
9+
<Input
10+
@value={{options.webhook.url}}
11+
@type="url"
12+
aria-label="Webhook URL"
13+
class="w-full form-input"
14+
placeholder={{t "developers.component.modals.webhook-form.endpoint-url-placeholder"}}
15+
/>
616
</div>
717

818
<div class="input-group">
919
<InputLabel @labelText={{t "developers.component.modals.webhook-form.description-label"}} @helpText={{t "developers.component.modals.webhook-form.description-help-text"}} />
10-
<Textarea @value={{options.webhook.description}} aria-label={{t "developers.component.modals.webhook-form.description-aria-label"}} class="w-full form-input" placeholder={{t "developers.component.modals.webhook-form.description-placeholder"}} />
20+
<Textarea
21+
@value={{options.webhook.description}}
22+
aria-label={{t "developers.component.modals.webhook-form.description-aria-label"}}
23+
class="w-full form-input"
24+
placeholder={{t "developers.component.modals.webhook-form.description-placeholder"}}
25+
/>
1126
</div>
1227
</div>
1328

1429
<div class="px-5 pt-4 border-b border-gray-200 dark:border-gray-800">
15-
<div class="input-group">
16-
<InputLabel @labelText={{t "developers.component.modals.webhook-form.api-credential-label"}} @helpText={{t "developers.component.modals.webhook-form.api-credential-help-text"}} />
30+
<div class="input-group">
31+
<InputLabel
32+
@labelText={{t "developers.component.modals.webhook-form.api-credential-label"}}
33+
@helpText={{t "developers.component.modals.webhook-form.api-credential-help-text"}}
34+
/>
1735

1836
<select class="w-full form-select" aria-label={{t "developers.component.modals.webhook-form.api-credential-label"}} {{on "change" @options.setApiCredential}}>
1937
<option value={{null}} selected>
@@ -51,7 +69,11 @@
5169
<div class="px-5 pt-4">
5270
<div class="input-group">
5371
<div class="mb-4">
54-
<InputLabel class="mb-2" @labelText={{t "developers.component.modals.webhook-form.events-send-label"}} @helpText={{t "developers.component.modals.webhook-form.events-send-help-text"}} />
72+
<InputLabel
73+
class="mb-2"
74+
@labelText={{t "developers.component.modals.webhook-form.events-send-label"}}
75+
@helpText={{t "developers.component.modals.webhook-form.events-send-help-text"}}
76+
/>
5577

5678
<div class="flex items-start justify-between">
5779
<div class="w-1/2">
@@ -63,7 +85,12 @@
6385
</dd.Trigger>
6486
<dd.Content class="w-full h-48 mt-1 overflow-y-hidden border bg-white border-gray-300 rounded shadow-md dark:border-gray-800 dark:bg-gray-700">
6587
<div class="w-full rounded shadow">
66-
<Input aria-label={{t "developers.component.modals.webhook-form.event-search-label"}} placeholder={{t "developers.component.modals.webhook-form.event-search-placeholder"}} class="w-full px-3 py-2 text-sm leading-4 border-b border-gray-300 shadow-sm dark:border-gray-800 dark:bg-gray-700 dark:text-gray-100" {{on "keyup" @options.searchEvents}} />
88+
<Input
89+
aria-label={{t "developers.component.modals.webhook-form.event-search-label"}}
90+
placeholder={{t "developers.component.modals.webhook-form.event-search-placeholder"}}
91+
class="w-full px-3 py-2 text-sm leading-4 border-b border-gray-300 shadow-sm dark:border-gray-800 dark:bg-gray-700 dark:text-gray-100"
92+
{{on "keyup" @options.searchEvents}}
93+
/>
6794
<div class="w-full h-40 pb-2 overflow-y-scroll">
6895
{{#each-in @options.eventOptions as |resourceName events|}}
6996
<div class="">
@@ -76,7 +103,12 @@
76103
</span>
77104
</div>
78105
{{#each events as |event|}}
79-
<a href="javascript:;" class="block px-6 py-3 text-xs text-gray-700 no-underline cursor-pointer hover:opacity-75 dark:text-gray-100" disabled={{includes event @options.webhook.events}} {{on "click" (fn @options.addEvent event dd)}}>
106+
<a
107+
href="javascript:;"
108+
class="block px-6 py-3 text-xs text-gray-700 no-underline cursor-pointer hover:opacity-75 dark:text-gray-100"
109+
disabled={{includes event @options.webhook.events}}
110+
{{on "click" (fn @options.addEvent event dd)}}
111+
>
80112
{{event}}
81113
</a>
82114
{{/each}}

addon/components/webhook/attempts.hbs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,21 @@
1414
<div class="flex items-center section-header-actions">
1515
<div class="rounded-lg border borer-gray-300 dark:border-gray-700 shadow-sm">
1616
<div class="rounded-lg flex items-center justify-between px-2 py-1 text-sm bg-white dark:bg-gray-900">
17-
<a href="javascript:;" class="mx-4 no-underline text-gray-400 {{if this.noAttemptStatus "font-semibold text-blue-400"}}" {{on "click" this.changeAttemptStatus}}>
17+
<a href="javascript:;" class="mx-4 no-underline text-gray-400 {{if this.noAttemptStatus 'font-semibold text-blue-400'}}" {{on "click" this.changeAttemptStatus}}>
1818
{{t "developers.common.all"}}
1919
</a>
20-
<a href="javascript:;" class="mx-4 no-underline text-gray-400 {{if (eq this.attemptStatus "successful") "font-semibold text-blue-400"}}" {{on "click" (fn this.changeAttemptStatus "successful")}}>
20+
<a
21+
href="javascript:;"
22+
class="mx-4 no-underline text-gray-400 {{if (eq this.attemptStatus 'successful') 'font-semibold text-blue-400'}}"
23+
{{on "click" (fn this.changeAttemptStatus "successful")}}
24+
>
2125
{{t "developers.common.succeeded"}}
2226
</a>
23-
<a href="javascript:;" class="mx-4 no-underline text-gray-400 {{if (eq this.attemptStatus "failed") "font-semibold text-blue-400"}}" {{on "click" (fn this.changeAttemptStatus "failed")}}>
27+
<a
28+
href="javascript:;"
29+
class="mx-4 no-underline text-gray-400 {{if (eq this.attemptStatus 'failed') 'font-semibold text-blue-400'}}"
30+
{{on "click" (fn this.changeAttemptStatus "failed")}}
31+
>
2432
{{t "developers.common.failed"}}
2533
</a>
2634
</div>
@@ -39,7 +47,8 @@
3947
{{t "developers.component.webhook.attempts.http-code"}}
4048
</td>
4149
<td>
42-
{{row.status_code}} ({{row.reason_phrase}})
50+
{{row.status_code}}
51+
({{row.reason_phrase}})
4352
</td>
4453
</tr>
4554
<tr>

addon/controllers/api-keys/index.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,52 +166,62 @@ export default class ApiKeysIndexController extends Controller {
166166
valuePath: 'name',
167167
cellComponent: 'table/cell/anchor',
168168
action: this.editApiKey,
169+
resizable: true,
169170
width: '10%',
170171
sortable: false,
171172
},
172173
{
173174
label: this.intl.t('developers.api-keys.index.public-key'),
174175
valuePath: 'key',
175-
width: '20%',
176+
width: '18%',
176177
sortable: false,
178+
resizable: true,
177179
cellComponent: 'click-to-copy',
178180
},
179181
{
180182
label: this.intl.t('developers.api-keys.index.secret-key'),
181183
valuePath: 'secret',
182-
width: '20%',
184+
width: '18%',
183185
sortable: false,
186+
resizable: true,
184187
cellComponent: 'click-to-reveal',
188+
cellComponentArgs: {
189+
clickToCopy: true,
190+
},
185191
},
186192
{
187193
label: this.intl.t('developers.api-keys.index.enviroment'),
188194
valuePath: 'environment',
189-
width: '12%',
195+
width: '10%',
190196
sortable: false,
197+
resizable: true,
191198
cellComponent: 'table/cell/status',
192199
},
193200
{
194201
label: this.intl.t('developers.api-keys.index.expiry'),
195202
valuePath: 'expiresAt',
196203
sortable: false,
197-
width: '10%',
204+
width: '8%',
198205
tooltip: true,
206+
resizable: true,
199207
cellClassNames: 'overflow-visible',
200208
},
201209
{
202210
label: this.intl.t('developers.api-keys.index.last-used'),
203211
valuePath: 'lastUsed',
204212
sortable: false,
205-
width: '10%',
213+
width: '14%',
206214
tooltip: true,
215+
resizable: true,
207216
cellClassNames: 'overflow-visible',
208217
},
209218
{
210219
label: this.intl.t('developers.common.created'),
211220
valuePath: 'createdAt',
212221
sortable: false,
213-
width: '10%',
222+
width: '14%',
214223
tooltip: true,
224+
resizable: true,
215225
cellClassNames: 'overflow-visible',
216226
},
217227
{
@@ -519,4 +529,11 @@ export default class ApiKeysIndexController extends Controller {
519529
},
520530
});
521531
}
532+
533+
/**
534+
* Reload data.
535+
*/
536+
@action reload() {
537+
return this.hostRouter.refresh();
538+
}
522539
}

0 commit comments

Comments
 (0)