Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
596 changes: 590 additions & 6 deletions webapp/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@testing-library/svelte": "^5.2.0-next.3",
"@testing-library/user-event": "^14.6.1",
"@types/node": "^24.2.0",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "^3.2.4",
"autoprefixer": "^10.4.16",
"happy-dom": "^20.0.2",
Expand Down
200 changes: 0 additions & 200 deletions webapp/src/integration/pool-creation-anti-duplication.test.ts

This file was deleted.

26 changes: 1 addition & 25 deletions webapp/src/lib/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,5 @@ export interface APIError {
details?: string;
}

// GarmApiClient now extends/wraps the generated client
export class GarmApiClient extends GeneratedGarmApiClient {
constructor(baseUrl: string = '') {
super(baseUrl);
}

// All methods are inherited from GeneratedGarmApiClient
// This class now acts as a simple wrapper for backward compatibility

// Explicitly expose template methods for TypeScript
declare listTemplates: (osType?: string, partialName?: string, forgeType?: string) => Promise<Template[]>;
declare getTemplate: (id: number) => Promise<Template>;
declare createTemplate: (params: CreateTemplateParams) => Promise<Template>;
declare updateTemplate: (id: number, params: UpdateTemplateParams) => Promise<Template>;
declare deleteTemplate: (id: number) => Promise<void>;
declare restoreTemplates: (params: RestoreTemplateRequest) => Promise<void>;

// Explicitly expose file object methods for TypeScript
declare listFileObjects: (tags?: string, page?: number, pageSize?: number) => Promise<FileObjectPaginatedResponse>;
declare getFileObject: (objectID: string) => Promise<FileObject>;
declare updateFileObject: (objectID: string, params: UpdateFileObjectParams) => Promise<FileObject>;
declare deleteFileObject: (objectID: string) => Promise<void>;
}

// Create a singleton instance
export const garmApi = new GarmApiClient();
export const garmApi = new GeneratedGarmApiClient();
2 changes: 1 addition & 1 deletion webapp/src/lib/api/generated-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ export class GeneratedGarmApiClient {
}

async updateTemplate(id: number, params: UpdateTemplateParams): Promise<Template> {
const response = await this.templatesApi.updateTemplate(id.toString(), params);
const response = await this.templatesApi.updateTemplate(id, params);
return response.data;
}

Expand Down
73 changes: 11 additions & 62 deletions webapp/src/lib/components/CodeEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@
return null;
}

function createEditor() {
if (!editorContainer) return;

function buildExtensions() {
const extensions = [
basicSetup,
...getThemeExtensions(isDarkMode),
Expand Down Expand Up @@ -279,15 +277,20 @@
}
])
];

// Add template completion if enabled

if (enableTemplateCompletion) {
extensions.push(autocompletion({ override: [templateCompletion] }));
}


return extensions;
}

function createEditor() {
if (!editorContainer) return;

const state = EditorState.create({
doc: value,
extensions
extensions: buildExtensions()
});

editor = new EditorView({
Expand All @@ -310,62 +313,8 @@
});
}

// Update language extension
const newExtensions = [
basicSetup,
...getThemeExtensions(isDarkMode),
getLanguageExtension(language),
EditorView.updateListener.of((update) => {
if (update.docChanged) {
const newValue = update.state.doc.toString();
value = newValue;
dispatch('change', { value: newValue });
}
}),
EditorState.readOnly.of(readonly),
EditorView.theme({
'&': {
minHeight: minHeight
},
'.cm-editor': {
minHeight: minHeight
},
'.cm-scroller': {
minHeight: minHeight
}
}),
keymap.of([
{
key: 'Tab',
run: (view) => {
if (readonly) return false;
const changes = view.state.changeByRange(range => ({
changes: { from: range.from, to: range.to, insert: ' ' },
range: EditorSelection.range(range.from + 4, range.from + 4)
}));
view.dispatch(changes);
return true;
}
},
{
key: 'Ctrl-s',
preventDefault: true,
run: () => {
if (readonly) return false;
dispatch('save');
return true;
}
}
])
];

// Add template completion if enabled
if (enableTemplateCompletion) {
newExtensions.push(autocompletion({ override: [templateCompletion] }));
}

editor.dispatch({
effects: StateEffect.reconfigure.of(newExtensions)
effects: StateEffect.reconfigure.of(buildExtensions())
});
}

Expand Down
4 changes: 2 additions & 2 deletions webapp/src/lib/components/ControllerInfoCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@
}

// Form validation
$: isValidUrl = (url: string) => {
function isValidUrl(url: string): boolean {
if (!url.trim()) return true; // Empty is allowed
try {
new URL(url);
return true;
} catch {
return false;
}
};
}

$: isFormValid =
isValidUrl(metadataUrl) &&
Expand Down
3 changes: 1 addition & 2 deletions webapp/src/lib/components/CreateOrganizationModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@
// Auto-generate webhook secret when checkbox is checked
$: if (generateWebhookSecret) {
formData.webhook_secret = generateSecureWebhookSecret();
} else if (!generateWebhookSecret) {
// Clear the secret if user unchecks auto-generate
} else {
formData.webhook_secret = '';
}

Expand Down
Loading
Loading