mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-09 08:03:50 +00:00
fix: app custom url diff (#4914)
* fix: app custom url diff * update ee ref
This commit is contained in:
@@ -1 +1 @@
|
||||
271c210ddbbdcad0f4d6c007e650eceda5ddfa64
|
||||
dddc8d60d483a2ce8d78233a25a3899a2b1224ca
|
||||
@@ -12936,6 +12936,8 @@ components:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: boolean
|
||||
custom_path:
|
||||
type: string
|
||||
required:
|
||||
- id
|
||||
- workspace_id
|
||||
@@ -12957,8 +12959,6 @@ components:
|
||||
draft_only:
|
||||
type: boolean
|
||||
draft: {}
|
||||
custom_path:
|
||||
type: string
|
||||
|
||||
AppHistory:
|
||||
type: object
|
||||
|
||||
@@ -145,6 +145,8 @@ pub struct AppWithLastVersion {
|
||||
pub created_by: String,
|
||||
pub created_at: chrono::DateTime<chrono::Utc>,
|
||||
pub extra_perms: Option<serde_json::Value>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub custom_path: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, FromRow)]
|
||||
@@ -174,8 +176,6 @@ pub struct AppWithLastVersionAndDraft {
|
||||
pub draft: Option<sqlx::types::Json<Box<RawValue>>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub draft_only: Option<bool>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub custom_path: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
@@ -378,7 +378,7 @@ async fn get_app(
|
||||
|
||||
let app_o = if query.with_starred_info.unwrap_or(false) {
|
||||
sqlx::query_as::<_, AppWithLastVersionAndStarred>(
|
||||
"SELECT app.id, app.path, app.summary, app.versions, app.policy,
|
||||
"SELECT app.id, app.path, app.summary, app.versions, app.policy, app.custom_path,
|
||||
app.extra_perms, app_version.value,
|
||||
app_version.created_at, app_version.created_by, favorite.path IS NOT NULL as starred
|
||||
FROM app
|
||||
@@ -398,7 +398,7 @@ async fn get_app(
|
||||
.await?
|
||||
} else {
|
||||
sqlx::query_as::<_, AppWithLastVersionAndStarred>(
|
||||
"SELECT app.id, app.path, app.summary, app.versions, app.policy,
|
||||
"SELECT app.id, app.path, app.summary, app.versions, app.policy, app.custom_path,
|
||||
app.extra_perms, app_version.value,
|
||||
app_version.created_at, app_version.created_by, NULL as starred
|
||||
FROM app, app_version
|
||||
@@ -424,7 +424,7 @@ async fn get_app_lite(
|
||||
let mut tx = user_db.begin(&authed).await?;
|
||||
|
||||
let app_o = sqlx::query_as::<_, AppWithLastVersion>(
|
||||
"SELECT app.id, app.path, app.summary, app.versions, app.policy,
|
||||
"SELECT app.id, app.path, app.summary, app.versions, app.policy, app.custom_path,
|
||||
app.extra_perms, coalesce(app_version_lite.value::json, app_version.value) as value,
|
||||
app_version.created_at, app_version.created_by, NULL as starred
|
||||
FROM app, app_version
|
||||
@@ -451,8 +451,8 @@ async fn get_app_w_draft(
|
||||
let mut tx = user_db.begin(&authed).await?;
|
||||
|
||||
let app_o = sqlx::query_as::<_, AppWithLastVersionAndDraft>(
|
||||
r#"SELECT app.id, app.path, app.summary, app.versions, app.policy,
|
||||
app.extra_perms, app_version.value, app.custom_path,
|
||||
r#"SELECT app.id, app.path, app.summary, app.versions, app.policy, app.custom_path,
|
||||
app.extra_perms, app_version.value,
|
||||
app_version.created_at, app_version.created_by,
|
||||
app.draft_only, draft.value as "draft"
|
||||
from app
|
||||
@@ -582,7 +582,7 @@ async fn get_app_by_id(
|
||||
let mut tx = user_db.begin(&authed).await?;
|
||||
|
||||
let app_o = sqlx::query_as::<_, AppWithLastVersion>(
|
||||
"SELECT app.id, app.path, app.summary, app.versions, app.policy,
|
||||
"SELECT app.id, app.path, app.summary, app.versions, app.policy, app.custom_path,
|
||||
app.extra_perms, app_version.value,
|
||||
app_version.created_at, app_version.created_by from app, app_version
|
||||
WHERE app_version.id = $1 AND app.id = app_version.app_id AND app.workspace_id = $2",
|
||||
@@ -613,7 +613,7 @@ async fn get_public_app_by_secret(
|
||||
let id: i64 = bytes.parse().map_err(to_anyhow)?;
|
||||
|
||||
let app_o = sqlx::query_as::<_, AppWithLastVersion>(
|
||||
"SELECT app.id, app.path, app.summary, app.versions, app.policy,
|
||||
"SELECT app.id, app.path, app.summary, app.versions, app.policy, app.custom_path,
|
||||
null as extra_perms, coalesce(app_version_lite.value::json, app_version.value::json) as value,
|
||||
app_version.created_at, app_version.created_by from app, app_version
|
||||
LEFT JOIN app_version_lite ON app_version_lite.id = app_version.id
|
||||
|
||||
@@ -2484,7 +2484,7 @@ async fn tarball_workspace(
|
||||
|
||||
{
|
||||
let apps = sqlx::query_as::<_, AppWithLastVersion>(
|
||||
"SELECT app.id, app.path, app.summary, app.versions, app.policy,
|
||||
"SELECT app.id, app.path, app.summary, app.versions, app.policy, app.custom_path,
|
||||
app.extra_perms, app_version.value,
|
||||
app_version.created_at, app_version.created_by from app, app_version
|
||||
WHERE app.workspace_id = $1 AND app_version.id = app.versions[array_upper(app.versions, 1)]",
|
||||
|
||||
@@ -391,14 +391,16 @@
|
||||
path,
|
||||
summary: $summary,
|
||||
policy,
|
||||
deployment_message: deploymentMsg
|
||||
deployment_message: deploymentMsg,
|
||||
custom_path: customPath
|
||||
}
|
||||
})
|
||||
savedApp = {
|
||||
summary: $summary,
|
||||
value: structuredClone($app),
|
||||
path: path,
|
||||
policy: policy
|
||||
policy: policy,
|
||||
custom_path: customPath
|
||||
}
|
||||
closeSaveDrawer()
|
||||
sendUserToast('App deployed successfully')
|
||||
@@ -435,7 +437,8 @@
|
||||
summary: $summary,
|
||||
value: $app,
|
||||
path: newEditedPath || savedApp.draft?.path || savedApp.path,
|
||||
policy
|
||||
policy,
|
||||
custom_path: customPath
|
||||
})
|
||||
)
|
||||
) {
|
||||
@@ -482,7 +485,10 @@
|
||||
policy,
|
||||
path: npath,
|
||||
deployment_message: deploymentMsg,
|
||||
custom_path: $userStore?.is_admin || $userStore?.is_super_admin ? (customPath ?? '') : undefined
|
||||
// custom_path requires admin so to accept update without it, we need to send as undefined when non-admin (when undefined, it will be ignored)
|
||||
// it also means that customPath needs to be set to '' instead of undefined to unset it (when admin)
|
||||
custom_path:
|
||||
$userStore?.is_admin || $userStore?.is_super_admin ? customPath ?? '' : undefined
|
||||
}
|
||||
})
|
||||
savedApp = {
|
||||
@@ -553,7 +559,8 @@
|
||||
path: newEditedPath,
|
||||
summary: $summary,
|
||||
policy,
|
||||
draft_only: true
|
||||
draft_only: true,
|
||||
custom_path: customPath
|
||||
}
|
||||
})
|
||||
await DraftService.createDraft({
|
||||
@@ -565,7 +572,8 @@
|
||||
value: $app,
|
||||
path: newEditedPath,
|
||||
summary: $summary,
|
||||
policy
|
||||
policy,
|
||||
custom_path: customPath
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -579,8 +587,10 @@
|
||||
summary: $summary,
|
||||
value: structuredClone($app),
|
||||
path: newEditedPath,
|
||||
policy
|
||||
}
|
||||
policy,
|
||||
custom_path: customPath
|
||||
},
|
||||
custom_path: customPath
|
||||
}
|
||||
|
||||
draftDrawerOpen = false
|
||||
@@ -634,7 +644,8 @@
|
||||
summary: $summary,
|
||||
policy,
|
||||
path: newEditedPath || path,
|
||||
draft_only: true
|
||||
draft_only: true,
|
||||
custom_path: customPath
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -659,14 +670,16 @@
|
||||
value: structuredClone($app),
|
||||
path: savedApp.draft_only ? newEditedPath || path : path,
|
||||
policy,
|
||||
draft_only: true
|
||||
draft_only: true,
|
||||
custom_path: customPath
|
||||
}
|
||||
: savedApp),
|
||||
draft: {
|
||||
summary: $summary,
|
||||
value: structuredClone($app),
|
||||
path: newEditedPath || path,
|
||||
policy
|
||||
policy,
|
||||
custom_path: customPath
|
||||
}
|
||||
}
|
||||
|
||||
@@ -843,7 +856,8 @@
|
||||
summary: $summary,
|
||||
value: $app,
|
||||
path: newEditedPath || savedApp.draft?.path || savedApp.path,
|
||||
policy
|
||||
policy,
|
||||
custom_path: customPath
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -932,7 +946,8 @@
|
||||
summary: $summary,
|
||||
value: $app,
|
||||
path: newEditedPath || savedApp?.draft?.path || savedApp?.path,
|
||||
policy
|
||||
policy,
|
||||
custom_path: customPath
|
||||
}}
|
||||
additionalExitAction={() => {
|
||||
setTheme(priorDarkMode)
|
||||
@@ -949,7 +964,8 @@
|
||||
summary: $summary,
|
||||
value: $app,
|
||||
path: newEditedPath || savedApp?.draft?.path || savedApp?.path,
|
||||
policy
|
||||
policy,
|
||||
custom_path: customPath
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -1084,7 +1100,8 @@
|
||||
summary: $summary,
|
||||
value: $app,
|
||||
path: newEditedPath || savedApp.draft?.path || savedApp.path,
|
||||
policy
|
||||
policy,
|
||||
custom_path: customPath
|
||||
},
|
||||
button: {
|
||||
text: 'Looks good, deploy',
|
||||
|
||||
@@ -57,7 +57,8 @@
|
||||
summary: app_w_draft_.summary,
|
||||
value: app_w_draft_.draft,
|
||||
path: app_w_draft_.path,
|
||||
policy: app_w_draft_.policy
|
||||
policy: app_w_draft_.policy,
|
||||
custom_path: app_w_draft_.custom_path
|
||||
}
|
||||
: undefined,
|
||||
custom_path: app_w_draft_.custom_path
|
||||
@@ -192,7 +193,8 @@
|
||||
summary: app_.summary,
|
||||
value: app_.value as App,
|
||||
path: app_.path,
|
||||
policy: app_.policy
|
||||
policy: app_.policy,
|
||||
custom_path: app_.custom_path
|
||||
}
|
||||
redraw++
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user