Skip to content

Commit

Permalink
Merge pull request #2 from fleetbase/dev-v0.0.3
Browse files Browse the repository at this point in the history
Dev v0.0.3
  • Loading branch information
roncodes authored Jul 19, 2024
2 parents 8c37ab6 + e01ece4 commit 2b48a5c
Show file tree
Hide file tree
Showing 20 changed files with 420 additions and 381 deletions.
16 changes: 16 additions & 0 deletions addon/components/registry-admin-config.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<ContentPanel @title="Registry Configuration" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
<InputGroup @name="Registry Host" @value={{this.registryHost}} disabled={{or this.getConfigValues.isRunning this.saveConfigValues.isRunning}} />
<InputGroup @name="Registry Token" @value={{this.registryToken}} disabled={{or this.getConfigValues.isRunning this.saveConfigValues.isRunning}} />
</ContentPanel>
<EmberWormhole @to="next-view-section-subheader-actions">
<Button
@type="primary"
@size="sm"
@icon="save"
@text="Save Changes"
@onClick={{perform this.saveConfigValues}}
@disabled={{or this.getConfigValues.isRunning this.saveConfigValues.isRunning}}
@isLoading={{this.saveConfigValues.isRunning}}
/>
</EmberWormhole>
<Spacer @height="400px" />
36 changes: 36 additions & 0 deletions addon/components/registry-admin-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
import { tracked } from '@glimmer/tracking';
import { task } from 'ember-concurrency';

export default class RegistryAdminConfigComponent extends Component {
@service fetch;
@service notifications;
@tracked registryHost;
@tracked registryToken;

constructor() {
super(...arguments);
this.getConfigValues.perform();
}

@task *getConfigValues() {
try {
const { host, token } = yield this.fetch.get('registry-extensions/config', {}, { namespace: '~registry/v1' });
this.registryHost = host;
this.registryToken = token;
} catch (error) {
this.notifications.serverError(error);
}
}

@task *saveConfigValues() {
try {
const { host, token } = yield this.fetch.post('registry-extensions/config', { host: this.registryHost, token: this.registryToken }, { namespace: '~registry/v1' });
this.registryHost = host;
this.registryToken = token;
} catch (error) {
this.notifications.serverError(error);
}
}
}
10 changes: 8 additions & 2 deletions addon/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import loadInitializers from 'ember-load-initializers';
import Resolver from 'ember-resolver';
import config from './config/environment';
import services from '@fleetbase/ember-core/exports/services';
import RegistryAdminConfigComponent from './components/registry-admin-config';
import ExtensionReviewerControlComponent from './components/extension-reviewer-control';
import ExtensionPendingPublishViewerComponent from './components/extension-pending-publish-viewer';

Expand All @@ -24,12 +25,17 @@ export default class RegistryBridgeEngine extends Engine {
'Extensions Registry',
[
{
title: 'Extensions Awaiting Review',
title: 'Registry Config',
icon: 'gear',
component: RegistryAdminConfigComponent,
},
{
title: 'Awaiting Review',
icon: 'gavel',
component: ExtensionReviewerControlComponent,
},
{
title: 'Extensions Pending Publish',
title: 'Pending Publish',
icon: 'rocket',
component: ExtensionPendingPublishViewerComponent,
},
Expand Down
27 changes: 14 additions & 13 deletions addon/templates/developers/payments/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@
</Layout::Section::Header>

<Layout::Section::Body class="overflow-y-scroll h-full">
{{#unless this.hasStripeConnectAccount}}
{{#if this.hasStripeConnectAccount}}
<Table
@rows={{@model.data}}
@columns={{this.columns}}
@selectable={{false}}
@canSelectAll={{false}}
@onSetup={{fn (mut this.table)}}
@pagination={{true}}
@paginationMeta={{@model.meta}}
@page={{this.page}}
@onPageChange={{fn (mut this.page)}}
/>
{{else}}
<div class="container">
<div class="max-w-3xl mx-auto mt-4">
<div class="content">
Expand All @@ -18,16 +30,5 @@
</div>
</div>
</div>
{{/unless}}
<Table
@rows={{@model.data}}
@columns={{this.columns}}
@selectable={{false}}
@canSelectAll={{false}}
@onSetup={{fn (mut this.table)}}
@pagination={{true}}
@paginationMeta={{@model.meta}}
@page={{this.page}}
@onPageChange={{fn (mut this.page)}}
/>
{{/if}}
</Layout::Section::Body>
6 changes: 3 additions & 3 deletions addon/templates/installed.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
<div class="font-semibold text-sm block">{{extension.name}}</div>
<div class="text-xs">{{n-a extension.description}}</div>
</div>
<div class="pt-1 space-y-2">
<div class="flex flex-col flex-1 pt-1 space-y-2">
<Button
@type="default"
@text={{t "registry-bridge.common.about-extension" extensionName=extension.name}}
@icon="circle-info"
@onClick={{fn this.about extension}}
class="w-full"
class="w-full btn-block"
/>
<Button @type="danger" @text={{t "registry-bridge.common.uninstall"}} @icon="trash" @onClick={{fn this.uninstall extension}} class="w-full" />
<Button @type="danger" @text={{t "registry-bridge.common.uninstall"}} @icon="trash" @onClick={{fn this.uninstall extension}} class="w-full btn-block" />
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions app/components/registry-admin-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '@fleetbase/registry-bridge-engine/components/registry-admin-config';
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleetbase/registry-bridge",
"version": "0.0.2",
"version": "0.0.3",
"description": "Internal Bridge between Fleetbase API and Extensions Registry",
"keywords": [
"fleetbase-extension",
Expand All @@ -20,7 +20,7 @@
],
"require": {
"php": "^8.0",
"fleetbase/core-api": "^1.4.28",
"fleetbase/core-api": "^1.4.30",
"laravel/cashier": "^15.2.1",
"php-http/guzzle7-adapter": "^1.0",
"psr/http-factory-implementation": "*",
Expand Down
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Registry Bridge",
"version": "0.0.2",
"version": "0.0.3",
"description": "Internal Bridge between Fleetbase API and Extensions Registry",
"repository": "https://github.com/fleetbase/registry-bridge",
"license": "AGPL-3.0-or-later",
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/registry-bridge-engine",
"version": "0.0.2",
"version": "0.0.3",
"description": "Internal Bridge between Fleetbase API and Extensions Registry",
"fleetbase": {
"route": "extensions"
Expand Down Expand Up @@ -40,10 +40,10 @@
"dependencies": {
"@babel/core": "^7.23.2",
"@fleetbase/ember-core": "^0.2.13",
"@fleetbase/ember-ui": "^0.2.18",
"@fortawesome/ember-fontawesome": "^0.4.1",
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fleetbase/ember-ui": "^0.2.19",
"@fortawesome/ember-fontawesome": "^2.0.0",
"@fortawesome/fontawesome-svg-core": "6.4.0",
"@fortawesome/free-solid-svg-icons": "6.4.0",
"@stripe/connect-js": "^3.3.10",
"ember-auto-import": "^2.6.3",
"ember-cli-babel": "^8.2.0",
Expand Down
Loading

0 comments on commit 2b48a5c

Please sign in to comment.