Skip to content

Commit

Permalink
ran linters
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Jul 15, 2024
1 parent bc9b3dd commit b8b082a
Show file tree
Hide file tree
Showing 16 changed files with 262 additions and 48 deletions.
4 changes: 2 additions & 2 deletions addon/components/extension-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<Image src={{@extension.icon_url}} class="w-full h-36 rounded-t-lg {{@iconClass}}" alt={{@extension.name}} @fallbackSrc={{config "defaultValues.extensionIcon"}} />
</div>
<div class="text-left px-3 py-2 rounded-b-lg bg-white border-t border-gray-200 dark:border-gray-700 dark:bg-gray-900 {{@detailsWrapperClass}}">
<span class="font-semibold text-sm block {{@nameTextClass}}">{{@extension.name}}</span>
<p class="text-xs {{@descriptionTextClass}}">{{n-a @extension.description}}</p>
<span class="font-semibold text-sm block {{@nameTextClass}}">{{@extension.name}}</span>
<p class="text-xs {{@descriptionTextClass}}">{{n-a @extension.description}}</p>
{{yield @extension}}
</div>
</button>
128 changes: 110 additions & 18 deletions addon/components/extension-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
<div class="mb-2">
<Image src={{@extension.icon_url}} @fallbackSrc={{config "defaultValues.extensionIcon"}} alt={{@extension.name}} class="w-32 h-32 rounded-lg border border-black shadow-sm" />
</div>
<FileUpload @name={{t "registry-bridge.developers.extensions.extension-form.upload-extension-icon"}} @accept={{join "," this.acceptedImageTypes}} @onFileAdded={{perform this.uploadIcon}} @labelClass="flex flex-row items-center justify-center" as |queue|>
<FileUpload
@name={{t "registry-bridge.developers.extensions.extension-form.upload-extension-icon"}}
@accept={{join "," this.acceptedImageTypes}}
@onFileAdded={{perform this.uploadIcon}}
@labelClass="flex flex-row items-center justify-center"
as |queue|
>
<a tabindex={{0}} class="flex items-center px-0 mt-2 text-xs no-underline truncate btn btn-sm btn-default" disabled={{not queue.files.length}}>
{{#if queue.files.length}}
<div class="mr-1.5">
Expand All @@ -23,21 +29,59 @@
</div>
<div class="flex-1 px-6 space-y-6">
<ContentPanel @title={{t "registry-bridge.developers.extensions.extension-form.details-content-block"}} @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
<InputGroup @name={{t "registry-bridge.developers.extensions.extension-form.extension-name"}} @value={{@extension.name}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-name-help-text"}} />
<InputGroup @name={{t "registry-bridge.developers.extensions.extension-form.extension-description"}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-description-help-text"}}>
<Textarea @value={{@extension.description}} placeholder={{t "registry-bridge.developers.extensions.extension-form.extension-description"}} class="form-input w-full" rows="3" />
<InputGroup
@name={{t "registry-bridge.developers.extensions.extension-form.extension-name"}}
@value={{@extension.name}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-name-help-text"}}
/>
<InputGroup
@name={{t "registry-bridge.developers.extensions.extension-form.extension-description"}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-description-help-text"}}
>
<Textarea
@value={{@extension.description}}
placeholder={{t "registry-bridge.developers.extensions.extension-form.extension-description"}}
class="form-input w-full"
rows="3"
/>
</InputGroup>
<InputGroup @name={{t "registry-bridge.developers.extensions.extension-form.extension-category"}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-category-help-text"}}>
<ModelSelect @modelName="category" @query={{hash for="extension_category" core_category=1}} @selectedModel={{@extension.category}} @placeholder={{t "registry-bridge.developers.extensions.extension-form.extension-select-category"}} @triggerClass="form-select form-input" @infiniteScroll={{false}} @renderInPlace={{true}} @onChange={{fn (mut @extension.category)}} as |category|>
<InputGroup
@name={{t "registry-bridge.developers.extensions.extension-form.extension-category"}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-category-help-text"}}
>
<ModelSelect
@modelName="category"
@query={{hash for="extension_category" core_category=1}}
@selectedModel={{@extension.category}}
@placeholder={{t "registry-bridge.developers.extensions.extension-form.extension-select-category"}}
@triggerClass="form-select form-input"
@infiniteScroll={{false}}
@renderInPlace={{true}}
@onChange={{fn (mut @extension.category)}}
as |category|
>
<div class="flex items-center">
<FaIcon @icon={{category.icon}} @size="sm" class="mr-2" />
<span>{{category.name}}</span>
</div>
</ModelSelect>
</InputGroup>

<InputGroup @name={{t "registry-bridge.developers.extensions.extension-form.extension-tags"}} @wrapperClass="mb-0i" @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-tags-help-text"}}>
<TagInput class="form-input" @placeholder={{t "registry-bridge.developers.extensions.extension-form.extension-add-tags"}} @allowSpacesInTags={{true}} @tags={{@extension.tags}} @addTag={{@extension.addTag}} @removeTagAtIndex={{@extension.removeTag}} @disabled={{this.core_extension}} as |tag|>
<InputGroup
@name={{t "registry-bridge.developers.extensions.extension-form.extension-tags"}}
@wrapperClass="mb-0i"
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-tags-help-text"}}
>
<TagInput
class="form-input"
@placeholder={{t "registry-bridge.developers.extensions.extension-form.extension-add-tags"}}
@allowSpacesInTags={{true}}
@tags={{@extension.tags}}
@addTag={{@extension.addTag}}
@removeTagAtIndex={{@extension.removeTag}}
@disabled={{this.core_extension}}
as |tag|
>
{{tag}}
</TagInput>
</InputGroup>
Expand All @@ -58,23 +102,71 @@
</div>
</ContentPanel>
<ContentPanel @title={{t "registry-bridge.developers.extensions.extension-form.extension-listing-details"}} @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
<InputGroup @name={{t "registry-bridge.developers.extensions.extension-form.extension-promotional-text"}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-promotional-text-help-text"}}>
<Textarea @value={{@extension.promotional_text}} placeholder={{t "registry-bridge.developers.extensions.extension-form.extension-promotional-text"}} class="form-input w-full" rows="3" />
<InputGroup
@name={{t "registry-bridge.developers.extensions.extension-form.extension-promotional-text"}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-promotional-text-help-text"}}
>
<Textarea
@value={{@extension.promotional_text}}
placeholder={{t "registry-bridge.developers.extensions.extension-form.extension-promotional-text"}}
class="form-input w-full"
rows="3"
/>
</InputGroup>
<InputGroup @name={{t "registry-bridge.developers.extensions.extension-form.extension-subtitle"}} @value={{@extension.subtitle}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-subtitle-help-text"}} />
<InputGroup @name={{t "registry-bridge.developers.extensions.extension-form.extension-copyright"}} @value={{@extension.copyright}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-copyright-help-text"}} />
<InputGroup
@name={{t "registry-bridge.developers.extensions.extension-form.extension-subtitle"}}
@value={{@extension.subtitle}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-subtitle-help-text"}}
/>
<InputGroup
@name={{t "registry-bridge.developers.extensions.extension-form.extension-copyright"}}
@value={{@extension.copyright}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-copyright-help-text"}}
/>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4">
<InputGroup @type="url" @name={{t "registry-bridge.developers.extensions.extension-form.extension-website-url"}} @value={{@extension.website_url}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-website-url-help-text"}} @wrapperClass="mb-0i" />
<InputGroup @type="url" @name={{t "registry-bridge.developers.extensions.extension-form.extension-repo-url"}} @value={{@extension.repo_url}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-repo-url-help-text"}} @wrapperClass="mb-0i" />
<InputGroup @type="url" @name={{t "registry-bridge.developers.extensions.extension-form.extension-support-url"}} @value={{@extension.support_url}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-support-url-help-text"}} @wrapperClass="mb-0i" />
<InputGroup @type="url" @name={{t "registry-bridge.developers.extensions.extension-form.extension-privacy-policy-url"}} @value={{@extension.privacy_policy_url}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-privacy-policy-url-help-text"}} @wrapperClass="mb-0i" />
<InputGroup @type="url" @name={{t "registry-bridge.developers.extensions.extension-form.extension-tos-url"}} @value={{@extension.tos_url}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-tos-url-help-text"}} @wrapperClass="mb-0i" />
<InputGroup
@type="url"
@name={{t "registry-bridge.developers.extensions.extension-form.extension-website-url"}}
@value={{@extension.website_url}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-website-url-help-text"}}
@wrapperClass="mb-0i"
/>
<InputGroup
@type="url"
@name={{t "registry-bridge.developers.extensions.extension-form.extension-repo-url"}}
@value={{@extension.repo_url}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-repo-url-help-text"}}
@wrapperClass="mb-0i"
/>
<InputGroup
@type="url"
@name={{t "registry-bridge.developers.extensions.extension-form.extension-support-url"}}
@value={{@extension.support_url}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-support-url-help-text"}}
@wrapperClass="mb-0i"
/>
<InputGroup
@type="url"
@name={{t "registry-bridge.developers.extensions.extension-form.extension-privacy-policy-url"}}
@value={{@extension.privacy_policy_url}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-privacy-policy-url-help-text"}}
@wrapperClass="mb-0i"
/>
<InputGroup
@type="url"
@name={{t "registry-bridge.developers.extensions.extension-form.extension-tos-url"}}
@value={{@extension.tos_url}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-tos-url-help-text"}}
@wrapperClass="mb-0i"
/>
</div>
</ContentPanel>
<ContentPanel @title={{t "registry-bridge.developers.extensions.extension-form.extension-screenshots"}} @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
<div class="space-y-4">
{{#if this.isUploading}}
<div class="dropzone w-full rounded-lg px-4 py-8 bg-gray-50 dark:bg-gray-900 bg-opacity-25 text-gray-900 dark:text-white text-center flex flex-col items-center justify-center border-2 border-dashed border-gray-200 dark:border-indigo-500">
<div
class="dropzone w-full rounded-lg px-4 py-8 bg-gray-50 dark:bg-gray-900 bg-opacity-25 text-gray-900 dark:text-white text-center flex flex-col items-center justify-center border-2 border-dashed border-gray-200 dark:border-indigo-500"
>
<div class="flex items-center justify-center py-5">
<Spinner class="text-sm dar:text-gray-100" @loadingMessage={{t "fleet-ops.common.uploading"}} />
</div>
Expand Down
43 changes: 36 additions & 7 deletions addon/components/extension-monetize-form.hbs
Original file line number Diff line number Diff line change
@@ -1,24 +1,53 @@
<ContentPanel @title={{t "registry-bridge.developers.extensions.extension-form.extension-payment-details"}} @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
<InputGroup @wrapperClass={{unless @extension.payment_required "mb-0i"}}>
<Toggle @isToggled={{@extension.payment_required}} @onToggle={{fn (mut @extension.payment_required)}} @label={{t "registry-bridge.developers.extensions.extension-form.extension-payment-required"}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-payment-required-help-text"}} />
<Toggle
@isToggled={{@extension.payment_required}}
@onToggle={{fn (mut @extension.payment_required)}}
@label={{t "registry-bridge.developers.extensions.extension-form.extension-payment-required"}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-payment-required-help-text"}}
/>
</InputGroup>
{{#if @extension.payment_required}}
<InputGroup>
<Toggle @isToggled={{@extension.subscription_required}} @onToggle={{fn (mut @extension.subscription_required)}} @label={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-required"}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-required-help-text"}} />
<Toggle
@isToggled={{@extension.subscription_required}}
@onToggle={{fn (mut @extension.subscription_required)}}
@label={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-required"}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-required-help-text"}}
/>
</InputGroup>
{{#if @extension.subscription_required}}
<InputGroup @name={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-billing-period"}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-billing-period-help-text"}}>
<Select @value={{@extension.subscription_billing_period}} @options={{this.billingPeriodOptions}} @onSelect={{fn (mut @extension.subscription_billing_period)}} @placeholder={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-billing-period-placeholder"}} class="w-full" />
<InputGroup
@name={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-billing-period"}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-billing-period-help-text"}}
>
<Select
@value={{@extension.subscription_billing_period}}
@options={{this.billingPeriodOptions}}
@onSelect={{fn (mut @extension.subscription_billing_period)}}
@placeholder={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-billing-period-placeholder"}}
class="w-full"
/>
</InputGroup>
<InputGroup @name={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-amount"}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-amount-help-text"}} @wrapperClass="mb-0i">
<InputGroup
@name={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-amount"}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-subscription-amount-help-text"}}
@wrapperClass="mb-0i"
>
<MoneyInput @value={{@extension.subscription_amount}} @currency="USD" />
</InputGroup>
{{else}}
<div class="grid grid-cols-1 lg:grid-cols-2 gap-2">
<InputGroup @name={{t "registry-bridge.developers.extensions.extension-form.extension-price"}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-price-help-text"}}>
<InputGroup
@name={{t "registry-bridge.developers.extensions.extension-form.extension-price"}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-price-help-text"}}
>
<MoneyInput @value={{@extension.price}} @currency="USD" />
</InputGroup>
<InputGroup @name={{t "registry-bridge.developers.extensions.extension-form.extension-sale-price"}} @helpText={{t "registry-bridge.developers.extensions.extension-form.extension-sale-price-help-text"}}>
<InputGroup
@name={{t "registry-bridge.developers.extensions.extension-form.extension-sale-price"}}
@helpText={{t "registry-bridge.developers.extensions.extension-form.extension-sale-price-help-text"}}
>
<MoneyInput @value={{@extension.sale_price}} @currency="USD" />
</InputGroup>
</div>
Expand Down
Loading

0 comments on commit b8b082a

Please sign in to comment.