-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Environment variables management (#6012)
* initial setup * clean up * more layout * empty state touch up * wip * key and activity cell * nit * add dialog wip * value cell * add and delete kv field * actions cell, edit, delete dialog * wip add new variable * delete dialog * environment types * add multiple variables, handle empty value cell * filter by environment dropdown * trigger text * slight uxqa, reset form variables on outside click * edit dialog wip * wip edit * check for key already exists * fix add dialog errors * file upload .env * unused * fix dup form id * lint * copy treatment for value cell * cast input element to event * disable create when no new changes * omit empty variables * omit draft vars without key * polish add dialog * pitstop * fix process env in add dialog * allow to set the correct initial environments in edit dialog * wip * truncate value cell * has changes, update project variables based on feedback * no unchecked env checkboxes * wip * pass environment in when unsetting variable * check for dups when key is modified in edit dialog * error input wrapper on edit key * fix * clean up * validate special chars, use reset from superform * special char error message * update errors index for error message * consistent eye icons in value cell * update activity cell * add dialog tweaks * feedback * filter out empty kv pair when parsing file * scrollable in add dialog * trim comments when parsing, edit error input wrapper style * fix handle remove * dropdown environment filter * sorted, singular, clean up * tooltip title in activity cell
- Loading branch information
1 parent
515fd22
commit 38ff70e
Showing
22 changed files
with
1,397 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,6 @@ | |
widthPercent: 5, | ||
}, | ||
}, | ||
{ | ||
accessorKey: "roleName", | ||
header: "Role", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
web-admin/src/features/projects/environment-variables/ActionsCell.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<script lang="ts"> | ||
import IconButton from "@rilldata/web-common/components/button/IconButton.svelte"; | ||
import * as DropdownMenu from "@rilldata/web-common/components/dropdown-menu"; | ||
import ThreeDot from "@rilldata/web-common/components/icons/ThreeDot.svelte"; | ||
import { Trash2Icon, Pencil } from "lucide-svelte"; | ||
import EditDialog from "./EditDialog.svelte"; | ||
import DeleteDialog from "./DeleteDialog.svelte"; | ||
export let id: string; | ||
export let environment: string; | ||
export let name: string; | ||
export let value: string; | ||
export let variableNames: string[] = []; | ||
let isDropdownOpen = false; | ||
let isEditDialogOpen = false; | ||
let isDeleteDialogOpen = false; | ||
</script> | ||
|
||
<DropdownMenu.Root bind:open={isDropdownOpen}> | ||
<DropdownMenu.Trigger class="flex-none"> | ||
<IconButton rounded active={isDropdownOpen}> | ||
<ThreeDot size="16px" /> | ||
</IconButton> | ||
</DropdownMenu.Trigger> | ||
<DropdownMenu.Content align="start"> | ||
<DropdownMenu.Item | ||
class="font-normal flex items-center" | ||
on:click={() => { | ||
isEditDialogOpen = true; | ||
}} | ||
> | ||
<Pencil size="12px" /> | ||
<span class="ml-2">Edit</span> | ||
</DropdownMenu.Item> | ||
<DropdownMenu.Item | ||
class="font-normal flex items-center" | ||
type="destructive" | ||
on:click={() => { | ||
isDeleteDialogOpen = true; | ||
}} | ||
> | ||
<Trash2Icon size="12px" /> | ||
<span class="ml-2">Delete</span> | ||
</DropdownMenu.Item> | ||
</DropdownMenu.Content> | ||
</DropdownMenu.Root> | ||
|
||
<EditDialog | ||
bind:open={isEditDialogOpen} | ||
{id} | ||
{environment} | ||
{name} | ||
{value} | ||
{variableNames} | ||
/> | ||
<DeleteDialog bind:open={isDeleteDialogOpen} {name} {environment} /> |
31 changes: 31 additions & 0 deletions
31
web-admin/src/features/projects/environment-variables/ActivityCell.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script lang="ts"> | ||
import Tooltip from "@rilldata/web-common/components/tooltip/Tooltip.svelte"; | ||
import TooltipContent from "@rilldata/web-common/components/tooltip/TooltipContent.svelte"; | ||
import { timeAgo } from "../../dashboards/listing/utils"; | ||
export let updatedOn: string; | ||
function formatText() { | ||
const updatedDate = new Date(updatedOn); | ||
// FIXME: `updateProjectVariables` does not update the `updatedOn` timestamp correctly | ||
// if (createdDate.getTime() === updatedDate.getTime()) { | ||
// return `Added ${timeAgo(createdDate)}`; | ||
// } | ||
return `Updated ${timeAgo(updatedDate)}`; | ||
} | ||
$: formattedText = formatText(); | ||
</script> | ||
|
||
<Tooltip distance={8} location="top" alignment="start"> | ||
<div class="text-xs text-gray-500 cursor-pointer"> | ||
{formattedText} | ||
</div> | ||
<TooltipContent slot="tooltip-content"> | ||
<span class="text-xs text-gray-50 font-medium" | ||
>{new Date(updatedOn).toLocaleString()}</span | ||
> | ||
</TooltipContent> | ||
</Tooltip> |
Oops, something went wrong.
38ff70e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://ui.rilldata.in as production
🚀 Deployed on https://673e83f0b16aa5afa8763d40--rill-ui-dev.netlify.app