@shipfox/client-workspace-settings 3.0.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +30 -0
- package/dist/components/members/workspace-members-section.d.ts.map +1 -1
- package/dist/components/members/workspace-members-section.js +4 -4
- package/dist/components/members/workspace-members-section.js.map +1 -1
- package/dist/core/invitation.d.ts +15 -0
- package/dist/core/invitation.d.ts.map +1 -0
- package/dist/core/invitation.js +3 -0
- package/dist/core/invitation.js.map +1 -0
- package/dist/feature.d.ts +0 -70
- package/dist/feature.d.ts.map +1 -1
- package/dist/feature.js +0 -84
- package/dist/feature.js.map +1 -1
- package/dist/hooks/api/create-invitation.d.ts +2 -13
- package/dist/hooks/api/create-invitation.d.ts.map +1 -1
- package/dist/hooks/api/create-invitation.js +12 -9
- package/dist/hooks/api/create-invitation.js.map +1 -1
- package/dist/hooks/api/invitation-mapper.d.ts +4 -0
- package/dist/hooks/api/invitation-mapper.d.ts.map +1 -0
- package/dist/hooks/api/invitation-mapper.js +15 -0
- package/dist/hooks/api/invitation-mapper.js.map +1 -0
- package/dist/hooks/api/list-invitations.d.ts +10 -13
- package/dist/hooks/api/list-invitations.d.ts.map +1 -1
- package/dist/hooks/api/list-invitations.js +11 -5
- package/dist/hooks/api/list-invitations.js.map +1 -1
- package/dist/hooks/api/revoke-invitation.js +2 -4
- package/dist/hooks/api/revoke-invitation.js.map +1 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +5 -30
- package/src/components/members/workspace-members-section.tsx +6 -11
- package/src/core/invitation.ts +15 -0
- package/src/feature.ts +0 -84
- package/src/hooks/api/create-invitation.ts +20 -10
- package/src/hooks/api/invitation-mapper.test.ts +29 -0
- package/src/hooks/api/invitation-mapper.ts +16 -0
- package/src/hooks/api/list-invitations.ts +17 -7
- package/src/hooks/api/revoke-invitation.ts +2 -2
- package/src/index.ts +0 -7
- package/test/pages.tsx +1 -5
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/pages/events-settings-page.d.ts +0 -2
- package/dist/pages/events-settings-page.d.ts.map +0 -1
- package/dist/pages/events-settings-page.js +0 -30
- package/dist/pages/events-settings-page.js.map +0 -1
- package/dist/pages/integrations-settings-page.d.ts +0 -2
- package/dist/pages/integrations-settings-page.d.ts.map +0 -1
- package/dist/pages/integrations-settings-page.js +0 -10
- package/dist/pages/integrations-settings-page.js.map +0 -1
- package/dist/pages/model-providers-settings-page.d.ts +0 -2
- package/dist/pages/model-providers-settings-page.d.ts.map +0 -1
- package/dist/pages/model-providers-settings-page.js +0 -20
- package/dist/pages/model-providers-settings-page.js.map +0 -1
- package/dist/pages/provisioners-settings-page.d.ts +0 -2
- package/dist/pages/provisioners-settings-page.d.ts.map +0 -1
- package/dist/pages/provisioners-settings-page.js +0 -14
- package/dist/pages/provisioners-settings-page.js.map +0 -1
- package/dist/pages/runners-settings-page.d.ts +0 -2
- package/dist/pages/runners-settings-page.d.ts.map +0 -1
- package/dist/pages/runners-settings-page.js +0 -14
- package/dist/pages/runners-settings-page.js.map +0 -1
- package/dist/pages/secrets-settings-page.d.ts +0 -2
- package/dist/pages/secrets-settings-page.d.ts.map +0 -1
- package/dist/pages/secrets-settings-page.js +0 -14
- package/dist/pages/secrets-settings-page.js.map +0 -1
- package/dist/pages/variables-settings-page.d.ts +0 -2
- package/dist/pages/variables-settings-page.d.ts.map +0 -1
- package/dist/pages/variables-settings-page.js +0 -14
- package/dist/pages/variables-settings-page.js.map +0 -1
- package/dist/routes/agents.d.ts +0 -6
- package/dist/routes/agents.d.ts.map +0 -1
- package/dist/routes/agents.js +0 -7
- package/dist/routes/agents.js.map +0 -1
- package/dist/routes/events.d.ts +0 -8
- package/dist/routes/events.d.ts.map +0 -1
- package/dist/routes/events.js +0 -9
- package/dist/routes/events.js.map +0 -1
- package/dist/routes/integrations.d.ts +0 -6
- package/dist/routes/integrations.d.ts.map +0 -1
- package/dist/routes/integrations.js +0 -7
- package/dist/routes/integrations.js.map +0 -1
- package/dist/routes/provisioners.d.ts +0 -6
- package/dist/routes/provisioners.d.ts.map +0 -1
- package/dist/routes/provisioners.js +0 -7
- package/dist/routes/provisioners.js.map +0 -1
- package/dist/routes/runners.d.ts +0 -6
- package/dist/routes/runners.d.ts.map +0 -1
- package/dist/routes/runners.js +0 -7
- package/dist/routes/runners.js.map +0 -1
- package/dist/routes/secrets.d.ts +0 -6
- package/dist/routes/secrets.d.ts.map +0 -1
- package/dist/routes/secrets.js +0 -7
- package/dist/routes/secrets.js.map +0 -1
- package/dist/routes/variables.d.ts +0 -6
- package/dist/routes/variables.d.ts.map +0 -1
- package/dist/routes/variables.js +0 -7
- package/dist/routes/variables.js.map +0 -1
- package/src/pages/events-settings-page.tsx +0 -25
- package/src/pages/integrations-settings-page.test.tsx +0 -72
- package/src/pages/integrations-settings-page.tsx +0 -6
- package/src/pages/model-providers-settings-page.test.tsx +0 -48
- package/src/pages/model-providers-settings-page.tsx +0 -15
- package/src/pages/provisioners-settings-page.test.tsx +0 -29
- package/src/pages/provisioners-settings-page.tsx +0 -14
- package/src/pages/runners-settings-page.test.tsx +0 -23
- package/src/pages/runners-settings-page.tsx +0 -14
- package/src/pages/secrets-settings-page.tsx +0 -14
- package/src/pages/variables-settings-page.tsx +0 -14
- package/src/routes/agents.tsx +0 -3
- package/src/routes/events.tsx +0 -7
- package/src/routes/integrations.tsx +0 -3
- package/src/routes/provisioners.tsx +0 -3
- package/src/routes/runners.tsx +0 -3
- package/src/routes/secrets.tsx +0 -3
- package/src/routes/variables.tsx +0 -3
- package/test/typecheck/route-ids.tsx +0 -7
- package/test/typecheck/settings-composition.tsx +0 -95
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events-settings-page.d.ts","sourceRoot":"","sources":["../../src/pages/events-settings-page.tsx"],"names":[],"mappings":"AAMA,wBAAgB,kBAAkB,gCAkBjC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { EventsPage } from '@shipfox/client-triggers';
|
|
3
|
-
import { getRouteApi } from '@tanstack/react-router';
|
|
4
|
-
import { WorkspaceSettingsShell } from '#components/workspace-settings-shell.js';
|
|
5
|
-
const routeApi = getRouteApi('/workspaces/$wid/settings/events');
|
|
6
|
-
export function EventsSettingsPage() {
|
|
7
|
-
const search = routeApi.useSearch();
|
|
8
|
-
const navigate = routeApi.useNavigate();
|
|
9
|
-
// Merge the patch into the current URL search. Undefined values drop their key, so
|
|
10
|
-
// clearing a filter removes it from the URL. `replace` keeps filter tweaks off the
|
|
11
|
-
// back stack.
|
|
12
|
-
const onFiltersChange = (patch)=>{
|
|
13
|
-
void navigate({
|
|
14
|
-
search: {
|
|
15
|
-
...search,
|
|
16
|
-
...patch
|
|
17
|
-
},
|
|
18
|
-
replace: true
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
return /*#__PURE__*/ _jsx(WorkspaceSettingsShell, {
|
|
22
|
-
children: (workspace)=>/*#__PURE__*/ _jsx(EventsPage, {
|
|
23
|
-
workspaceId: workspace.id,
|
|
24
|
-
filters: search,
|
|
25
|
-
onFiltersChange: onFiltersChange
|
|
26
|
-
})
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=events-settings-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/events-settings-page.tsx"],"sourcesContent":["import {EventsPage, type TriggerEventFilters} from '@shipfox/client-triggers';\nimport {getRouteApi} from '@tanstack/react-router';\nimport {WorkspaceSettingsShell} from '#components/workspace-settings-shell.js';\n\nconst routeApi = getRouteApi('/workspaces/$wid/settings/events');\n\nexport function EventsSettingsPage() {\n const search = routeApi.useSearch();\n const navigate = routeApi.useNavigate();\n\n // Merge the patch into the current URL search. Undefined values drop their key, so\n // clearing a filter removes it from the URL. `replace` keeps filter tweaks off the\n // back stack.\n const onFiltersChange = (patch: Partial<TriggerEventFilters>) => {\n void navigate({search: {...search, ...patch}, replace: true});\n };\n\n return (\n <WorkspaceSettingsShell>\n {(workspace) => (\n <EventsPage workspaceId={workspace.id} filters={search} onFiltersChange={onFiltersChange} />\n )}\n </WorkspaceSettingsShell>\n );\n}\n"],"names":["EventsPage","getRouteApi","WorkspaceSettingsShell","routeApi","EventsSettingsPage","search","useSearch","navigate","useNavigate","onFiltersChange","patch","replace","workspace","workspaceId","id","filters"],"mappings":";AAAA,SAAQA,UAAU,QAAiC,2BAA2B;AAC9E,SAAQC,WAAW,QAAO,yBAAyB;AACnD,SAAQC,sBAAsB,QAAO,0CAA0C;AAE/E,MAAMC,WAAWF,YAAY;AAE7B,OAAO,SAASG;IACd,MAAMC,SAASF,SAASG,SAAS;IACjC,MAAMC,WAAWJ,SAASK,WAAW;IAErC,mFAAmF;IACnF,mFAAmF;IACnF,cAAc;IACd,MAAMC,kBAAkB,CAACC;QACvB,KAAKH,SAAS;YAACF,QAAQ;gBAAC,GAAGA,MAAM;gBAAE,GAAGK,KAAK;YAAA;YAAGC,SAAS;QAAI;IAC7D;IAEA,qBACE,KAACT;kBACE,CAACU,0BACA,KAACZ;gBAAWa,aAAaD,UAAUE,EAAE;gBAAEC,SAASV;gBAAQI,iBAAiBA;;;AAIjF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integrations-settings-page.d.ts","sourceRoot":"","sources":["../../src/pages/integrations-settings-page.tsx"],"names":[],"mappings":"AAGA,wBAAgB,wBAAwB,gCAEvC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { IntegrationGallery } from '@shipfox/client-integrations';
|
|
3
|
-
import { WorkspaceSettingsShell } from '#components/workspace-settings-shell.js';
|
|
4
|
-
export function IntegrationsSettingsPage() {
|
|
5
|
-
return /*#__PURE__*/ _jsx(WorkspaceSettingsShell, {
|
|
6
|
-
children: ()=>/*#__PURE__*/ _jsx(IntegrationGallery, {})
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=integrations-settings-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/integrations-settings-page.tsx"],"sourcesContent":["import {IntegrationGallery} from '@shipfox/client-integrations';\nimport {WorkspaceSettingsShell} from '#components/workspace-settings-shell.js';\n\nexport function IntegrationsSettingsPage() {\n return <WorkspaceSettingsShell>{() => <IntegrationGallery />}</WorkspaceSettingsShell>;\n}\n"],"names":["IntegrationGallery","WorkspaceSettingsShell","IntegrationsSettingsPage"],"mappings":";AAAA,SAAQA,kBAAkB,QAAO,+BAA+B;AAChE,SAAQC,sBAAsB,QAAO,0CAA0C;AAE/E,OAAO,SAASC;IACd,qBAAO,KAACD;kBAAwB,kBAAM,KAACD;;AACzC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model-providers-settings-page.d.ts","sourceRoot":"","sources":["../../src/pages/model-providers-settings-page.tsx"],"names":[],"mappings":"AAGA,wBAAgB,0BAA0B,gCAWzC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { WorkspaceHarnessesSection, WorkspaceModelProvidersSection } from '@shipfox/client-agent';
|
|
3
|
-
import { WorkspaceSettingsShell } from '#components/workspace-settings-shell.js';
|
|
4
|
-
export function ModelProvidersSettingsPage() {
|
|
5
|
-
return /*#__PURE__*/ _jsx(WorkspaceSettingsShell, {
|
|
6
|
-
children: (workspace)=>/*#__PURE__*/ _jsxs("div", {
|
|
7
|
-
className: "flex flex-col gap-32",
|
|
8
|
-
children: [
|
|
9
|
-
/*#__PURE__*/ _jsx(WorkspaceHarnessesSection, {
|
|
10
|
-
workspaceId: workspace.id
|
|
11
|
-
}),
|
|
12
|
-
/*#__PURE__*/ _jsx(WorkspaceModelProvidersSection, {
|
|
13
|
-
workspaceId: workspace.id
|
|
14
|
-
})
|
|
15
|
-
]
|
|
16
|
-
})
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=model-providers-settings-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/model-providers-settings-page.tsx"],"sourcesContent":["import {WorkspaceHarnessesSection, WorkspaceModelProvidersSection} from '@shipfox/client-agent';\nimport {WorkspaceSettingsShell} from '#components/workspace-settings-shell.js';\n\nexport function ModelProvidersSettingsPage() {\n return (\n <WorkspaceSettingsShell>\n {(workspace) => (\n <div className=\"flex flex-col gap-32\">\n <WorkspaceHarnessesSection workspaceId={workspace.id} />\n <WorkspaceModelProvidersSection workspaceId={workspace.id} />\n </div>\n )}\n </WorkspaceSettingsShell>\n );\n}\n"],"names":["WorkspaceHarnessesSection","WorkspaceModelProvidersSection","WorkspaceSettingsShell","ModelProvidersSettingsPage","workspace","div","className","workspaceId","id"],"mappings":";AAAA,SAAQA,yBAAyB,EAAEC,8BAA8B,QAAO,wBAAwB;AAChG,SAAQC,sBAAsB,QAAO,0CAA0C;AAE/E,OAAO,SAASC;IACd,qBACE,KAACD;kBACE,CAACE,0BACA,MAACC;gBAAIC,WAAU;;kCACb,KAACN;wBAA0BO,aAAaH,UAAUI,EAAE;;kCACpD,KAACP;wBAA+BM,aAAaH,UAAUI,EAAE;;;;;AAKnE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provisioners-settings-page.d.ts","sourceRoot":"","sources":["../../src/pages/provisioners-settings-page.tsx"],"names":[],"mappings":"AAGA,wBAAgB,wBAAwB,gCAUvC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { WorkspaceProvisionerTokensSettingsSection } from '@shipfox/client-runners';
|
|
3
|
-
import { WorkspaceSettingsShell } from '#components/workspace-settings-shell.js';
|
|
4
|
-
export function ProvisionersSettingsPage() {
|
|
5
|
-
return /*#__PURE__*/ _jsx(WorkspaceSettingsShell, {
|
|
6
|
-
children: (workspace)=>/*#__PURE__*/ _jsx("div", {
|
|
7
|
-
children: /*#__PURE__*/ _jsx(WorkspaceProvisionerTokensSettingsSection, {
|
|
8
|
-
workspaceId: workspace.id
|
|
9
|
-
})
|
|
10
|
-
})
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=provisioners-settings-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/provisioners-settings-page.tsx"],"sourcesContent":["import {WorkspaceProvisionerTokensSettingsSection} from '@shipfox/client-runners';\nimport {WorkspaceSettingsShell} from '#components/workspace-settings-shell.js';\n\nexport function ProvisionersSettingsPage() {\n return (\n <WorkspaceSettingsShell>\n {(workspace) => (\n <div>\n <WorkspaceProvisionerTokensSettingsSection workspaceId={workspace.id} />\n </div>\n )}\n </WorkspaceSettingsShell>\n );\n}\n"],"names":["WorkspaceProvisionerTokensSettingsSection","WorkspaceSettingsShell","ProvisionersSettingsPage","workspace","div","workspaceId","id"],"mappings":";AAAA,SAAQA,yCAAyC,QAAO,0BAA0B;AAClF,SAAQC,sBAAsB,QAAO,0CAA0C;AAE/E,OAAO,SAASC;IACd,qBACE,KAACD;kBACE,CAACE,0BACA,KAACC;0BACC,cAAA,KAACJ;oBAA0CK,aAAaF,UAAUG,EAAE;;;;AAK9E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runners-settings-page.d.ts","sourceRoot":"","sources":["../../src/pages/runners-settings-page.tsx"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,gCAUlC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { WorkspaceManualRegistrationTokensSettingsSection } from '@shipfox/client-runners';
|
|
3
|
-
import { WorkspaceSettingsShell } from '#components/workspace-settings-shell.js';
|
|
4
|
-
export function RunnersSettingsPage() {
|
|
5
|
-
return /*#__PURE__*/ _jsx(WorkspaceSettingsShell, {
|
|
6
|
-
children: (workspace)=>/*#__PURE__*/ _jsx("div", {
|
|
7
|
-
children: /*#__PURE__*/ _jsx(WorkspaceManualRegistrationTokensSettingsSection, {
|
|
8
|
-
workspaceId: workspace.id
|
|
9
|
-
})
|
|
10
|
-
})
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=runners-settings-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/runners-settings-page.tsx"],"sourcesContent":["import {WorkspaceManualRegistrationTokensSettingsSection} from '@shipfox/client-runners';\nimport {WorkspaceSettingsShell} from '#components/workspace-settings-shell.js';\n\nexport function RunnersSettingsPage() {\n return (\n <WorkspaceSettingsShell>\n {(workspace) => (\n <div>\n <WorkspaceManualRegistrationTokensSettingsSection workspaceId={workspace.id} />\n </div>\n )}\n </WorkspaceSettingsShell>\n );\n}\n"],"names":["WorkspaceManualRegistrationTokensSettingsSection","WorkspaceSettingsShell","RunnersSettingsPage","workspace","div","workspaceId","id"],"mappings":";AAAA,SAAQA,gDAAgD,QAAO,0BAA0B;AACzF,SAAQC,sBAAsB,QAAO,0CAA0C;AAE/E,OAAO,SAASC;IACd,qBACE,KAACD;kBACE,CAACE,0BACA,KAACC;0BACC,cAAA,KAACJ;oBAAiDK,aAAaF,UAAUG,EAAE;;;;AAKrF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-settings-page.d.ts","sourceRoot":"","sources":["../../src/pages/secrets-settings-page.tsx"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,gCAUlC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { WorkspaceSecretsSection } from '@shipfox/client-secrets';
|
|
3
|
-
import { WorkspaceSettingsShell } from '#components/workspace-settings-shell.js';
|
|
4
|
-
export function SecretsSettingsPage() {
|
|
5
|
-
return /*#__PURE__*/ _jsx(WorkspaceSettingsShell, {
|
|
6
|
-
children: (workspace)=>/*#__PURE__*/ _jsx("div", {
|
|
7
|
-
children: /*#__PURE__*/ _jsx(WorkspaceSecretsSection, {
|
|
8
|
-
workspaceId: workspace.id
|
|
9
|
-
})
|
|
10
|
-
})
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=secrets-settings-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/secrets-settings-page.tsx"],"sourcesContent":["import {WorkspaceSecretsSection} from '@shipfox/client-secrets';\nimport {WorkspaceSettingsShell} from '#components/workspace-settings-shell.js';\n\nexport function SecretsSettingsPage() {\n return (\n <WorkspaceSettingsShell>\n {(workspace) => (\n <div>\n <WorkspaceSecretsSection workspaceId={workspace.id} />\n </div>\n )}\n </WorkspaceSettingsShell>\n );\n}\n"],"names":["WorkspaceSecretsSection","WorkspaceSettingsShell","SecretsSettingsPage","workspace","div","workspaceId","id"],"mappings":";AAAA,SAAQA,uBAAuB,QAAO,0BAA0B;AAChE,SAAQC,sBAAsB,QAAO,0CAA0C;AAE/E,OAAO,SAASC;IACd,qBACE,KAACD;kBACE,CAACE,0BACA,KAACC;0BACC,cAAA,KAACJ;oBAAwBK,aAAaF,UAAUG,EAAE;;;;AAK5D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"variables-settings-page.d.ts","sourceRoot":"","sources":["../../src/pages/variables-settings-page.tsx"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,gCAUpC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { WorkspaceVariablesSection } from '@shipfox/client-secrets';
|
|
3
|
-
import { WorkspaceSettingsShell } from '#components/workspace-settings-shell.js';
|
|
4
|
-
export function VariablesSettingsPage() {
|
|
5
|
-
return /*#__PURE__*/ _jsx(WorkspaceSettingsShell, {
|
|
6
|
-
children: (workspace)=>/*#__PURE__*/ _jsx("div", {
|
|
7
|
-
children: /*#__PURE__*/ _jsx(WorkspaceVariablesSection, {
|
|
8
|
-
workspaceId: workspace.id
|
|
9
|
-
})
|
|
10
|
-
})
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=variables-settings-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/variables-settings-page.tsx"],"sourcesContent":["import {WorkspaceVariablesSection} from '@shipfox/client-secrets';\nimport {WorkspaceSettingsShell} from '#components/workspace-settings-shell.js';\n\nexport function VariablesSettingsPage() {\n return (\n <WorkspaceSettingsShell>\n {(workspace) => (\n <div>\n <WorkspaceVariablesSection workspaceId={workspace.id} />\n </div>\n )}\n </WorkspaceSettingsShell>\n );\n}\n"],"names":["WorkspaceVariablesSection","WorkspaceSettingsShell","VariablesSettingsPage","workspace","div","workspaceId","id"],"mappings":";AAAA,SAAQA,yBAAyB,QAAO,0BAA0B;AAClE,SAAQC,sBAAsB,QAAO,0CAA0C;AAE/E,OAAO,SAASC;IACd,qBACE,KAACD;kBACE,CAACE,0BACA,KAACC;0BACC,cAAA,KAACJ;oBAA0BK,aAAaF,UAAUG,EAAE;;;;AAK9D"}
|
package/dist/routes/agents.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ModelProvidersSettingsPage } from '#pages/model-providers-settings-page.js';
|
|
2
|
-
declare const _default: import("@shipfox/client-shell/runtime").RouteImpl<{
|
|
3
|
-
readonly component: typeof ModelProvidersSettingsPage;
|
|
4
|
-
}>;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/routes/agents.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,0BAA0B,EAAC,MAAM,yCAAyC,CAAC;;;;AACnF,wBAAoE"}
|
package/dist/routes/agents.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/agents.tsx"],"sourcesContent":["import {defineRoute} from '@shipfox/client-shell/runtime';\nimport {ModelProvidersSettingsPage} from '#pages/model-providers-settings-page.js';\nexport default defineRoute({component: ModelProvidersSettingsPage});\n"],"names":["defineRoute","ModelProvidersSettingsPage","component"],"mappings":"AAAA,SAAQA,WAAW,QAAO,gCAAgC;AAC1D,SAAQC,0BAA0B,QAAO,0CAA0C;AACnF,eAAeD,YAAY;IAACE,WAAWD;AAA0B,GAAG"}
|
package/dist/routes/events.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { validateTriggerEventsSearch } from '@shipfox/client-triggers';
|
|
2
|
-
import { EventsSettingsPage } from '#pages/events-settings-page.js';
|
|
3
|
-
declare const _default: import("@shipfox/client-shell/runtime").RouteImpl<{
|
|
4
|
-
readonly validateSearch: typeof validateTriggerEventsSearch;
|
|
5
|
-
readonly component: typeof EventsSettingsPage;
|
|
6
|
-
}>;
|
|
7
|
-
export default _default;
|
|
8
|
-
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/routes/events.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,2BAA2B,EAAC,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;;;;;AAClE,wBAGG"}
|
package/dist/routes/events.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineRoute } from '@shipfox/client-shell/runtime';
|
|
2
|
-
import { validateTriggerEventsSearch } from '@shipfox/client-triggers';
|
|
3
|
-
import { EventsSettingsPage } from '#pages/events-settings-page.js';
|
|
4
|
-
export default defineRoute({
|
|
5
|
-
validateSearch: validateTriggerEventsSearch,
|
|
6
|
-
component: EventsSettingsPage
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=events.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/events.tsx"],"sourcesContent":["import {defineRoute} from '@shipfox/client-shell/runtime';\nimport {validateTriggerEventsSearch} from '@shipfox/client-triggers';\nimport {EventsSettingsPage} from '#pages/events-settings-page.js';\nexport default defineRoute({\n validateSearch: validateTriggerEventsSearch,\n component: EventsSettingsPage,\n});\n"],"names":["defineRoute","validateTriggerEventsSearch","EventsSettingsPage","validateSearch","component"],"mappings":"AAAA,SAAQA,WAAW,QAAO,gCAAgC;AAC1D,SAAQC,2BAA2B,QAAO,2BAA2B;AACrE,SAAQC,kBAAkB,QAAO,iCAAiC;AAClE,eAAeF,YAAY;IACzBG,gBAAgBF;IAChBG,WAAWF;AACb,GAAG"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IntegrationsSettingsPage } from '#pages/integrations-settings-page.js';
|
|
2
|
-
declare const _default: import("@shipfox/client-shell/runtime").RouteImpl<{
|
|
3
|
-
readonly component: typeof IntegrationsSettingsPage;
|
|
4
|
-
}>;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=integrations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/routes/integrations.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,wBAAwB,EAAC,MAAM,sCAAsC,CAAC;;;;AAC9E,wBAAkE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/integrations.tsx"],"sourcesContent":["import {defineRoute} from '@shipfox/client-shell/runtime';\nimport {IntegrationsSettingsPage} from '#pages/integrations-settings-page.js';\nexport default defineRoute({component: IntegrationsSettingsPage});\n"],"names":["defineRoute","IntegrationsSettingsPage","component"],"mappings":"AAAA,SAAQA,WAAW,QAAO,gCAAgC;AAC1D,SAAQC,wBAAwB,QAAO,uCAAuC;AAC9E,eAAeD,YAAY;IAACE,WAAWD;AAAwB,GAAG"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ProvisionersSettingsPage } from '#pages/provisioners-settings-page.js';
|
|
2
|
-
declare const _default: import("@shipfox/client-shell/runtime").RouteImpl<{
|
|
3
|
-
readonly component: typeof ProvisionersSettingsPage;
|
|
4
|
-
}>;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=provisioners.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provisioners.d.ts","sourceRoot":"","sources":["../../src/routes/provisioners.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,wBAAwB,EAAC,MAAM,sCAAsC,CAAC;;;;AAC9E,wBAAkE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/provisioners.tsx"],"sourcesContent":["import {defineRoute} from '@shipfox/client-shell/runtime';\nimport {ProvisionersSettingsPage} from '#pages/provisioners-settings-page.js';\nexport default defineRoute({component: ProvisionersSettingsPage});\n"],"names":["defineRoute","ProvisionersSettingsPage","component"],"mappings":"AAAA,SAAQA,WAAW,QAAO,gCAAgC;AAC1D,SAAQC,wBAAwB,QAAO,uCAAuC;AAC9E,eAAeD,YAAY;IAACE,WAAWD;AAAwB,GAAG"}
|
package/dist/routes/runners.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { RunnersSettingsPage } from '#pages/runners-settings-page.js';
|
|
2
|
-
declare const _default: import("@shipfox/client-shell/runtime").RouteImpl<{
|
|
3
|
-
readonly component: typeof RunnersSettingsPage;
|
|
4
|
-
}>;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=runners.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runners.d.ts","sourceRoot":"","sources":["../../src/routes/runners.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;;;;AACpE,wBAA6D"}
|
package/dist/routes/runners.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/runners.tsx"],"sourcesContent":["import {defineRoute} from '@shipfox/client-shell/runtime';\nimport {RunnersSettingsPage} from '#pages/runners-settings-page.js';\nexport default defineRoute({component: RunnersSettingsPage});\n"],"names":["defineRoute","RunnersSettingsPage","component"],"mappings":"AAAA,SAAQA,WAAW,QAAO,gCAAgC;AAC1D,SAAQC,mBAAmB,QAAO,kCAAkC;AACpE,eAAeD,YAAY;IAACE,WAAWD;AAAmB,GAAG"}
|
package/dist/routes/secrets.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SecretsSettingsPage } from '#pages/secrets-settings-page.js';
|
|
2
|
-
declare const _default: import("@shipfox/client-shell/runtime").RouteImpl<{
|
|
3
|
-
readonly component: typeof SecretsSettingsPage;
|
|
4
|
-
}>;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=secrets.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/routes/secrets.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;;;;AACpE,wBAA6D"}
|
package/dist/routes/secrets.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/secrets.tsx"],"sourcesContent":["import {defineRoute} from '@shipfox/client-shell/runtime';\nimport {SecretsSettingsPage} from '#pages/secrets-settings-page.js';\nexport default defineRoute({component: SecretsSettingsPage});\n"],"names":["defineRoute","SecretsSettingsPage","component"],"mappings":"AAAA,SAAQA,WAAW,QAAO,gCAAgC;AAC1D,SAAQC,mBAAmB,QAAO,kCAAkC;AACpE,eAAeD,YAAY;IAACE,WAAWD;AAAmB,GAAG"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { VariablesSettingsPage } from '#pages/variables-settings-page.js';
|
|
2
|
-
declare const _default: import("@shipfox/client-shell/runtime").RouteImpl<{
|
|
3
|
-
readonly component: typeof VariablesSettingsPage;
|
|
4
|
-
}>;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=variables.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/routes/variables.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,qBAAqB,EAAC,MAAM,mCAAmC,CAAC;;;;AACxE,wBAA+D"}
|
package/dist/routes/variables.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/variables.tsx"],"sourcesContent":["import {defineRoute} from '@shipfox/client-shell/runtime';\nimport {VariablesSettingsPage} from '#pages/variables-settings-page.js';\nexport default defineRoute({component: VariablesSettingsPage});\n"],"names":["defineRoute","VariablesSettingsPage","component"],"mappings":"AAAA,SAAQA,WAAW,QAAO,gCAAgC;AAC1D,SAAQC,qBAAqB,QAAO,oCAAoC;AACxE,eAAeD,YAAY;IAACE,WAAWD;AAAqB,GAAG"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {EventsPage, type TriggerEventFilters} from '@shipfox/client-triggers';
|
|
2
|
-
import {getRouteApi} from '@tanstack/react-router';
|
|
3
|
-
import {WorkspaceSettingsShell} from '#components/workspace-settings-shell.js';
|
|
4
|
-
|
|
5
|
-
const routeApi = getRouteApi('/workspaces/$wid/settings/events');
|
|
6
|
-
|
|
7
|
-
export function EventsSettingsPage() {
|
|
8
|
-
const search = routeApi.useSearch();
|
|
9
|
-
const navigate = routeApi.useNavigate();
|
|
10
|
-
|
|
11
|
-
// Merge the patch into the current URL search. Undefined values drop their key, so
|
|
12
|
-
// clearing a filter removes it from the URL. `replace` keeps filter tweaks off the
|
|
13
|
-
// back stack.
|
|
14
|
-
const onFiltersChange = (patch: Partial<TriggerEventFilters>) => {
|
|
15
|
-
void navigate({search: {...search, ...patch}, replace: true});
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<WorkspaceSettingsShell>
|
|
20
|
-
{(workspace) => (
|
|
21
|
-
<EventsPage workspaceId={workspace.id} filters={search} onFiltersChange={onFiltersChange} />
|
|
22
|
-
)}
|
|
23
|
-
</WorkspaceSettingsShell>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import {configureApiClient} from '@shipfox/client-api';
|
|
2
|
-
import {screen} from '@testing-library/react';
|
|
3
|
-
import {
|
|
4
|
-
jsonResponse,
|
|
5
|
-
renderWorkspaceSettingsPage,
|
|
6
|
-
WORKSPACE_SETTINGS_TEST_WID,
|
|
7
|
-
} from '#test/pages.js';
|
|
8
|
-
import {IntegrationsSettingsPage} from './integrations-settings-page.js';
|
|
9
|
-
|
|
10
|
-
const providers = {
|
|
11
|
-
providers: [
|
|
12
|
-
{provider: 'sentry', display_name: 'Sentry', capabilities: []},
|
|
13
|
-
{provider: 'github', display_name: 'GitHub', capabilities: ['source_control']},
|
|
14
|
-
],
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const githubConnection = {
|
|
18
|
-
id: '44444444-4444-4444-8444-444444444444',
|
|
19
|
-
workspace_id: WORKSPACE_SETTINGS_TEST_WID,
|
|
20
|
-
provider: 'github',
|
|
21
|
-
external_account_id: 'installation-1',
|
|
22
|
-
slug: 'github_acme_corp',
|
|
23
|
-
display_name: 'acme-corp',
|
|
24
|
-
lifecycle_status: 'active',
|
|
25
|
-
capabilities: ['source_control'],
|
|
26
|
-
external_url: 'https://github.com/organizations/acme-corp/settings/installations/1',
|
|
27
|
-
created_at: '2026-03-12T00:00:00.000Z',
|
|
28
|
-
updated_at: '2026-03-12T00:00:00.000Z',
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
function fetchForIntegrations({connections = [githubConnection] as unknown[]} = {}) {
|
|
32
|
-
return vi.fn((input: RequestInfo | URL) => {
|
|
33
|
-
const url = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url;
|
|
34
|
-
if (url.includes('/integration-providers')) {
|
|
35
|
-
return Promise.resolve(jsonResponse(providers));
|
|
36
|
-
}
|
|
37
|
-
if (url.includes('/integration-connections')) {
|
|
38
|
-
return Promise.resolve(jsonResponse({connections}));
|
|
39
|
-
}
|
|
40
|
-
return Promise.resolve(jsonResponse({}, {status: 404}));
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function renderPage() {
|
|
45
|
-
return renderWorkspaceSettingsPage(
|
|
46
|
-
`/workspaces/${WORKSPACE_SETTINGS_TEST_WID}/settings/integrations`,
|
|
47
|
-
<IntegrationsSettingsPage />,
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// The provider is named once (icon + account name); the meta line carries only
|
|
52
|
-
// the date.
|
|
53
|
-
const ADDED_META_RE = /^Added /;
|
|
54
|
-
|
|
55
|
-
describe('IntegrationsSettingsPage', () => {
|
|
56
|
-
test('renders the settings shell and delegates to the integration gallery', async () => {
|
|
57
|
-
configureApiClient({
|
|
58
|
-
baseUrl: 'https://api.example.test',
|
|
59
|
-
fetchImpl: fetchForIntegrations(),
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
renderPage();
|
|
63
|
-
|
|
64
|
-
expect(await screen.findByRole('region', {name: 'Installed integrations'})).toBeInTheDocument();
|
|
65
|
-
expect(screen.getByRole('region', {name: 'Available integrations'})).toBeInTheDocument();
|
|
66
|
-
expect(await screen.findByText('acme-corp')).toBeVisible();
|
|
67
|
-
expect(screen.queryByText('Connected')).not.toBeInTheDocument();
|
|
68
|
-
expect(screen.queryByText('Connect')).not.toBeInTheDocument();
|
|
69
|
-
expect(screen.getByRole('link', {name: 'Install GitHub'})).toBeVisible();
|
|
70
|
-
expect(screen.getByText(ADDED_META_RE)).toBeVisible();
|
|
71
|
-
});
|
|
72
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import {IntegrationGallery} from '@shipfox/client-integrations';
|
|
2
|
-
import {WorkspaceSettingsShell} from '#components/workspace-settings-shell.js';
|
|
3
|
-
|
|
4
|
-
export function IntegrationsSettingsPage() {
|
|
5
|
-
return <WorkspaceSettingsShell>{() => <IntegrationGallery />}</WorkspaceSettingsShell>;
|
|
6
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import {configureApiClient} from '@shipfox/client-api';
|
|
2
|
-
import {screen} from '@testing-library/react';
|
|
3
|
-
import {
|
|
4
|
-
jsonResponse,
|
|
5
|
-
renderWorkspaceSettingsPage,
|
|
6
|
-
WORKSPACE_SETTINGS_TEST_WID,
|
|
7
|
-
} from '#test/pages.js';
|
|
8
|
-
import {ModelProvidersSettingsPage} from './model-providers-settings-page.js';
|
|
9
|
-
|
|
10
|
-
describe('ModelProvidersSettingsPage', () => {
|
|
11
|
-
test('renders the settings shell and model providers section', async () => {
|
|
12
|
-
const fetchImpl = vi.fn((input: RequestInfo | URL) => {
|
|
13
|
-
const url = new URL((input as Request).url);
|
|
14
|
-
if (url.pathname.endsWith('/agent/model-provider-catalog')) {
|
|
15
|
-
return Promise.resolve(
|
|
16
|
-
jsonResponse({
|
|
17
|
-
providers: [
|
|
18
|
-
{
|
|
19
|
-
id: 'anthropic',
|
|
20
|
-
label: 'Anthropic',
|
|
21
|
-
support_status: 'supported',
|
|
22
|
-
default_model: 'claude-opus-4-8',
|
|
23
|
-
credential_fields: [{key: 'api_key', label: 'API key', secret: true}],
|
|
24
|
-
unsupported_reason: null,
|
|
25
|
-
models: [{id: 'claude-opus-4-8', label: 'Claude Opus 4.8'}],
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
}),
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
return Promise.resolve(
|
|
32
|
-
jsonResponse({configs: [], default_provider_id: null, default_harness_id: null}),
|
|
33
|
-
);
|
|
34
|
-
});
|
|
35
|
-
configureApiClient({baseUrl: 'https://api.example.test', fetchImpl});
|
|
36
|
-
|
|
37
|
-
renderWorkspaceSettingsPage(
|
|
38
|
-
`/workspaces/${WORKSPACE_SETTINGS_TEST_WID}/settings/agents`,
|
|
39
|
-
<ModelProvidersSettingsPage />,
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
expect(await screen.findByText('Harnesses')).toBeVisible();
|
|
43
|
-
expect(await screen.findByText('No providers configured')).toBeVisible();
|
|
44
|
-
expect(screen.getByText('Available providers')).toBeVisible();
|
|
45
|
-
expect(screen.getByRole('button', {name: 'Configure Anthropic'})).toBeVisible();
|
|
46
|
-
expect(screen.queryByText('Connect')).not.toBeInTheDocument();
|
|
47
|
-
});
|
|
48
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {WorkspaceHarnessesSection, WorkspaceModelProvidersSection} from '@shipfox/client-agent';
|
|
2
|
-
import {WorkspaceSettingsShell} from '#components/workspace-settings-shell.js';
|
|
3
|
-
|
|
4
|
-
export function ModelProvidersSettingsPage() {
|
|
5
|
-
return (
|
|
6
|
-
<WorkspaceSettingsShell>
|
|
7
|
-
{(workspace) => (
|
|
8
|
-
<div className="flex flex-col gap-32">
|
|
9
|
-
<WorkspaceHarnessesSection workspaceId={workspace.id} />
|
|
10
|
-
<WorkspaceModelProvidersSection workspaceId={workspace.id} />
|
|
11
|
-
</div>
|
|
12
|
-
)}
|
|
13
|
-
</WorkspaceSettingsShell>
|
|
14
|
-
);
|
|
15
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {configureApiClient} from '@shipfox/client-api';
|
|
2
|
-
import {screen} from '@testing-library/react';
|
|
3
|
-
import {
|
|
4
|
-
jsonResponse,
|
|
5
|
-
renderWorkspaceSettingsPage,
|
|
6
|
-
WORKSPACE_SETTINGS_TEST_WID,
|
|
7
|
-
} from '#test/pages.js';
|
|
8
|
-
import {ProvisionersSettingsPage} from './provisioners-settings-page.js';
|
|
9
|
-
|
|
10
|
-
describe('ProvisionersSettingsPage', () => {
|
|
11
|
-
test('renders the settings shell and provisioner token section', async () => {
|
|
12
|
-
const fetchImpl = vi.fn((input: RequestInfo | URL) => {
|
|
13
|
-
const request = input as Request;
|
|
14
|
-
if (request.url.endsWith('/provisioners/active')) {
|
|
15
|
-
return Promise.resolve(jsonResponse({provisioners: []}));
|
|
16
|
-
}
|
|
17
|
-
return Promise.resolve(jsonResponse({tokens: []}));
|
|
18
|
-
});
|
|
19
|
-
configureApiClient({baseUrl: 'https://api.example.test', fetchImpl});
|
|
20
|
-
|
|
21
|
-
renderWorkspaceSettingsPage(
|
|
22
|
-
`/workspaces/${WORKSPACE_SETTINGS_TEST_WID}/settings/provisioners`,
|
|
23
|
-
<ProvisionersSettingsPage />,
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
expect(await screen.findByText('No usable provisioner registration tokens')).toBeVisible();
|
|
27
|
-
expect(screen.getByRole('button', {name: 'Create token'})).toBeVisible();
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {WorkspaceProvisionerTokensSettingsSection} from '@shipfox/client-runners';
|
|
2
|
-
import {WorkspaceSettingsShell} from '#components/workspace-settings-shell.js';
|
|
3
|
-
|
|
4
|
-
export function ProvisionersSettingsPage() {
|
|
5
|
-
return (
|
|
6
|
-
<WorkspaceSettingsShell>
|
|
7
|
-
{(workspace) => (
|
|
8
|
-
<div>
|
|
9
|
-
<WorkspaceProvisionerTokensSettingsSection workspaceId={workspace.id} />
|
|
10
|
-
</div>
|
|
11
|
-
)}
|
|
12
|
-
</WorkspaceSettingsShell>
|
|
13
|
-
);
|
|
14
|
-
}
|