Feat v0.6.3 dead code sweep (#38)
All checks were successful
All checks were successful
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #38.
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
// Bug badge that shows error count. Subscribes to engine
|
||||
// for reactive updates.
|
||||
//
|
||||
// v0.37.18: Preact rebuild from debug.js _updateBadge().
|
||||
|
||||
const html = window.html;
|
||||
const { useEffect } = window.hooks;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
// Filterable console log display with type coloring,
|
||||
// elapsed timestamps, and auto-scroll.
|
||||
//
|
||||
// v0.37.18: Preact rebuild from debug.js _renderConsoleTab().
|
||||
|
||||
const html = window.html;
|
||||
const { useState, useMemo, useRef, useEffect } = window.hooks;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
// Singleton — init() must run before SDK boot to capture early errors.
|
||||
// UI-agnostic: Preact components subscribe via .subscribe().
|
||||
//
|
||||
// v0.37.18: Extracted from debug.js (v0.37.14).
|
||||
//
|
||||
// Exports: debugEngine (singleton)
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
// Global overlay — not a routed surface.
|
||||
// Mounts via mountDebugModal(el, engine).
|
||||
//
|
||||
// v0.37.18: Preact rebuild of debug modal (CR P2-5).
|
||||
|
||||
import { debugEngine } from './engine.js';
|
||||
import { ConsoleTab } from './console-tab.js';
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
// Fetch log with expandable request/response details.
|
||||
// Newest entries first.
|
||||
//
|
||||
// v0.37.18: Preact rebuild from debug.js _renderNetworkTab().
|
||||
|
||||
const html = window.html;
|
||||
const { useState } = window.hooks;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
// command history, and collapsible JSON output.
|
||||
// Admin-gated OR ?debug=1 URL param.
|
||||
//
|
||||
// v0.37.18: Preact rebuild from repl.js (v0.37.14).
|
||||
|
||||
const html = window.html;
|
||||
const { useState, useRef, useEffect, useCallback } = window.hooks;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// ==========================================
|
||||
// Displays current application state snapshot as formatted JSON.
|
||||
//
|
||||
// v0.37.18: Preact rebuild from debug.js _renderStateTab().
|
||||
|
||||
const html = window.html;
|
||||
const { useMemo } = window.hooks;
|
||||
|
||||
@@ -131,13 +131,13 @@ export function createDomains(restClient) {
|
||||
updateWorkflow: (id, wfId, data) => rc.put(`/api/v1/teams/${id}/workflows/${wfId}`, data),
|
||||
deleteWorkflow: (id, wfId) => rc.del(`/api/v1/teams/${id}/workflows/${wfId}`),
|
||||
publishWorkflow: (id, wfId) => rc.post(`/api/v1/teams/${id}/workflows/${wfId}/publish`, {}),
|
||||
// Team workflow stages (v0.37.15 — FE wiring for existing BE routes)
|
||||
// Team workflow stages
|
||||
workflowStages: (id, wfId) => rc.get(`/api/v1/teams/${id}/workflows/${wfId}/stages`),
|
||||
createWorkflowStage: (id, wfId, data) => rc.post(`/api/v1/teams/${id}/workflows/${wfId}/stages`, data),
|
||||
updateWorkflowStage: (id, wfId, sid, data) => rc.put(`/api/v1/teams/${id}/workflows/${wfId}/stages/${sid}`, data),
|
||||
deleteWorkflowStage: (id, wfId, sid) => rc.del(`/api/v1/teams/${id}/workflows/${wfId}/stages/${sid}`),
|
||||
reorderWorkflowStages: (id, wfId, ids) => rc.patch(`/api/v1/teams/${id}/workflows/${wfId}/stages/reorder`, { ordered_ids: ids }),
|
||||
// Adopt global workflows (v0.3.6)
|
||||
// Adopt global workflows
|
||||
availableWorkflows: (id) => rc.get(`/api/v1/teams/${id}/workflows/available`),
|
||||
adoptWorkflow: (id, wfId) => rc.post(`/api/v1/teams/${id}/workflows/${wfId}/adopt`, {}),
|
||||
},
|
||||
@@ -239,7 +239,6 @@ export function createDomains(restClient) {
|
||||
del: (id) => rc.del(`/api/v1/admin/extensions/${id}`),
|
||||
},
|
||||
|
||||
// v0.38.1: Global connections
|
||||
connections: crud(rc, '/api/v1/admin/connections'),
|
||||
|
||||
packages: {
|
||||
@@ -251,20 +250,18 @@ export function createDomains(restClient) {
|
||||
del: (id) => rc.del(`/api/v1/admin/packages/${id}`),
|
||||
settings: (id) => rc.get(`/api/v1/admin/packages/${id}/settings`),
|
||||
updateSettings: (id, data) => rc.put(`/api/v1/admin/packages/${id}/settings`, data),
|
||||
dependencies: (id) => rc.get(`/api/v1/admin/packages/${id}/dependencies`), // v0.38.2
|
||||
consumers: (id) => rc.get(`/api/v1/admin/packages/${id}/consumers`), // v0.38.2
|
||||
update: (id, file) => rc.upload(`/api/v1/admin/packages/${id}/update`, file), // v0.5.4
|
||||
exportPkg: (id) => `/api/v1/admin/packages/${id}/export`, // v0.5.4 (URL for window.open)
|
||||
dependencies: (id) => rc.get(`/api/v1/admin/packages/${id}/dependencies`),
|
||||
consumers: (id) => rc.get(`/api/v1/admin/packages/${id}/consumers`),
|
||||
update: (id, file) => rc.upload(`/api/v1/admin/packages/${id}/update`, file),
|
||||
exportPkg: (id) => `/api/v1/admin/packages/${id}/export`,
|
||||
registry: () => rc.get('/api/v1/admin/packages/registry'),
|
||||
registryInstall: (url) => rc.post('/api/v1/admin/packages/registry/install', { url }),
|
||||
// v0.5.0: Extension permissions
|
||||
registryInstall: (url) => rc.post('/api/v1/admin/packages/registry/install', { download_url: url }),
|
||||
permissions: (id) => rc.get(`/api/v1/admin/extensions/${id}/permissions`),
|
||||
grantPerm: (id, perm) => rc.post(`/api/v1/admin/extensions/${id}/permissions/${perm}/grant`, {}),
|
||||
revokePerm: (id, perm) => rc.post(`/api/v1/admin/extensions/${id}/permissions/${perm}/revoke`, {}),
|
||||
grantAllPerms: (id) => rc.post(`/api/v1/admin/extensions/${id}/permissions/grant-all`, {}),
|
||||
},
|
||||
|
||||
// v0.38.2: Full dependency graph
|
||||
dependencies: {
|
||||
list: () => rc.get('/api/v1/admin/dependencies'),
|
||||
},
|
||||
@@ -278,7 +275,6 @@ export function createDomains(restClient) {
|
||||
del: (id) => rc.del(`/api/v1/admin/surfaces/${id}`),
|
||||
},
|
||||
|
||||
// v0.6.1: Backup/Restore
|
||||
backup: {
|
||||
create: (opts) => rc.post('/api/v1/admin/backup' + _qs(opts)),
|
||||
list: () => rc.get('/api/v1/admin/backups'),
|
||||
|
||||
@@ -27,7 +27,6 @@ export function createCan(authRef) {
|
||||
|
||||
/**
|
||||
* Is the current user a platform admin?
|
||||
* v0.2.0: Uses RBAC grant instead of legacy role field.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isAdmin() {
|
||||
|
||||
@@ -104,7 +104,7 @@ export async function boot() {
|
||||
sw.slots = slots;
|
||||
sw.actions = actions;
|
||||
|
||||
// Realtime — room-scoped pub/sub over WebSocket (v0.5.0)
|
||||
// Realtime — room-scoped pub/sub over WebSocket
|
||||
sw.realtime = realtime;
|
||||
|
||||
// Shell helpers — imperative confirm/prompt backed by primitives
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* SurfaceViewport — container where the active surface renders
|
||||
*
|
||||
* Deliberately thin for v0.37.4. Error boundaries and
|
||||
* Deliberately thin. Error boundaries and
|
||||
* surface transitions will be added in later versions.
|
||||
*/
|
||||
const { html } = window;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Admin > Connections — global extension connection CRUD
|
||||
* v0.38.1: Scoped credential management for extensions
|
||||
*/
|
||||
const { html } = window;
|
||||
const { useState, useEffect, useCallback } = hooks;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Reads globals:
|
||||
* __SECTION__ — active section name (string)
|
||||
* __BASE__ — base path
|
||||
* __CONFIG_SECTIONS__ — v0.38.3: extension config sections (array|null)
|
||||
* __CONFIG_SECTIONS__
|
||||
*
|
||||
* Layout: topbar (back + category tabs) + body (sidebar nav + content area).
|
||||
* All 24+ sections are native Preact components loaded lazily.
|
||||
@@ -34,7 +34,7 @@ const ADMIN_LABELS = {
|
||||
audit: 'Audit',
|
||||
};
|
||||
|
||||
// ── v0.38.3: Extension config sections ──────
|
||||
// ── Extension config sections ──────
|
||||
// Packages declare config_section in their manifest targeting "admin".
|
||||
// We merge them into the appropriate category and section module map.
|
||||
const _configSections = window.__CONFIG_SECTIONS__ || [];
|
||||
@@ -72,7 +72,6 @@ const sectionModules = {
|
||||
audit: () => import(`./audit.js${_v}`),
|
||||
};
|
||||
|
||||
// v0.38.3: Register dynamic section loaders for extension config sections
|
||||
for (const cs of _configSections) {
|
||||
const pkgId = cs.package_id;
|
||||
const component = cs.component || 'js/config.js';
|
||||
|
||||
@@ -46,7 +46,7 @@ export default function PackagesSection() {
|
||||
const [registryPkgs, setRegistryPkgs] = useState([]);
|
||||
const [registryLoading, setRegistryLoading] = useState(false);
|
||||
const [installing, setInstalling] = useState(false);
|
||||
const [permsId, setPermsId] = useState(null); // v0.5.0: permissions drawer
|
||||
const [permsId, setPermsId] = useState(null);
|
||||
const [perms, setPerms] = useState([]);
|
||||
|
||||
const BASE = window.__BASE__ || '';
|
||||
@@ -162,7 +162,7 @@ export default function PackagesSection() {
|
||||
} catch (e) { sw.toast(e.message, 'error'); }
|
||||
}
|
||||
|
||||
// ── Permissions drawer (v0.5.0) ────────────
|
||||
// ── Permissions drawer ────────────
|
||||
async function togglePerms(pkgId) {
|
||||
if (permsId === pkgId) { setPermsId(null); setPerms([]); return; }
|
||||
try {
|
||||
@@ -323,7 +323,7 @@ export default function PackagesSection() {
|
||||
</div>
|
||||
`}
|
||||
|
||||
${/* ── Inline permissions drawer (v0.5.0) ── */``}
|
||||
${/* ── Inline permissions drawer ── */``}
|
||||
${permsId === pkg.id && html`
|
||||
<div style="padding:8px 12px 12px 24px;background:var(--bg-2);border-bottom:1px solid var(--border);">
|
||||
${perms.length === 0
|
||||
|
||||
@@ -36,6 +36,7 @@ export default function SettingsSection() {
|
||||
message_variant: cfg_.message?.variant || 'info',
|
||||
footer_enabled: !!cfg_.footer?.enabled,
|
||||
footer_text: cfg_.footer?.text || '',
|
||||
package_registry_url: cfg_.package_registry?.url || '',
|
||||
});
|
||||
setVault(v);
|
||||
} catch (e) { sw.toast(e.message, 'error'); }
|
||||
@@ -78,6 +79,9 @@ export default function SettingsSection() {
|
||||
text: cfg.footer_text,
|
||||
}});
|
||||
|
||||
// Package Registry
|
||||
await sw.api.admin.settings.update('package_registry', { value: { url: cfg.package_registry_url } });
|
||||
|
||||
sw.toast('Settings saved', 'success');
|
||||
} catch (e) { sw.toast(e.message, 'error'); }
|
||||
finally { setSaving(false); }
|
||||
@@ -166,6 +170,13 @@ export default function SettingsSection() {
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="settings-section"><h3>Package Registry</h3>
|
||||
<div class="form-group"><label>Registry URL</label>
|
||||
<input value=${cfg.package_registry_url} onInput=${e => set('package_registry_url', e.target.value)} placeholder="https://registry.example.com/registry.json" />
|
||||
</div>
|
||||
<span class="text-muted" style="font-size:12px;">URL to a JSON registry index. Enables browsing and one-click install under Packages > Registry.</span>
|
||||
</div>
|
||||
|
||||
<div class="settings-section"><h3>Email</h3>
|
||||
<button class="btn-small" onClick=${testEmail}>Send Test Email</button>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* DocsSurface — builtin documentation viewer (v0.6.2)
|
||||
* DocsSurface — builtin documentation viewer
|
||||
*
|
||||
* Reads globals:
|
||||
* __SECTION__ — active doc slug (e.g. "GETTING-STARTED")
|
||||
@@ -8,7 +8,6 @@
|
||||
* Fetches markdown from GET /api/v1/docs/:name, renders with
|
||||
* a simple markdown-to-HTML converter. Sidebar lists all docs.
|
||||
*
|
||||
* v0.6.2: dark mode fix, topbar navigation, error handling.
|
||||
*/
|
||||
const { html } = window;
|
||||
const { useState, useEffect, useCallback, useMemo } = hooks;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* ConnectionsSection — personal extension connection CRUD
|
||||
* v0.38.1: Scoped credential management for extensions
|
||||
*/
|
||||
const { html } = window;
|
||||
const { useState, useEffect, useCallback } = hooks;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Reads globals:
|
||||
* __SECTION__ — active section name (string)
|
||||
* __BASE__ — base path
|
||||
* __CONFIG_SECTIONS__ — v0.38.3: extension config sections (array|null)
|
||||
* __CONFIG_SECTIONS__
|
||||
*
|
||||
* Layout: topbar + left nav + content area (same CSS classes as before).
|
||||
* All sections are native Preact components loaded lazily.
|
||||
@@ -44,7 +44,7 @@ const SECTION_TITLES = {
|
||||
connections: 'Connections', notifications: 'Notifications',
|
||||
};
|
||||
|
||||
// ── v0.38.3: Extension config sections ──────
|
||||
// ── Extension config sections ──────
|
||||
// Packages declare config_section in their manifest. The backend passes
|
||||
// matching entries via __CONFIG_SECTIONS__. We merge them into the nav
|
||||
// and section module map for lazy loading.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Team Admin > Connections — team-scoped extension connection CRUD
|
||||
* v0.38.1: Scoped credential management for extensions
|
||||
*/
|
||||
const { html } = window;
|
||||
const { useState, useEffect, useCallback } = hooks;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Reads globals:
|
||||
* __SECTION__ — active section name (string)
|
||||
* __BASE__ — base path
|
||||
* __CONFIG_SECTIONS__ — v0.38.3: extension config sections (array|null)
|
||||
* __CONFIG_SECTIONS__
|
||||
*
|
||||
* Layout: topbar (back + team name) + sidebar nav + content area.
|
||||
* All 10+ sections are native Preact components loaded lazily.
|
||||
@@ -36,7 +36,7 @@ const sectionModules = {
|
||||
activity: () => import('./activity.js'),
|
||||
};
|
||||
|
||||
// ── v0.38.3: Extension config sections ──────
|
||||
// ── Extension config sections ──────
|
||||
const _configSections = window.__CONFIG_SECTIONS__ || [];
|
||||
const _base = window.__BASE__ || '';
|
||||
for (const cs of _configSections) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Team Admin > Members
|
||||
* v0.3.4: custom team roles support
|
||||
*/
|
||||
const { html } = window;
|
||||
const { useState, useEffect, useCallback } = hooks;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Team Admin > Workflows — v0.37.15 rewrite
|
||||
* Team Admin > Workflows
|
||||
*
|
||||
* Tab layout: Workflows | Assignments | Monitor
|
||||
* - Workflows: CRUD + inline stage editor (E2)
|
||||
@@ -365,7 +365,6 @@ function StageForm({ stage, teams, onSave, onCancel }) {
|
||||
stage?.branch_rules ? (typeof stage.branch_rules === 'string' ? stage.branch_rules : JSON.stringify(stage.branch_rules, null, 2)) : ''
|
||||
);
|
||||
|
||||
// v0.3.4: stage_config fields
|
||||
const sc = stage?.stage_config ? (typeof stage.stage_config === 'string' ? JSON.parse(stage.stage_config || '{}') : stage.stage_config) : {};
|
||||
const [requiredRole, setRequiredRole] = useState(sc.required_role || '');
|
||||
const [valApprovals, setValApprovals] = useState(sc.validation?.required_approvals || '');
|
||||
@@ -664,7 +663,7 @@ function MonitorTab({ teamId }) {
|
||||
`;
|
||||
}
|
||||
|
||||
// ── Signoff Panel (v0.3.4) ──────────────────
|
||||
// ── Signoff Panel ──────────────────
|
||||
|
||||
function SignoffPanel({ instanceId, teamId }) {
|
||||
const [signoffs, setSignoffs] = useState([]);
|
||||
|
||||
Reference in New Issue
Block a user