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
17 changes: 11 additions & 6 deletions web-admin/src/features/personal-files/SharePersonalFile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { fileArtifacts } from "@rilldata/web-common/features/entity-management/file-artifacts.ts";
import { addLeadingSlash } from "@rilldata/web-common/features/entity-management/entity-mappers.ts";
import { eventBus } from "@rilldata/web-common/lib/event-bus/event-bus.ts";
import { m } from "@rilldata/web-common/lib/i18n/gen/messages";

let {
organization,
Expand Down Expand Up @@ -56,7 +57,9 @@

eventBus.emit("notification", {
type: "success",
message: `Dashboard ${share ? "shared" : "hidden"} successfully`,
message: share
? m.personal_files_share_shared_notification()
: m.personal_files_share_hidden_notification(),
});
} catch (e) {
console.error("Error sharing dashboard:", e);
Expand All @@ -77,18 +80,18 @@
selected={open}
loading={isPending}
>
Share
{m.personal_files_share_button()}
</Button>
</Tooltip.Trigger>
<Tooltip.Content>Share dashboard</Tooltip.Content>
<Tooltip.Content>{m.personal_files_share_tooltip()}</Tooltip.Content>
</Tooltip.Root>
{/snippet}
</Popover.Trigger>
<Popover.Content align="end">
{#if shared}
This dashboard is shared with all users in the project.
{m.personal_files_share_shared_message()}
{:else}
Share this dashboard with other users in the project?
{m.personal_files_share_prompt()}
{/if}

<div class="flex pt-2">
Expand All @@ -99,7 +102,9 @@
{loading}
disabled={loading}
>
{shared ? "Hide" : "Share"}
{shared
? m.personal_files_share_hide_button()
: m.personal_files_share_button()}
</Button>
</div>
</Popover.Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import { setCanvasMode } from "@rilldata/web-admin/features/personal-files/canvas/mode-utils.ts";
import Switch from "@rilldata/web-common/components/forms/Switch.svelte";
import Label from "@rilldata/web-common/components/forms/Label.svelte";
import { m } from "@rilldata/web-common/lib/i18n/gen/messages";

let {
org,
Expand Down Expand Up @@ -54,11 +55,12 @@

const schema = yup(
object({
name: string().trim().required("Name is required"),
name: string().trim().required(m.personal_files_create_name_required()),
copy: boolean(),
copySource: string().when("copy", {
is: true,
then: (schema) => schema.required("Copy source is required"),
then: (schema) =>
schema.required(m.personal_files_create_copy_source_required()),
otherwise: (schema) => schema.notRequired(),
}),
}),
Expand Down Expand Up @@ -136,15 +138,16 @@
<Dialog.Root bind:open>
<Dialog.Trigger>
{#snippet child({ props })}
<Button {...props} type="primary">Create dashboard</Button>
<Button {...props} type="primary">
{m.personal_files_create_trigger()}
</Button>
{/snippet}
</Dialog.Trigger>
<Dialog.Content class="top-[30%] translate-y-0">
<Dialog.Header>
<Dialog.Title>Create personal dashboard</Dialog.Title>
<Dialog.Title>{m.personal_files_create_title()}</Dialog.Title>
<Dialog.Description>
Personal dashboards are only visible to you. They live alongside the
project but never sync to git.
{m.personal_files_create_description()}
</Dialog.Description>
</Dialog.Header>

Expand All @@ -160,23 +163,27 @@
<Input
bind:value={$form.name}
id="name"
label="Display name"
placeholder="e.g. My revenue dashboard"
label={m.personal_files_create_name_label()}
placeholder={m.personal_files_create_name_placeholder()}
/>

{#if personalCanvasOptions.length}
<div class="flex items-center space-x-2">
<Switch bind:checked={$form["copy"]} id="copy" label="Copy from" />
<Switch
bind:checked={$form["copy"]}
id="copy"
label={m.personal_files_create_copy_label()}
/>
<Label class="font-normal flex gap-x-1 items-center" for="copy">
Start from an existing dashboard
{m.personal_files_create_copy_hint()}
</Label>
</div>

{#if $form.copy}
<Select
bind:value={$form.copySource}
id="source"
placeholder="Select a dashboard..."
placeholder={m.personal_files_create_copy_source_placeholder()}
options={personalCanvasOptions}
optionsLoading={$personalCanvasesQuery.isPending}
sameWidth
Expand All @@ -191,15 +198,17 @@
</form>

<Dialog.Footer>
<Button type="secondary" onClick={() => (open = false)}>Cancel</Button>
<Button type="secondary" onClick={() => (open = false)}>
{m.personal_files_create_cancel()}
</Button>
<Button
type="primary"
onClick={submit}
loading={$submitting}
loadingCopy="Creating..."
loadingCopy={m.personal_files_create_submitting()}
disabled={$submitting}
>
Create
{m.personal_files_create_submit()}
</Button>
</Dialog.Footer>
</Dialog.Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import PersonalCanvasCompositeCell from "@rilldata/web-admin/features/personal-files/canvas/PersonalCanvasCompositeCell.svelte";
import { getPersonalFilteredResources } from "@rilldata/web-admin/features/personal-files/selectors.ts";
import { ResourceKind } from "@rilldata/web-common/features/entity-management/resource-selectors.ts";
import { m } from "@rilldata/web-common/lib/i18n/gen/messages";

let {
org,
Expand Down Expand Up @@ -68,8 +69,10 @@
<header class="flex items-center justify-between">
<div class="flex items-center gap-2">
<Lock size="16px" />
<h2 class="text-lg font-medium">My dashboards</h2>
<span class="text-sm text-fg-secondary">Only visible to you</span>
<h2 class="text-lg font-medium">{m.personal_files_canvases_title()}</h2>
<span class="text-sm text-fg-secondary">
{m.personal_files_canvases_visibility_hint()}
</span>
</div>
<CreatePersonalCanvasDialog {org} {project} />
</header>
Expand All @@ -89,10 +92,10 @@
<ResourceListEmptyState
slot="empty"
icon={ExploreIcon}
message="You don't have any personal canvases yet."
message={m.personal_files_canvases_empty_message()}
>
<span slot="action">
Create one to explore the project's data your way.
{m.personal_files_canvases_empty_action()}
</span>
</ResourceListEmptyState>
</ResourceList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import { overlay } from "@rilldata/web-common/layout/overlay-store";
import BlockingOverlayContainer from "@rilldata/web-common/layout/BlockingOverlayContainer.svelte";
import { fileArtifacts } from "@rilldata/web-common/features/entity-management/file-artifacts.ts";
import { m } from "@rilldata/web-common/lib/i18n/gen/messages";

$: organization = $page.params.organization;
$: project = $page.params.project;
Expand Down Expand Up @@ -245,13 +246,14 @@

{#snippet envEditDisabled()}
<div class="flex flex-row gap-2 items-center w-fit text-sm">
<InfoIcon size={14} /> Manage environment variables in
<InfoIcon size={14} />
{m.edit_env_manage_in_settings()}
<a
href="/{organization}/{project}/-/settings/environment-variables"
target="_blank"
rel="noopener"
>
Settings →
{m.edit_env_settings_link()}
</a>
</div>
{/snippet}
Expand Down
26 changes: 26 additions & 0 deletions web-common/src/lib/i18n/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,8 @@
"edit_continue_editing": "Continue editing",
"edit_create_and_edit": "Create & edit",
"edit_describe_changes": "Describe your changes...",
"edit_env_manage_in_settings": "Manage environment variables in",
"edit_env_settings_link": "Settings →",
"edit_existing_branch": "Existing branch",
"edit_exit": "Exit",
"edit_failed_to_commit": "Failed to commit and push changes",
Expand Down Expand Up @@ -1467,7 +1469,31 @@
],
"pivot_unexpected_query_error": "Sorry, unexpected query error!",
"personal_files_canvas_visibility": "Personal — only you can see this",
"personal_files_canvases_empty_action": "Create one to explore the project's data your way.",
"personal_files_canvases_empty_message": "You don't have any personal canvases yet.",
"personal_files_canvases_title": "My dashboards",
"personal_files_canvases_visibility_hint": "Only visible to you",
"personal_files_create_cancel": "Cancel",
"personal_files_create_copy_hint": "Start from an existing dashboard",
"personal_files_create_copy_label": "Copy from",
"personal_files_create_copy_source_placeholder": "Select a dashboard...",
"personal_files_create_copy_source_required": "Copy source is required",
"personal_files_create_description": "Personal dashboards are only visible to you. They live alongside the project but never sync to git.",
"personal_files_create_name_label": "Display name",
"personal_files_create_name_placeholder": "e.g. My revenue dashboard",
"personal_files_create_name_required": "Name is required",
"personal_files_create_submit": "Create",
"personal_files_create_submitting": "Creating...",
"personal_files_create_title": "Create personal dashboard",
"personal_files_create_trigger": "Create dashboard",
"personal_files_dashboard_deleted_notification": "Dashboard {name} deleted successfully",
"personal_files_share_button": "Share",
"personal_files_share_hidden_notification": "Dashboard hidden successfully",
"personal_files_share_hide_button": "Hide",
"personal_files_share_prompt": "Share this dashboard with other users in the project?",
"personal_files_share_shared_message": "This dashboard is shared with all users in the project.",
"personal_files_share_shared_notification": "Dashboard shared successfully",
"personal_files_share_tooltip": "Share dashboard",
"project_branch_hibernated": "Branch hibernated",
"project_branch_is_hibernated": "This branch is hibernated.",
"project_card_visibility_private": "This project is private",
Expand Down
26 changes: 26 additions & 0 deletions web-common/src/lib/i18n/messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,8 @@
"edit_continue_editing": "Continuar editando",
"edit_create_and_edit": "Crear y editar",
"edit_describe_changes": "Describe tus cambios...",
"edit_env_manage_in_settings": "Gestiona las variables de entorno en",
"edit_env_settings_link": "Configuración →",
"edit_existing_branch": "Rama existente",
"edit_exit": "Salir",
"edit_failed_to_commit": "Error al confirmar y enviar los cambios",
Expand Down Expand Up @@ -1476,7 +1478,31 @@
],
"pivot_unexpected_query_error": "¡Lo sentimos, error inesperado en la consulta!",
"personal_files_canvas_visibility": "Personal — solo tú puedes verlo",
"personal_files_canvases_empty_action": "Crea uno para explorar los datos del proyecto a tu manera.",
"personal_files_canvases_empty_message": "Aún no tienes ningún canvas personal.",
"personal_files_canvases_title": "Mis dashboards",
"personal_files_canvases_visibility_hint": "Solo visible para ti",
"personal_files_create_cancel": "Cancelar",
"personal_files_create_copy_hint": "Partir de un dashboard existente",
"personal_files_create_copy_label": "Copiar de",
"personal_files_create_copy_source_placeholder": "Selecciona un dashboard...",
"personal_files_create_copy_source_required": "Hay que indicar el dashboard de origen",
"personal_files_create_description": "Los dashboards personales solo son visibles para ti. Conviven con el proyecto, pero nunca se sincronizan con git.",
"personal_files_create_name_label": "Nombre visible",
"personal_files_create_name_placeholder": "p. ej. Mi dashboard de ingresos",
"personal_files_create_name_required": "El nombre es obligatorio",
"personal_files_create_submit": "Crear",
"personal_files_create_submitting": "Creando...",
"personal_files_create_title": "Crear dashboard personal",
"personal_files_create_trigger": "Crear dashboard",
"personal_files_dashboard_deleted_notification": "Dashboard {name} eliminado correctamente",
"personal_files_share_button": "Compartir",
"personal_files_share_hidden_notification": "Dashboard ocultado correctamente",
"personal_files_share_hide_button": "Ocultar",
"personal_files_share_prompt": "¿Compartir este dashboard con el resto de usuarios del proyecto?",
"personal_files_share_shared_message": "Este dashboard está compartido con todos los usuarios del proyecto.",
"personal_files_share_shared_notification": "Dashboard compartido correctamente",
"personal_files_share_tooltip": "Compartir dashboard",
"project_branch_hibernated": "Rama en hibernación",
"project_branch_is_hibernated": "Esta rama está en hibernación.",
"project_card_visibility_private": "Este proyecto es privado",
Expand Down
Loading