mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: vcs after backend changes
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@
|
||||
"e2e:ui": "playwright test tests/e2e --ui"
|
||||
},
|
||||
"dependencies": {
|
||||
"@appwrite.io/console": "https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@06bb001",
|
||||
"@appwrite.io/console": "https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@640f09c",
|
||||
"@appwrite.io/pink-icons": "0.25.0",
|
||||
"@appwrite.io/pink-icons-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@525e5be8",
|
||||
"@appwrite.io/pink-legacy": "^1.0.2",
|
||||
|
||||
Generated
+5
-5
@@ -9,8 +9,8 @@ importers:
|
||||
.:
|
||||
dependencies:
|
||||
'@appwrite.io/console':
|
||||
specifier: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@06bb001
|
||||
version: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@06bb001
|
||||
specifier: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@640f09c
|
||||
version: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@640f09c
|
||||
'@appwrite.io/pink-icons':
|
||||
specifier: 0.25.0
|
||||
version: 0.25.0
|
||||
@@ -211,8 +211,8 @@ packages:
|
||||
'@analytics/type-utils@0.6.2':
|
||||
resolution: {integrity: sha512-TD+xbmsBLyYy/IxFimW/YL/9L2IEnM7/EoV9Aeh56U64Ify8o27HJcKjo38XY9Tcn0uOq1AX3thkKgvtWvwFQg==}
|
||||
|
||||
'@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@06bb001':
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@06bb001}
|
||||
'@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@640f09c':
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@640f09c}
|
||||
version: 1.2.1
|
||||
|
||||
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@525e5be8':
|
||||
@@ -4097,7 +4097,7 @@ snapshots:
|
||||
|
||||
'@analytics/type-utils@0.6.2': {}
|
||||
|
||||
'@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@06bb001': {}
|
||||
'@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@640f09c': {}
|
||||
|
||||
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@525e5be8(svelte@4.2.19)':
|
||||
dependencies:
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
import ConnectGit from './connectGit.svelte';
|
||||
import SvgIcon from '../svgIcon.svelte';
|
||||
import { getFrameworkIcon } from '$routes/(console)/project-[project]/sites/store';
|
||||
import { VCSDetectionType, type Models } from '@appwrite.io/console';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
@@ -62,9 +63,24 @@
|
||||
$repositories.installationId !== installationId ||
|
||||
$repositories.search !== search
|
||||
) {
|
||||
$repositories.repositories = (
|
||||
await sdk.forProject.vcs.listRepositories(installationId, search || undefined)
|
||||
).providerRepositories;
|
||||
//TODO: remove forced cast after backend fixes
|
||||
if (product === 'functions') {
|
||||
$repositories.repositories = (
|
||||
(await sdk.forProject.vcs.listRepositories(
|
||||
installationId,
|
||||
VCSDetectionType.Runtime,
|
||||
search || undefined
|
||||
)) as unknown as Models.ProviderRepositoryRuntimeList
|
||||
).runtimeProviderRepositories;
|
||||
} else {
|
||||
$repositories.repositories = (
|
||||
await sdk.forProject.vcs.listRepositories(
|
||||
installationId,
|
||||
VCSDetectionType.Framework,
|
||||
search || undefined
|
||||
)
|
||||
).frameworkProviderRepositories;
|
||||
}
|
||||
}
|
||||
|
||||
$repositories.search = search;
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { iconPath } from '$lib/stores/app';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { installation, repository } from '$lib/stores/vcs';
|
||||
import { VCSDetectionType } from '@appwrite.io/console';
|
||||
import { DirectoryPicker } from '@appwrite.io/pink-svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
@@ -16,6 +18,7 @@
|
||||
|
||||
export let show = false;
|
||||
export let rootDir: string;
|
||||
export let product: 'sites' | 'functions';
|
||||
|
||||
let isLoading = true;
|
||||
let directories: Directory[] = [
|
||||
@@ -82,17 +85,16 @@
|
||||
fileCount: undefined,
|
||||
thumbnailUrl: undefined
|
||||
}));
|
||||
// const runtime = await sdk.forProject.vcs.createRepositoryDetection(
|
||||
// $installation.$id,
|
||||
// $repository.id,
|
||||
// path
|
||||
// );
|
||||
|
||||
// currentDir.children.forEach((dir)=>
|
||||
// {
|
||||
// dir.thumbnailHtml = $iconPath(runtime.runtime, 'color')
|
||||
// }
|
||||
// )
|
||||
const runtime = await sdk.forProject.vcs.createRepositoryDetection(
|
||||
$installation.$id,
|
||||
$repository.id,
|
||||
VCSDetectionType.Framework, //TODO: add type: VCSDetectionType.Framework || VCSDetectionType.Runtime according to the product
|
||||
path
|
||||
);
|
||||
//TODO: Fix runtime after passing type: runtime.framework || runtime.runtime
|
||||
currentDir.children.forEach((dir) => {
|
||||
dir.thumbnailUrl = $iconPath(runtime.framework, 'color');
|
||||
});
|
||||
directories = [...directories];
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
+5
-4
@@ -8,7 +8,7 @@
|
||||
import { timeFromNow, toLocaleDateTime } from '$lib/helpers/date';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Runtime, type Models } from '@appwrite.io/console';
|
||||
import { Runtime, VCSDetectionType, type Models } from '@appwrite.io/console';
|
||||
import { func, repositories } from '../store';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import InputSelectSearch from '$lib/elements/forms/inputSelectSearch.svelte';
|
||||
@@ -92,11 +92,12 @@
|
||||
$repositories.search !== search
|
||||
) {
|
||||
$repositories.repositories = (
|
||||
await sdk.forProject.vcs.listRepositories(
|
||||
(await sdk.forProject.vcs.listRepositories(
|
||||
selectedInstallationId,
|
||||
VCSDetectionType.Runtime,
|
||||
search || undefined
|
||||
)
|
||||
).providerRepositories;
|
||||
)) as unknown as Models.ProviderRepositoryRuntimeList
|
||||
).runtimeProviderRepositories;
|
||||
}
|
||||
|
||||
$repositories.search = search;
|
||||
|
||||
+7
-4
@@ -18,6 +18,7 @@
|
||||
import ConnectRepoModal from '../../../(components)/connectRepoModal.svelte';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { onMount } from 'svelte';
|
||||
import { StatusCode } from '@appwrite.io/console';
|
||||
|
||||
const backPage = `${base}/project-${$page.params.project}/sites/site-${$page.params.site}/domains`;
|
||||
|
||||
@@ -29,8 +30,8 @@
|
||||
let showConnectRepo = false;
|
||||
let behaviour: 'REDIRECT' | 'CREATE' = 'CREATE';
|
||||
let domain = '';
|
||||
let redirect = null;
|
||||
let statusCode = null;
|
||||
let redirect: string = null;
|
||||
let statusCode: number = null;
|
||||
let branch = null;
|
||||
|
||||
const redirectOptions = data.domains.rules
|
||||
@@ -125,8 +126,10 @@
|
||||
$organization.$id,
|
||||
domain
|
||||
);
|
||||
//TODO: add status once Matej fixes backend
|
||||
await sdk.forProject.proxy.createRedirectRule(domain, redirect);
|
||||
const sc = Object.values(StatusCode).find(
|
||||
(code) => parseInt(code) === statusCode
|
||||
);
|
||||
await sdk.forProject.proxy.createRedirectRule(domain, redirect, sc);
|
||||
|
||||
goto(
|
||||
`${base}/project-${$page.params.project}/sites/site-${$page.params.site}/domains/add-domain/verify-${domainData.$id}}`
|
||||
|
||||
Reference in New Issue
Block a user