fix: add tag support for CLI

This commit is contained in:
Ruben Fiszel
2023-11-06 21:40:25 +01:00
parent 86baae43ce
commit d74d2b4efb
2 changed files with 10 additions and 5 deletions
+4 -4
View File
@@ -134,7 +134,6 @@ pub struct WorkspaceSettings {
pub code_completion_enabled: bool,
pub error_handler: Option<String>,
pub error_handler_extra_args: Option<serde_json::Value>,
pub error_handler_muted_on_cancel: Option<bool>,
}
#[derive(FromRow, Serialize, Debug)]
@@ -247,7 +246,6 @@ pub struct NewWorkspaceUser {
pub struct EditErrorHandler {
pub error_handler: Option<String>,
pub error_handler_extra_args: Option<serde_json::Value>,
pub error_handler_muted_on_cancel: Option<bool>,
}
async fn list_pending_invites(
@@ -835,10 +833,9 @@ async fn edit_error_handler(
if let Some(error_handler) = &ee.error_handler {
sqlx::query!(
"UPDATE workspace_settings SET error_handler = $1, error_handler_extra_args = $2, error_handler_muted_on_cancel = $3 WHERE workspace_id = $4",
"UPDATE workspace_settings SET error_handler = $1, error_handler_extra_args = $2 WHERE workspace_id = $3",
error_handler,
ee.error_handler_extra_args,
ee.error_handler_muted_on_cancel.unwrap_or(false),
&w_id
)
.execute(&mut *tx)
@@ -1457,6 +1454,8 @@ struct ScriptMetadata {
ws_error_handler_muted: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
priority: Option<i16>,
#[serde(skip_serializing_if = "Option::is_none")]
tag: Option<String>,
}
pub fn is_none_or_false(val: &Option<bool>) -> bool {
@@ -1659,6 +1658,7 @@ async fn tarball_workspace(
dedicated_worker: script.dedicated_worker,
ws_error_handler_muted: script.ws_error_handler_muted,
priority: script.priority,
tag: script.tag,
};
let metadata_str = serde_json::to_string_pretty(&metadata).unwrap();
@@ -26,7 +26,12 @@
<Menu>
<div slot="trigger" class="w-full">
<MenuButton class="!text-xs" icon={User} label={'User'} {isCollapsed} />
<MenuButton
class="!text-xs"
icon={User}
label={`User (${$userStore?.username ?? $userStore?.email})`}
{isCollapsed}
/>
</div>
<div class="divide-y">
<div class="px-4 py-3" role="none">