From 34d4e5e58feda5519aae1a7bbb98061f086e5123 Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:22:26 -0500 Subject: [PATCH 01/16] fix web manifest format error --- web/projects/ui/src/manifest.webmanifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/projects/ui/src/manifest.webmanifest b/web/projects/ui/src/manifest.webmanifest index 984106d74..9dca24b6a 100644 --- a/web/projects/ui/src/manifest.webmanifest +++ b/web/projects/ui/src/manifest.webmanifest @@ -20,5 +20,5 @@ "type": "image/png", "purpose": "any" } - ], + ] } From 490231d9b2b9dc2fa65edf926b4fedfdb71b53be Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Mon, 20 Jan 2025 17:54:08 -0500 Subject: [PATCH 02/16] fix setting optional dependencies --- .../Systems/SystemForEmbassy/index.ts | 21 ++++++++++++------- container-runtime/src/index.ts | 4 ++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts index bc2da8871..db839266e 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts @@ -709,6 +709,7 @@ export class SystemForEmbassy implements System { ([key, value]): T.Dependencies => { const dependency = this.manifest.dependencies?.[key] if (!dependency) return [] + // if from manifest.dependencies if (value == null) { const versionRange = dependency.version if (dependency.requirement.type === "required") { @@ -721,14 +722,20 @@ export class SystemForEmbassy implements System { }, ] } - return [ - { - kind: "exists", - id: key, - versionRange, - }, - ] + // current dep since default in config + if (dependency.requirement.type === "opt-out") { + return [ + { + id: key, + versionRange, + kind: "exists", + }, + ] + } + // if opt-in, not a current dep, only changed through config + return [] } + // if from rawDepends (ie. config) const versionRange = dependency.version const kind = "running" return [ diff --git a/container-runtime/src/index.ts b/container-runtime/src/index.ts index ec6a998f4..38c0aec1e 100644 --- a/container-runtime/src/index.ts +++ b/container-runtime/src/index.ts @@ -11,7 +11,7 @@ new RpcListener(getDependencies) /** -So, this is going to be sent into a running comtainer along with any of the other node modules that are going to be needed and used. +So, this is going to be sent into a running container along with any of the other node modules that are going to be needed and used. Once the container is started, we will go into a loading/ await state. This is the init system, and it will always be running, and it will be waiting for a command to be sent to it. @@ -38,5 +38,5 @@ There are /** TODO: -Should I seperate those adapter in/out? +Should I separate those adapter in/out? */ From 35c34b6e1576f66c683dc34776a5fe729b9fd55a Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Mon, 20 Jan 2025 23:17:36 -0500 Subject: [PATCH 03/16] rework dependency actions to be nested --- .../apps-routes/app-show/app-show.module.ts | 2 + .../apps-routes/app-show/app-show.page.html | 3 + .../apps-routes/app-show/app-show.page.ts | 4 +- .../app-show-action-requests.component.html | 12 ---- .../app-show-action-requests.component.scss | 12 ---- .../app-show-action-requests.component.ts | 40 ++--------- .../app-show-dependencies.component.html | 6 ++ .../app-show-dependencies.component.ts | 16 +++++ .../dep-action-requests.component.html | 31 ++++++++ .../dep-action-requests.component.scss | 8 +++ .../dep-action-requests.component.ts | 71 +++++++++++++++++++ .../ui/src/app/services/api/api.fixures.ts | 64 ++++++++++++++++- .../ui/src/app/services/api/api.types.ts | 6 +- .../ui/src/app/services/api/mock-patch.ts | 64 ++++++++++++++++- .../ui/src/app/services/dep-error.service.ts | 7 +- 15 files changed, 274 insertions(+), 72 deletions(-) create mode 100644 web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.html create mode 100644 web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.scss create mode 100644 web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.ts diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.module.ts b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.module.ts index 5787948d6..bbfbbaeda 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.module.ts +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.module.ts @@ -20,6 +20,7 @@ import { AppShowHealthChecksComponent } from './components/app-show-health-check import { AppShowAdditionalComponent } from './components/app-show-additional/app-show-additional.component' import { AppShowErrorComponent } from './components/app-show-error/app-show-error.component' import { AppShowActionRequestsComponent } from './components/app-show-action-requests/app-show-action-requests.component' +import { DepActionRequestsComponent } from './components/app-show-dependencies/dep-action-requests/dep-action-requests.component' import { HealthColorPipe } from './pipes/health-color.pipe' import { ToHealthChecksPipe } from './pipes/to-health-checks.pipe' import { ToButtonsPipe } from './pipes/to-buttons.pipe' @@ -47,6 +48,7 @@ const routes: Routes = [ AppShowAdditionalComponent, AppShowErrorComponent, AppShowActionRequestsComponent, + DepActionRequestsComponent, ], imports: [ CommonModule, diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.html b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.html index 286f3ef5b..e5a34972d 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.html +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.html @@ -35,6 +35,9 @@ diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.ts b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.ts index b48b49dd9..2b350f5b2 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.ts +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.ts @@ -142,8 +142,8 @@ export class AppShowPage { errorText = 'Incorrect version' fixText = 'Update' fixAction = () => this.installDep(pkg, manifest, depId) - } else if (depError.type === 'actionRequired') { - errorText = 'Action Required (see above)' + } else if (depError.type === 'actionNeeded') { + errorText = 'Action Needed (see below)' } else if (depError.type === 'notRunning') { errorText = 'Not running' fixText = 'Start' diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.html b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.html index 2aee18f05..d1766b84c 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.html +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.html @@ -8,13 +8,7 @@

{{ request.actionName }}

-

- Service: - - {{ request.dependency.title }} -

- Reason: {{ request.reason || 'no reason provided' }}

@@ -31,13 +25,7 @@

{{ request.actionName }}

{{ request.actionName }}

-

- Service: - - {{ request.dependency.title }} -

- Reason: {{ request.reason || 'no reason provided' }}

diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.scss b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.scss index c83e6f6a7..f2b102bb1 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.scss +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.scss @@ -1,16 +1,4 @@ -.light { - color: var(--ion-color-dark); -} - .highlighted { color: var(--ion-color-dark); font-weight: bold; -} - -.dependency { - display: inline-flex; - img { - max-width: 16px; - margin: 0 2px 0 5px; - } } \ No newline at end of file diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.ts b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.ts index 0fefe17be..7c95c8412 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.ts +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.ts @@ -1,7 +1,6 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core' import { T } from '@start9labs/start-sdk' import { ActionService } from 'src/app/services/action.service' -import { getDepDetails } from 'src/app/util/dep-info' @Component({ selector: 'app-show-action-requests', @@ -22,32 +21,17 @@ export class AppShowActionRequestsComponent { get actionRequests() { const critical: (T.ActionRequest & { actionName: string - dependency: { - title: string - icon: string - } | null })[] = [] const important: (T.ActionRequest & { actionName: string - dependency: { - title: string - icon: string - } | null })[] = [] Object.values(this.pkg.requestedActions) - .filter(r => r.active) + .filter(r => r.active && r.request.packageId === this.manifest.id) .forEach(r => { - const self = r.request.packageId === this.manifest.id const toReturn = { ...r.request, - actionName: self - ? this.pkg.actions[r.request.actionId].name - : this.allPkgs[r.request.packageId]?.actions[r.request.actionId] - .name || 'Unknown Action', - dependency: self - ? null - : getDepDetails(this.pkg, this.allPkgs, r.request.packageId), + actionName: this.pkg.actions[r.request.actionId].name, } if (r.request.severity === 'critical') { @@ -63,31 +47,19 @@ export class AppShowActionRequestsComponent { constructor(private readonly actionService: ActionService) {} async handleAction(request: T.ActionRequest) { - const self = request.packageId === this.manifest.id this.actionService.present({ pkgInfo: { id: request.packageId, - title: self - ? this.manifest.title - : getDepDetails(this.pkg, this.allPkgs, request.packageId).title, - mainStatus: self - ? this.pkg.status.main - : this.allPkgs[request.packageId].status.main, - icon: self - ? this.pkg.icon - : getDepDetails(this.pkg, this.allPkgs, request.packageId).icon, + title: this.manifest.title, + mainStatus: this.pkg.status.main, + icon: this.pkg.icon, }, actionInfo: { id: request.actionId, - metadata: - request.packageId === this.manifest.id - ? this.pkg.actions[request.actionId] - : this.allPkgs[request.packageId].actions[request.actionId], + metadata: this.pkg.actions[request.actionId], }, requestInfo: { request, - dependentId: - request.packageId === this.manifest.id ? undefined : this.manifest.id, }, }) } diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.html b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.html index 059dc208b..b64b0ee44 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.html +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.html @@ -30,4 +30,10 @@

{{ dep.actionText }} + diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.ts b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.ts index 3a2fee53b..318dcb2e1 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.ts +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.ts @@ -1,5 +1,10 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core' import { DependencyInfo } from '../../app-show.page' +import { T } from '@start9labs/start-sdk' +import { + PackageDataEntry, + StateInfo, +} from 'src/app/services/patch-db/data-model' @Component({ selector: 'app-show-dependencies', @@ -10,4 +15,15 @@ import { DependencyInfo } from '../../app-show.page' export class AppShowDependenciesComponent { @Input() dependencies: DependencyInfo[] = [] + + @Input() + allPkgs!: NonNullable< + T.AllPackageData & Record> + > + + @Input() + pkg!: T.PackageDataEntry & { stateInfo: StateInfo } + + @Input() + pkgId!: string } diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.html b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.html new file mode 100644 index 000000000..dc2e44d7c --- /dev/null +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.html @@ -0,0 +1,31 @@ + + + + +

{{ request.actionName }}

+

+ {{ request.reason || 'no reason provided' }} | + + {{ request.severity === 'critical' ? 'Required' : 'Requested' }} + +

+
+
+
diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.scss b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.scss new file mode 100644 index 000000000..e36eb20be --- /dev/null +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.scss @@ -0,0 +1,8 @@ +.highlighted { + color: var(--ion-color-dark); + font-weight: bold; +} + +.severity { + font-variant: 'all-small-caps'; +} \ No newline at end of file diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.ts b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.ts new file mode 100644 index 000000000..01e649a00 --- /dev/null +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.ts @@ -0,0 +1,71 @@ +import { ChangeDetectionStrategy, Component, Input } from '@angular/core' +import { T } from '@start9labs/start-sdk' +import { ActionService } from 'src/app/services/action.service' +import { getDepDetails } from 'src/app/util/dep-info' +import { DependencyInfo } from 'src/app/pages/apps-routes/app-show/app-show.page' + +@Component({ + selector: 'dep-action-requests', + templateUrl: './dep-action-requests.component.html', + styleUrls: ['./dep-action-requests.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class DepActionRequestsComponent { + @Input() + allPkgs!: Record + + @Input() + pkg!: T.PackageDataEntry + + @Input() + dep!: DependencyInfo + + @Input() + pkgId!: string + + get actionRequests() { + const reqs: { + [key: string]: (T.ActionRequest & { + actionName: string + })[] + } = {} + + Object.values(this.pkg.requestedActions) + .filter(r => r.active) + .forEach(r => { + const toReturn = { + ...r.request, + actionName: + this.allPkgs[r.request.packageId]?.actions[r.request.actionId] + .name || 'Unknown Action', + } + if (!reqs[r.request.packageId]) { + reqs[r.request.packageId] = [] + } + reqs[r.request.packageId].push(toReturn) + }) + + return reqs + } + + constructor(private readonly actionService: ActionService) {} + + async handleAction(request: T.ActionRequest) { + this.actionService.present({ + pkgInfo: { + id: request.packageId, + title: getDepDetails(this.pkg, this.allPkgs, request.packageId).title, + mainStatus: this.allPkgs[request.packageId].status.main, + icon: getDepDetails(this.pkg, this.allPkgs, request.packageId).icon, + }, + actionInfo: { + id: request.actionId, + metadata: this.allPkgs[request.packageId].actions[request.actionId], + }, + requestInfo: { + request, + dependentId: this.pkgId, + }, + }) + } +} diff --git a/web/projects/ui/src/app/services/api/api.fixures.ts b/web/projects/ui/src/app/services/api/api.fixures.ts index 8ca8864e2..6e3136577 100644 --- a/web/projects/ui/src/app/services/api/api.fixures.ts +++ b/web/projects/ui/src/app/services/api/api.fixures.ts @@ -1699,6 +1699,15 @@ export module Mock { hasInput: true, group: null, }, + rpc: { + name: 'Set RPC', + description: 'Create RPC Credentials', + warning: null, + visibility: 'enabled', + allowedStatuses: 'any', + hasInput: true, + group: null, + }, properties: { name: 'View Properties', description: 'view important information about Bitcoin', @@ -1997,7 +2006,26 @@ export module Mock { status: { main: 'stopped', }, - actions: {}, + actions: { + config: { + name: 'Config', + description: 'LND needs configuration before starting', + warning: null, + visibility: 'enabled', + allowedStatuses: 'any', + hasInput: true, + group: null, + }, + connect: { + name: 'Connect', + description: 'View LND connection details', + warning: null, + visibility: 'enabled', + allowedStatuses: 'any', + hasInput: true, + group: null, + }, + }, serviceInterfaces: { grpc: { id: 'grpc', @@ -2068,6 +2096,24 @@ export module Mock { registry: 'https://registry.start9.com/', developerKey: 'developer-key', requestedActions: { + config: { + active: true, + request: { + packageId: 'lnd', + actionId: 'config', + severity: 'critical', + reason: 'LND needs configuration before starting', + }, + }, + connect: { + active: true, + request: { + packageId: 'lnd', + actionId: 'connect', + severity: 'important', + reason: 'View LND connection details', + }, + }, 'bitcoind/config': { active: true, request: { @@ -2079,10 +2125,24 @@ export module Mock { kind: 'partial', value: { color: '#ffffff', + testnet: false, + }, + }, + }, + }, + 'bitcoind/rpc': { + active: true, + request: { + packageId: 'bitcoind', + actionId: 'rpc', + severity: 'important', + reason: `LND want's its own RPC credentials`, + input: { + kind: 'partial', + value: { rpcsettings: { rpcuser: 'lnd', }, - testnet: false, }, }, }, diff --git a/web/projects/ui/src/app/services/api/api.types.ts b/web/projects/ui/src/app/services/api/api.types.ts index db9b62add..4a1150c12 100644 --- a/web/projects/ui/src/app/services/api/api.types.ts +++ b/web/projects/ui/src/app/services/api/api.types.ts @@ -572,7 +572,7 @@ export type DependencyError = | DependencyErrorNotInstalled | DependencyErrorNotRunning | DependencyErrorIncorrectVersion - | DependencyErrorActionRequired + | DependencyErrorActionNeeded | DependencyErrorHealthChecksFailed | DependencyErrorTransitive @@ -590,8 +590,8 @@ export interface DependencyErrorIncorrectVersion { received: string // version } -export interface DependencyErrorActionRequired { - type: 'actionRequired' +export interface DependencyErrorActionNeeded { + type: 'actionNeeded' } export interface DependencyErrorHealthChecksFailed { diff --git a/web/projects/ui/src/app/services/api/mock-patch.ts b/web/projects/ui/src/app/services/api/mock-patch.ts index c843f8f5f..9a80967a1 100644 --- a/web/projects/ui/src/app/services/api/mock-patch.ts +++ b/web/projects/ui/src/app/services/api/mock-patch.ts @@ -232,6 +232,15 @@ export const mockPatchData: DataModel = { hasInput: true, group: null, }, + rpc: { + name: 'Set RPC', + description: 'Create RPC Credentials', + warning: null, + visibility: 'enabled', + allowedStatuses: 'any', + hasInput: true, + group: null, + }, properties: { name: 'View Properties', description: 'view important information about Bitcoin', @@ -487,7 +496,26 @@ export const mockPatchData: DataModel = { status: { main: 'stopped', }, - actions: {}, + actions: { + config: { + name: 'Config', + description: 'LND needs configuration before starting', + warning: null, + visibility: 'enabled', + allowedStatuses: 'any', + hasInput: true, + group: null, + }, + connect: { + name: 'Connect', + description: 'View LND connection details', + warning: null, + visibility: 'enabled', + allowedStatuses: 'any', + hasInput: true, + group: null, + }, + }, serviceInterfaces: { grpc: { id: 'grpc', @@ -559,6 +587,24 @@ export const mockPatchData: DataModel = { registry: 'https://registry.start9.com/', developerKey: 'developer-key', requestedActions: { + config: { + active: true, + request: { + packageId: 'lnd', + actionId: 'config', + severity: 'critical', + reason: 'LND needs configuration before starting', + }, + }, + connect: { + active: true, + request: { + packageId: 'lnd', + actionId: 'connect', + severity: 'important', + reason: 'View LND connection details', + }, + }, 'bitcoind/config': { active: true, request: { @@ -570,10 +616,24 @@ export const mockPatchData: DataModel = { kind: 'partial', value: { color: '#ffffff', + testnet: false, + }, + }, + }, + }, + 'bitcoind/rpc': { + active: true, + request: { + packageId: 'bitcoind', + actionId: 'rpc', + severity: 'important', + reason: `LND want's its own RPC credentials`, + input: { + kind: 'partial', + value: { rpcsettings: { rpcuser: 'lnd', }, - testnet: false, }, }, }, diff --git a/web/projects/ui/src/app/services/dep-error.service.ts b/web/projects/ui/src/app/services/dep-error.service.ts index cd15ebff6..dc9295e05 100644 --- a/web/projects/ui/src/app/services/dep-error.service.ts +++ b/web/projects/ui/src/app/services/dep-error.service.ts @@ -104,14 +104,11 @@ export class DepErrorService { // action required if ( Object.values(pkg.requestedActions).some( - a => - a.active && - a.request.packageId === depId && - a.request.severity === 'critical', + a => a.active && a.request.packageId === depId, ) ) { return { - type: 'actionRequired', + type: 'actionNeeded', } } From bfa7fbe1b7db20439ad3730bd6abb7b56f109513 Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:05:43 -0500 Subject: [PATCH 04/16] fix styling --- .../app-show-action-requests.component.scss | 4 ++ .../app-show-dependencies.component.html | 58 ++++++++++--------- .../app-show-dependencies.component.scss | 32 ++++++++++ .../dep-action-requests.component.html | 5 +- .../dep-action-requests.component.scss | 21 ++++++- 5 files changed, 91 insertions(+), 29 deletions(-) diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.scss b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.scss index f2b102bb1..f892ec9fe 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.scss +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.scss @@ -1,4 +1,8 @@ .highlighted { color: var(--ion-color-dark); font-weight: bold; +} + +ion-icon { + margin-right: 17px; } \ No newline at end of file diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.html b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.html index b64b0ee44..cffa7cb1d 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.html +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.html @@ -5,35 +5,39 @@ *ngFor="let dep of dependencies" (click)="dep.action()" > - - - - -

- - {{ dep.title }} -

-

{{ dep.version }}

-

- - {{ dep.errorText || 'satisfied' }} - -

-
+
+
+ + + + +

+ + {{ dep.title }} +

+

{{ dep.version }}

+

+ + {{ dep.errorText || 'satisfied' }} + +

+
+
+ +
{{ dep.actionText }} - diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.scss b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.scss index dd0cbe2b8..607090c96 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.scss +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.scss @@ -1,3 +1,35 @@ .icon { padding-right: 4px; } + +img { + position: relative; + z-index: 10; +} + +.container { + display: flex; + flex-direction: column; + margin: 8px; +} + +.dep-details { + display: flex; + align-items: center; + flex-direction: row; + gap: 1.2rem; +} + +:host ::ng-deep ion-item { + display: inline; + +} + +dep-action-requests { + margin-left: 41px; +} + +ion-label h2 { + display: flex; + align-items: center; +} \ No newline at end of file diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.html b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.html index dc2e44d7c..7601f366b 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.html +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.html @@ -1,5 +1,7 @@

{{ request.actionName }}

-

+

{{ request.reason || 'no reason provided' }} |

{{ request.actionName }}

@@ -23,7 +23,7 @@

{{ request.actionName }}

color: request.severity === 'critical' ? 'var(--ion-color-warning)' - : 'var(--ion-color-primary)' + : 'var(--ion-color-dark)' }" > {{ request.severity === 'critical' ? 'Required' : 'Requested' }} diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.scss b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.scss index d5c28fa8d..b046b70d5 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.scss +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.scss @@ -5,6 +5,8 @@ .severity { font-variant-caps: all-small-caps; + font-weight: bold; + letter-spacing: 0.2px; } .line { From 99e154c8f86aaf27cd1ef4641f99647b5247e347 Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:15:30 -0700 Subject: [PATCH 06/16] combine action requests into same component --- .../apps-routes/app-show/app-show.module.ts | 2 - .../apps-routes/app-show/app-show.page.html | 7 +- .../apps-routes/app-show/app-show.page.ts | 4 +- .../app-show-action-requests.component.html | 67 ++++++++--------- .../app-show-action-requests.component.scss | 34 ++++++++- .../app-show-action-requests.component.ts | 66 +++++++++++------ .../app-show-dependencies.component.html | 6 +- .../app-show-dependencies.component.scss | 9 --- .../app-show-dependencies.component.ts | 2 +- .../dep-action-requests.component.html | 34 --------- .../dep-action-requests.component.scss | 29 -------- .../dep-action-requests.component.ts | 71 ------------------- .../ui/src/app/services/api/api.types.ts | 6 +- .../ui/src/app/services/dep-error.service.ts | 7 +- 14 files changed, 132 insertions(+), 212 deletions(-) delete mode 100644 web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.html delete mode 100644 web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.scss delete mode 100644 web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.ts diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.module.ts b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.module.ts index bbfbbaeda..5787948d6 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.module.ts +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.module.ts @@ -20,7 +20,6 @@ import { AppShowHealthChecksComponent } from './components/app-show-health-check import { AppShowAdditionalComponent } from './components/app-show-additional/app-show-additional.component' import { AppShowErrorComponent } from './components/app-show-error/app-show-error.component' import { AppShowActionRequestsComponent } from './components/app-show-action-requests/app-show-action-requests.component' -import { DepActionRequestsComponent } from './components/app-show-dependencies/dep-action-requests/dep-action-requests.component' import { HealthColorPipe } from './pipes/health-color.pipe' import { ToHealthChecksPipe } from './pipes/to-health-checks.pipe' import { ToButtonsPipe } from './pipes/to-buttons.pipe' @@ -48,7 +47,6 @@ const routes: Routes = [ AppShowAdditionalComponent, AppShowErrorComponent, AppShowActionRequestsComponent, - DepActionRequestsComponent, ], imports: [ CommonModule, diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.html b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.html index e5a34972d..62811e702 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.html +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.html @@ -20,6 +20,11 @@ + + Action Requests + diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.ts b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.ts index 2b350f5b2..42b9d3c8a 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.ts +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.ts @@ -142,8 +142,8 @@ export class AppShowPage { errorText = 'Incorrect version' fixText = 'Update' fixAction = () => this.installDep(pkg, manifest, depId) - } else if (depError.type === 'actionNeeded') { - errorText = 'Action Needed (see below)' + } else if (depError.type === 'actionRequired') { + errorText = 'Action Required (see below)' } else if (depError.type === 'notRunning') { errorText = 'Not running' fixText = 'Start' diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.html b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.html index d1766b84c..20aa9f357 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.html +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.html @@ -1,33 +1,36 @@ - - Required Actions - - - -

{{ request.actionName }}

-

- {{ request.reason || 'no reason provided' }} -

-
-
-
- - - Requested Actions - - - -

{{ request.actionName }}

-

- {{ request.reason || 'no reason provided' }} -

-
-
+ +
+ + + +

{{ request.actionName }}

+

+ {{ request.reason || 'no reason provided' }} | + + {{ request.severity === 'critical' ? 'Required' : 'Requested' }} + +

+
+
+
diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.scss b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.scss index d67c2994f..affd5de11 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.scss +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.scss @@ -1,8 +1,38 @@ +ion-icon { + margin-right: 32px; +} + .highlighted { color: var(--ion-color-dark); font-weight: bold; } -ion-icon { - margin-right: 32px; +.severity { + font-variant-caps: all-small-caps; + font-weight: bold; + letter-spacing: 0.2px; + font-size: 16px; +} + +.line { + + &:after { + content: ''; + display: block; + border-left: 1px solid var(--border-color); + border-bottom: 1px solid var(--border-color); + height: 100%; + width: 24px; + position: absolute; + left: -20px; + top: -33px; + } +} + +.indent { + margin-left: 41px +} + +:host ::ng-deep ion-item { + display: inline; } \ No newline at end of file diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.ts b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.ts index 7c95c8412..f94cc986c 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.ts +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.ts @@ -1,6 +1,8 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core' import { T } from '@start9labs/start-sdk' import { ActionService } from 'src/app/services/action.service' +import { DependencyInfo } from 'src/app/pages/apps-routes/app-show/app-show.page' +import { getDepDetails } from 'src/app/util/dep-info' @Component({ selector: 'app-show-action-requests', @@ -18,48 +20,70 @@ export class AppShowActionRequestsComponent { @Input() manifest!: T.Manifest - get actionRequests() { - const critical: (T.ActionRequest & { - actionName: string - })[] = [] - const important: (T.ActionRequest & { - actionName: string - })[] = [] + @Input() + dep?: DependencyInfo + + pkgId!: string + + ngOnInit() { + this.pkgId = this.dep ? this.dep?.id : this.manifest.id + } + get actionRequests() { + const reqs: { + [key: string]: (T.ActionRequest & { + actionName: string + })[] + } = {} Object.values(this.pkg.requestedActions) - .filter(r => r.active && r.request.packageId === this.manifest.id) + .filter(r => r.active) .forEach(r => { + const self = r.request.packageId === this.manifest.id const toReturn = { ...r.request, - actionName: this.pkg.actions[r.request.actionId].name, + actionName: self + ? this.pkg.actions[r.request.actionId].name + : this.allPkgs[r.request.packageId]?.actions[r.request.actionId] + .name || 'Unknown Action', + dependency: self + ? null + : getDepDetails(this.pkg, this.allPkgs, r.request.packageId), } - - if (r.request.severity === 'critical') { - critical.push(toReturn) - } else { - important.push(toReturn) + if (!reqs[r.request.packageId]) { + reqs[r.request.packageId] = [] } + reqs[r.request.packageId].push(toReturn) }) - - return { critical, important } + return reqs } - constructor(private readonly actionService: ActionService) {} async handleAction(request: T.ActionRequest) { + const self = request.packageId === this.manifest.id this.actionService.present({ pkgInfo: { id: request.packageId, - title: this.manifest.title, - mainStatus: this.pkg.status.main, - icon: this.pkg.icon, + title: self + ? this.manifest.title + : getDepDetails(this.pkg, this.allPkgs, request.packageId).title, + mainStatus: self + ? this.pkg.status.main + : this.allPkgs[request.packageId].status.main, + icon: self + ? this.pkg.icon + : getDepDetails(this.pkg, this.allPkgs, request.packageId).icon, }, actionInfo: { id: request.actionId, - metadata: this.pkg.actions[request.actionId], + metadata: + request.packageId === this.manifest.id + ? this.pkg.actions[request.actionId] + : this.allPkgs[request.packageId].actions[request.actionId], }, requestInfo: { request, + dependentId: + request.packageId === this.manifest.id ? undefined : this.manifest.id, }, }) } diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.html b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.html index cffa7cb1d..3b96a5ac8 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.html +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.html @@ -29,12 +29,12 @@

- + [manifest]="manifest" + > {{ dep.actionText }} diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.scss b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.scss index 607090c96..80b1dad30 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.scss +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.scss @@ -20,15 +20,6 @@ img { gap: 1.2rem; } -:host ::ng-deep ion-item { - display: inline; - -} - -dep-action-requests { - margin-left: 41px; -} - ion-label h2 { display: flex; align-items: center; diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.ts b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.ts index 318dcb2e1..097aa06c2 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.ts +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/app-show-dependencies.component.ts @@ -25,5 +25,5 @@ export class AppShowDependenciesComponent { pkg!: T.PackageDataEntry & { stateInfo: StateInfo } @Input() - pkgId!: string + manifest!: T.Manifest } diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.html b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.html deleted file mode 100644 index 4177538de..000000000 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - -

{{ request.actionName }}

-

- {{ request.reason || 'no reason provided' }} | - - {{ request.severity === 'critical' ? 'Required' : 'Requested' }} - -

-
-
-
diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.scss b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.scss deleted file mode 100644 index b046b70d5..000000000 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.scss +++ /dev/null @@ -1,29 +0,0 @@ -.highlighted { - color: var(--ion-color-dark); - font-weight: bold; -} - -.severity { - font-variant-caps: all-small-caps; - font-weight: bold; - letter-spacing: 0.2px; -} - -.line { - - &:after { - content: ''; - display: block; - border-left: 1px solid var(--border-color); - border-bottom: 1px solid var(--border-color); - height: 100%; - width: 24px; - position: absolute; - left: -20px; - top: -33px; - } -} - -ion-icon { - margin-right: 17px; -} \ No newline at end of file diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.ts b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.ts deleted file mode 100644 index 01e649a00..000000000 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-dependencies/dep-action-requests/dep-action-requests.component.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core' -import { T } from '@start9labs/start-sdk' -import { ActionService } from 'src/app/services/action.service' -import { getDepDetails } from 'src/app/util/dep-info' -import { DependencyInfo } from 'src/app/pages/apps-routes/app-show/app-show.page' - -@Component({ - selector: 'dep-action-requests', - templateUrl: './dep-action-requests.component.html', - styleUrls: ['./dep-action-requests.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class DepActionRequestsComponent { - @Input() - allPkgs!: Record - - @Input() - pkg!: T.PackageDataEntry - - @Input() - dep!: DependencyInfo - - @Input() - pkgId!: string - - get actionRequests() { - const reqs: { - [key: string]: (T.ActionRequest & { - actionName: string - })[] - } = {} - - Object.values(this.pkg.requestedActions) - .filter(r => r.active) - .forEach(r => { - const toReturn = { - ...r.request, - actionName: - this.allPkgs[r.request.packageId]?.actions[r.request.actionId] - .name || 'Unknown Action', - } - if (!reqs[r.request.packageId]) { - reqs[r.request.packageId] = [] - } - reqs[r.request.packageId].push(toReturn) - }) - - return reqs - } - - constructor(private readonly actionService: ActionService) {} - - async handleAction(request: T.ActionRequest) { - this.actionService.present({ - pkgInfo: { - id: request.packageId, - title: getDepDetails(this.pkg, this.allPkgs, request.packageId).title, - mainStatus: this.allPkgs[request.packageId].status.main, - icon: getDepDetails(this.pkg, this.allPkgs, request.packageId).icon, - }, - actionInfo: { - id: request.actionId, - metadata: this.allPkgs[request.packageId].actions[request.actionId], - }, - requestInfo: { - request, - dependentId: this.pkgId, - }, - }) - } -} diff --git a/web/projects/ui/src/app/services/api/api.types.ts b/web/projects/ui/src/app/services/api/api.types.ts index 4a1150c12..db9b62add 100644 --- a/web/projects/ui/src/app/services/api/api.types.ts +++ b/web/projects/ui/src/app/services/api/api.types.ts @@ -572,7 +572,7 @@ export type DependencyError = | DependencyErrorNotInstalled | DependencyErrorNotRunning | DependencyErrorIncorrectVersion - | DependencyErrorActionNeeded + | DependencyErrorActionRequired | DependencyErrorHealthChecksFailed | DependencyErrorTransitive @@ -590,8 +590,8 @@ export interface DependencyErrorIncorrectVersion { received: string // version } -export interface DependencyErrorActionNeeded { - type: 'actionNeeded' +export interface DependencyErrorActionRequired { + type: 'actionRequired' } export interface DependencyErrorHealthChecksFailed { diff --git a/web/projects/ui/src/app/services/dep-error.service.ts b/web/projects/ui/src/app/services/dep-error.service.ts index dc9295e05..cd15ebff6 100644 --- a/web/projects/ui/src/app/services/dep-error.service.ts +++ b/web/projects/ui/src/app/services/dep-error.service.ts @@ -104,11 +104,14 @@ export class DepErrorService { // action required if ( Object.values(pkg.requestedActions).some( - a => a.active && a.request.packageId === depId, + a => + a.active && + a.request.packageId === depId && + a.request.severity === 'critical', ) ) { return { - type: 'actionNeeded', + type: 'actionRequired', } } From 8877c6964dbbd02f18b007fb3d993f9dcadc7905 Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Mon, 27 Jan 2025 15:12:41 -0700 Subject: [PATCH 07/16] only display actions header if they exist --- .../src/app/pages/apps-routes/app-show/app-show.page.html | 5 ----- .../app-show-action-requests.component.html | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.html b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.html index 62811e702..ef99965b5 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.html +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/app-show.page.html @@ -20,11 +20,6 @@ - - Action Requests - + + Action Requests +
Date: Mon, 27 Jan 2025 16:51:34 -0700 Subject: [PATCH 08/16] fix storing polyfill dependencies --- .../Systems/SystemForEmbassy/index.ts | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts index db839266e..311e4d878 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts @@ -51,6 +51,7 @@ function todo(): never { const MANIFEST_LOCATION = "/usr/lib/startos/package/embassyManifest.json" export const EMBASSY_JS_LOCATION = "/usr/lib/startos/package/embassy.js" const EMBASSY_POINTER_PATH_PREFIX = "/embassyConfig" as utils.StorePath +const DEPENDS_ON_PATH_PREFIX = "/dependsOn" as utils.StorePath const matchResult = object({ result: any, @@ -695,7 +696,12 @@ export class SystemForEmbassy implements System { effects: Effects, rawDepends: { [x: string]: readonly string[] }, ) { - const dependsOn: Record = { + const storedDependsOn = (await effects.store.get({ + packageId: this.manifest.id, + path: DEPENDS_ON_PATH_PREFIX, + })) as Record + + const dependsOn: Record = storedDependsOn ? storedDependsOn : { ...Object.fromEntries( Object.entries(this.manifest.dependencies || {})?.map((x) => [ x[0], @@ -704,6 +710,12 @@ export class SystemForEmbassy implements System { ), ...rawDepends, } + + await effects.store.set({ + path: DEPENDS_ON_PATH_PREFIX, + value: dependsOn, + }) + await effects.setDependencies({ dependencies: Object.entries(dependsOn).flatMap( ([key, value]): T.Dependencies => { @@ -722,17 +734,6 @@ export class SystemForEmbassy implements System { }, ] } - // current dep since default in config - if (dependency.requirement.type === "opt-out") { - return [ - { - id: key, - versionRange, - kind: "exists", - }, - ] - } - // if opt-in, not a current dep, only changed through config return [] } // if from rawDepends (ie. config) From 36380783a084c9d8c2211ff3e751650576638127 Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Mon, 27 Jan 2025 16:52:12 -0700 Subject: [PATCH 09/16] fix styling and button propagation --- .../app-show-action-requests.component.html | 2 +- .../app-show-action-requests.component.scss | 3 ++- .../app-show-action-requests.component.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.html b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.html index 7c17d4227..2ee3d6698 100644 --- a/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.html +++ b/web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-action-requests/app-show-action-requests.component.html @@ -11,7 +11,7 @@ lines="none" *ngFor="let request of actionRequests[pkgId]" button - (click)="handleAction(request)" + (click)="handleAction(request, $event)" > Date: Mon, 27 Jan 2025 17:15:19 -0700 Subject: [PATCH 10/16] fixes for setting polyfill dependencies --- .../Systems/SystemForEmbassy/index.ts | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts index 311e4d878..ba7dffdda 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts @@ -51,7 +51,7 @@ function todo(): never { const MANIFEST_LOCATION = "/usr/lib/startos/package/embassyManifest.json" export const EMBASSY_JS_LOCATION = "/usr/lib/startos/package/embassy.js" const EMBASSY_POINTER_PATH_PREFIX = "/embassyConfig" as utils.StorePath -const DEPENDS_ON_PATH_PREFIX = "/dependsOn" as utils.StorePath +const EMBASSY_DEPENDS_ON_PATH_PREFIX = "/embassyDependsOn" as utils.StorePath const matchResult = object({ result: any, @@ -698,21 +698,21 @@ export class SystemForEmbassy implements System { ) { const storedDependsOn = (await effects.store.get({ packageId: this.manifest.id, - path: DEPENDS_ON_PATH_PREFIX, - })) as Record + path: EMBASSY_DEPENDS_ON_PATH_PREFIX, + })) as Record - const dependsOn: Record = storedDependsOn ? storedDependsOn : { + const dependsOn: Record = storedDependsOn ? storedDependsOn : { ...Object.fromEntries( - Object.entries(this.manifest.dependencies || {})?.map((x) => [ + Object.entries(this.manifest.dependencies || {})?.filter(x => x[1].requirement.type === "required").map((x) => [ x[0], - null, + [], ]) || [], ), ...rawDepends, } await effects.store.set({ - path: DEPENDS_ON_PATH_PREFIX, + path: EMBASSY_DEPENDS_ON_PATH_PREFIX, value: dependsOn, }) @@ -721,22 +721,6 @@ export class SystemForEmbassy implements System { ([key, value]): T.Dependencies => { const dependency = this.manifest.dependencies?.[key] if (!dependency) return [] - // if from manifest.dependencies - if (value == null) { - const versionRange = dependency.version - if (dependency.requirement.type === "required") { - return [ - { - id: key, - versionRange, - kind: "running", - healthChecks: [], - }, - ] - } - return [] - } - // if from rawDepends (ie. config) const versionRange = dependency.version const kind = "running" return [ From 7ab51a76927fa9b955bd30b9d38b24e9e84a3cf7 Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Tue, 28 Jan 2025 17:53:25 -0700 Subject: [PATCH 11/16] revert to test --- container-runtime/package-lock.json | 10 +++---- .../Systems/SystemForEmbassy/index.ts | 26 ++++++++++++++++--- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/container-runtime/package-lock.json b/container-runtime/package-lock.json index 2ff4bb8c6..097c3ccb7 100644 --- a/container-runtime/package-lock.json +++ b/container-runtime/package-lock.json @@ -64,7 +64,7 @@ }, "../sdk/dist": { "name": "@start9labs/start-sdk", - "version": "0.3.6-alpha8", + "version": "0.3.6-beta.4", "license": "MIT", "dependencies": { "@iarna/toml": "^2.2.5", @@ -72,8 +72,8 @@ "@noble/hashes": "^1.4.0", "isomorphic-fetch": "^3.0.0", "lodash.merge": "^4.6.2", - "mime": "^4.0.3", - "ts-matches": "^5.5.1", + "mime-types": "^2.1.35", + "ts-matches": "^6.2.1", "yaml": "^2.2.2" }, "devDependencies": { @@ -6799,11 +6799,11 @@ "isomorphic-fetch": "^3.0.0", "jest": "^29.4.3", "lodash.merge": "^4.6.2", - "mime": "^4.0.3", + "mime-types": "^2.1.35", "peggy": "^3.0.2", "prettier": "^3.2.5", "ts-jest": "^29.0.5", - "ts-matches": "^5.5.1", + "ts-matches": "^6.2.1", "ts-node": "^10.9.1", "ts-pegjs": "^4.2.1", "tsx": "^4.7.1", diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts index ba7dffdda..3438fccdf 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts @@ -701,11 +701,11 @@ export class SystemForEmbassy implements System { path: EMBASSY_DEPENDS_ON_PATH_PREFIX, })) as Record - const dependsOn: Record = storedDependsOn ? storedDependsOn : { + const dependsOn: Record = storedDependsOn ? storedDependsOn : { ...Object.fromEntries( - Object.entries(this.manifest.dependencies || {})?.filter(x => x[1].requirement.type === "required").map((x) => [ + Object.entries(this.manifest.dependencies || {})?.map((x) => [ x[0], - [], + null, ]) || [], ), ...rawDepends, @@ -721,6 +721,26 @@ export class SystemForEmbassy implements System { ([key, value]): T.Dependencies => { const dependency = this.manifest.dependencies?.[key] if (!dependency) return [] + if (value == null) { + const versionRange = dependency.version + if (dependency.requirement.type === "required") { + return [ + { + id: key, + versionRange, + kind: "running", + healthChecks: [], + }, + ] + } + return [ + { + kind: "exists", + id: key, + versionRange, + }, + ] + } const versionRange = dependency.version const kind = "running" return [ From 9f404022bc52e78ac8a37e20118f3a03ddb7258a Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Wed, 5 Feb 2025 15:55:56 -0500 Subject: [PATCH 12/16] revert required deps setting logic --- .../src/Adapters/Systems/SystemForEmbassy/index.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts index 3438fccdf..add6a1f69 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts @@ -733,13 +733,7 @@ export class SystemForEmbassy implements System { }, ] } - return [ - { - kind: "exists", - id: key, - versionRange, - }, - ] + return [] } const versionRange = dependency.version const kind = "running" From 4c72b4b973cc587f0739ca0d0e77d37c54c1930c Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Thu, 6 Feb 2025 15:00:29 -0500 Subject: [PATCH 13/16] add logs and adjust logic --- .../src/Adapters/Systems/SystemForEmbassy/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts index add6a1f69..c0cd9bca7 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts @@ -315,6 +315,7 @@ export class SystemForEmbassy implements System { ) .catch(() => []), ) + console.log(`***DEPS IN CONTAINER SET***\n${oldDeps}`) await this.setDependencies(effects, oldDeps) } @@ -688,6 +689,7 @@ export class SystemForEmbassy implements System { }), ) const dependsOn = answer["depends-on"] ?? answer.dependsOn ?? {} + console.log(`***DEPENDS ON POST CONFIG *** \n${dependsOn}`) await this.setDependencies(effects, dependsOn) return } @@ -696,12 +698,13 @@ export class SystemForEmbassy implements System { effects: Effects, rawDepends: { [x: string]: readonly string[] }, ) { + console.log(`***RAW DEPENDS*** \n${rawDepends}`) const storedDependsOn = (await effects.store.get({ packageId: this.manifest.id, path: EMBASSY_DEPENDS_ON_PATH_PREFIX, })) as Record - const dependsOn: Record = storedDependsOn ? storedDependsOn : { + const dependsOn: Record = storedDependsOn ? { ...storedDependsOn, ...rawDepends } : { ...Object.fromEntries( Object.entries(this.manifest.dependencies || {})?.map((x) => [ x[0], @@ -711,6 +714,8 @@ export class SystemForEmbassy implements System { ...rawDepends, } + console.log(`***DEPENDS ON*** \n${dependsOn}`) + await effects.store.set({ path: EMBASSY_DEPENDS_ON_PATH_PREFIX, value: dependsOn, From 8c5d33747d285bab126b115cf9d192dcd956f6ae Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Thu, 6 Feb 2025 20:16:03 -0500 Subject: [PATCH 14/16] test --- .../Systems/SystemForEmbassy/index.ts | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts index c0cd9bca7..a476206ab 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts @@ -315,7 +315,7 @@ export class SystemForEmbassy implements System { ) .catch(() => []), ) - console.log(`***DEPS IN CONTAINER SET***\n${oldDeps}`) + console.log(`***DEPS IN CONTAINER SET***\n`, oldDeps) await this.setDependencies(effects, oldDeps) } @@ -689,7 +689,7 @@ export class SystemForEmbassy implements System { }), ) const dependsOn = answer["depends-on"] ?? answer.dependsOn ?? {} - console.log(`***DEPENDS ON POST CONFIG *** \n${dependsOn}`) + console.log(`***DEPENDS ON POST CONFIG *** \n`, dependsOn) await this.setDependencies(effects, dependsOn) return } @@ -698,23 +698,25 @@ export class SystemForEmbassy implements System { effects: Effects, rawDepends: { [x: string]: readonly string[] }, ) { - console.log(`***RAW DEPENDS*** \n${rawDepends}`) + console.log(`***RAW DEPENDS*** \n`, rawDepends) const storedDependsOn = (await effects.store.get({ packageId: this.manifest.id, path: EMBASSY_DEPENDS_ON_PATH_PREFIX, })) as Record - const dependsOn: Record = storedDependsOn ? { ...storedDependsOn, ...rawDepends } : { - ...Object.fromEntries( - Object.entries(this.manifest.dependencies || {})?.map((x) => [ - x[0], - null, - ]) || [], - ), - ...rawDepends, - } + const dependsOn: Record = storedDependsOn + ? { ...storedDependsOn, ...rawDepends } + : { + ...Object.fromEntries( + Object.entries(this.manifest.dependencies || {})?.filter(x => x[1].requirement.type === "required").map((x) => [ + x[0], + null, + ]) || [], + ), + ...rawDepends, + } - console.log(`***DEPENDS ON*** \n${dependsOn}`) + console.log(`***DEPENDS ON*** \n`, dependsOn) await effects.store.set({ path: EMBASSY_DEPENDS_ON_PATH_PREFIX, From afb6395d2c1107b1837d3575744af2b72f826fc8 Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Fri, 7 Feb 2025 10:26:06 -0500 Subject: [PATCH 15/16] fix deps logic when changing config --- .../Systems/SystemForEmbassy/index.ts | 44 ++++++++----------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts index a476206ab..5e5802a22 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts @@ -316,7 +316,7 @@ export class SystemForEmbassy implements System { .catch(() => []), ) console.log(`***DEPS IN CONTAINER SET***\n`, oldDeps) - await this.setDependencies(effects, oldDeps) + await this.setDependencies(effects, oldDeps, false) } async exit(): Promise { @@ -666,7 +666,7 @@ export class SystemForEmbassy implements System { ), ) const dependsOn = answer["depends-on"] ?? answer.dependsOn ?? {} - await this.setDependencies(effects, dependsOn) + await this.setDependencies(effects, dependsOn, true) return } else if (setConfigValue.type === "script") { const moduleCode = await this.moduleCode @@ -690,13 +690,14 @@ export class SystemForEmbassy implements System { ) const dependsOn = answer["depends-on"] ?? answer.dependsOn ?? {} console.log(`***DEPENDS ON POST CONFIG *** \n`, dependsOn) - await this.setDependencies(effects, dependsOn) + await this.setDependencies(effects, dependsOn, true) return } } private async setDependencies( effects: Effects, rawDepends: { [x: string]: readonly string[] }, + configuring: boolean, ) { console.log(`***RAW DEPENDS*** \n`, rawDepends) const storedDependsOn = (await effects.store.get({ @@ -704,17 +705,22 @@ export class SystemForEmbassy implements System { path: EMBASSY_DEPENDS_ON_PATH_PREFIX, })) as Record - const dependsOn: Record = storedDependsOn - ? { ...storedDependsOn, ...rawDepends } - : { - ...Object.fromEntries( - Object.entries(this.manifest.dependencies || {})?.filter(x => x[1].requirement.type === "required").map((x) => [ - x[0], - null, - ]) || [], - ), + const requiredDeps = { + ...Object.fromEntries( + Object.entries(this.manifest.dependencies || {}) + ?.filter((x) => x[1].requirement.type === "required") + .map((x) => [x[0], []]) || [], + ), + } + + const dependsOn: Record = configuring + ? { + ...requiredDeps, ...rawDepends, } + : storedDependsOn + ? storedDependsOn + : requiredDeps console.log(`***DEPENDS ON*** \n`, dependsOn) @@ -728,20 +734,6 @@ export class SystemForEmbassy implements System { ([key, value]): T.Dependencies => { const dependency = this.manifest.dependencies?.[key] if (!dependency) return [] - if (value == null) { - const versionRange = dependency.version - if (dependency.requirement.type === "required") { - return [ - { - id: key, - versionRange, - kind: "running", - healthChecks: [], - }, - ] - } - return [] - } const versionRange = dependency.version const kind = "running" return [ From 9ddae42da428c534db1c6b9fd5e8845395422d31 Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Fri, 7 Feb 2025 15:46:51 -0500 Subject: [PATCH 16/16] remove logs; deps working as expected --- .../src/Adapters/Systems/SystemForEmbassy/index.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts index 5e5802a22..2b32afd85 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts @@ -315,7 +315,6 @@ export class SystemForEmbassy implements System { ) .catch(() => []), ) - console.log(`***DEPS IN CONTAINER SET***\n`, oldDeps) await this.setDependencies(effects, oldDeps, false) } @@ -689,7 +688,6 @@ export class SystemForEmbassy implements System { }), ) const dependsOn = answer["depends-on"] ?? answer.dependsOn ?? {} - console.log(`***DEPENDS ON POST CONFIG *** \n`, dependsOn) await this.setDependencies(effects, dependsOn, true) return } @@ -699,7 +697,6 @@ export class SystemForEmbassy implements System { rawDepends: { [x: string]: readonly string[] }, configuring: boolean, ) { - console.log(`***RAW DEPENDS*** \n`, rawDepends) const storedDependsOn = (await effects.store.get({ packageId: this.manifest.id, path: EMBASSY_DEPENDS_ON_PATH_PREFIX, @@ -722,8 +719,6 @@ export class SystemForEmbassy implements System { ? storedDependsOn : requiredDeps - console.log(`***DEPENDS ON*** \n`, dependsOn) - await effects.store.set({ path: EMBASSY_DEPENDS_ON_PATH_PREFIX, value: dependsOn,