From 7850bb842d1c453b47f3e741e6e1ef1e47c199e3 Mon Sep 17 00:00:00 2001 From: Wojciech Grzeszczak Date: Tue, 1 Apr 2025 11:10:07 +0200 Subject: [PATCH 01/31] Delete user action --- gui/next/src/lib/api/user.js | 15 ++++- gui/next/src/lib/state.js | 4 +- gui/next/src/lib/users/ContextMenu.svelte | 82 +++++++++++++++++++++++ gui/next/src/lib/users/Delete.svelte | 59 ++++++++++++++++ gui/next/src/routes/users/+layout.svelte | 68 +++++++++++-------- 5 files changed, 197 insertions(+), 31 deletions(-) create mode 100644 gui/next/src/lib/users/ContextMenu.svelte create mode 100644 gui/next/src/lib/users/Delete.svelte diff --git a/gui/next/src/lib/api/user.js b/gui/next/src/lib/api/user.js index 266372f1..db653939 100644 --- a/gui/next/src/lib/api/user.js +++ b/gui/next/src/lib/api/user.js @@ -70,8 +70,21 @@ const user = { }`; return graphql({ query }, false).then(data => data.users ); - } + }, + // purpose: delete users from the database + // arguments: + // id of the user (int) + // ------------------------------------------------------------------------ + delete: async (id) => { + const query = ` + mutation { + user_delete(id: ${id}){ id } + } + `; + + return graphql({ query }, false) + } }; diff --git a/gui/next/src/lib/state.js b/gui/next/src/lib/state.js index 101184f8..d817a211 100644 --- a/gui/next/src/lib/state.js +++ b/gui/next/src/lib/state.js @@ -73,8 +73,8 @@ function createStore(){ state.notifications = []; // width of the aside panel in css units (string) state.asideWidth = browser && localStorage.asideWidth ? localStorage.asideWidth : false; - - + // list of users + state.users = [] // purpose: creates the store with data provided in state object // ------------------------------------------------------------------------ diff --git a/gui/next/src/lib/users/ContextMenu.svelte b/gui/next/src/lib/users/ContextMenu.svelte new file mode 100644 index 00000000..81a730be --- /dev/null +++ b/gui/next/src/lib/users/ContextMenu.svelte @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + dispatch('close')}> +
    +
  • + dispatch('reload')} on:close={() => dispatch('close')} /> +
  • +
+
diff --git a/gui/next/src/lib/users/Delete.svelte b/gui/next/src/lib/users/Delete.svelte new file mode 100644 index 00000000..eca3a84f --- /dev/null +++ b/gui/next/src/lib/users/Delete.svelte @@ -0,0 +1,59 @@ + + + + + + + + + + +
+ + +
diff --git a/gui/next/src/routes/users/+layout.svelte b/gui/next/src/routes/users/+layout.svelte index 67824f99..43a007e4 100644 --- a/gui/next/src/routes/users/+layout.svelte +++ b/gui/next/src/routes/users/+layout.svelte @@ -9,6 +9,7 @@ import { state } from '$lib/state.js'; import { quintOut } from 'svelte/easing'; import { page } from '$app/stores'; import { user } from '$lib/api/user.js'; +import ContextMenu from '$lib/users/ContextMenu.svelte'; import Icon from '$lib/ui/Icon.svelte'; import Number from '$lib/ui/forms/Number.svelte'; @@ -36,15 +37,22 @@ let filters = { ...Object.fromEntries($page.url.searchParams) }; +let contextMenu = { + // item id for which the context menu is opened for + id: null +}; // purpose: load data each time query params change // ------------------------------------------------------------------------ -$: user.get(Object.fromEntries($page.url.searchParams)).then(data => { - items = data.results; - filters.totalPages = data.total_pages; -}); +$: reloadUsers(); +const reloadUsers = function() { + user.get(Object.fromEntries($page.url.searchParams)).then(data => { + items = data.results; + filters.totalPages = data.total_pages; + }); +} // transition: zooms from nothing to full size // options: delay (int), duration (int) @@ -86,13 +94,6 @@ const appear = function(node, { grid-template-rows: min-content 1fr; } - .content { - height: 100%; - min-height: 0; - overflow: auto; - } - - /* filters */ .filters { padding: var(--space-navigation); @@ -162,11 +163,6 @@ const appear = function(node, { -webkit-backdrop-filter: blur(17px); } - .pagination .info { - cursor: help; - } - - /* content table */ table { min-width: 100%; @@ -184,21 +180,21 @@ const appear = function(node, { } th, - td > a { + td > a, td > span { padding: var(--space-table) calc(var(--space-navigation) * 1.5); } th:first-child, - td:first-child > a { + td:first-child > a, td:first-child > span { padding-inline-start: var(--space-navigation); } th:last-child, - td:last-child > a { + td:last-child > a, td:last-child > span { padding-inline-end: var(--space-navigation); } - td > a { + td > a, td > span { display: block; } @@ -206,10 +202,6 @@ const appear = function(node, { border: 0; } - .highlight td { - background-color: var(--color-highlight); - } - tr { position: relative; } @@ -243,12 +235,18 @@ const appear = function(node, { } .table-id { - width: 1%; - - text-align: end; font-variant-numeric: tabular-nums; + width: 150px; + } + + .menu { + position: relative; + width: 30px; + } + + .menu button.active { + border-end-start-radius: 0; } - @@ -297,6 +295,7 @@ const appear = function(node, { + @@ -307,6 +306,19 @@ const appear = function(node, { + @@ -337,22 +374,28 @@ const appear = function(node, { @@ -361,4 +404,9 @@ const appear = function(node, { {/if} +{#if $state.user !== undefined} + reloadUsers() } /> +{/if} + + diff --git a/gui/next/src/style/forms.css b/gui/next/src/style/forms.css index 97505b32..50de1dec 100644 --- a/gui/next/src/style/forms.css +++ b/gui/next/src/style/forms.css @@ -8,6 +8,8 @@ input[type="text"], +input[type="password"], +input[type="email"], input[type="number"], input[type="date"], select, From 2f16409b404da7eb79fcddb25cce97f1c9a41811 Mon Sep 17 00:00:00 2001 From: Wojciech Grzeszczak Date: Wed, 14 May 2025 08:30:39 +0200 Subject: [PATCH 04/31] cli changes --- gui/next/src/lib/api/record.js | 120 +--------------- gui/next/src/lib/api/user.js | 67 ++++----- .../lib/helpers/buildMutationIngredients.js | 114 +++++++++++++++ gui/next/src/lib/ui/Aside.svelte | 2 +- gui/next/src/lib/users/Create.svelte | 133 ++++++++++++------ gui/next/src/routes/users/+layout.svelte | 22 ++- 6 files changed, 252 insertions(+), 206 deletions(-) create mode 100644 gui/next/src/lib/helpers/buildMutationIngredients.js diff --git a/gui/next/src/lib/api/record.js b/gui/next/src/lib/api/record.js index 161166e9..36c79378 100644 --- a/gui/next/src/lib/api/record.js +++ b/gui/next/src/lib/api/record.js @@ -7,36 +7,7 @@ // ------------------------------------------------------------------------ import { graphql } from '$lib/api/graphql'; import { state } from '$lib/state'; - - - -// purpose: maps column types to corresponding property type used in GraphQL string -// ------------------------------------------------------------------------ -const columnTypeToPropertyType = { - array: 'value_array', - boolean: 'value_boolean', - date: 'value', - datetime: 'value', - float: 'value_float', - integer: 'value_int', - string: 'value', - text: 'value', - upload: 'value', - json: 'value_json' -}; - -// purpose: maps column types to corresponding variable type used in GraphQL variables definition -// ------------------------------------------------------------------------ -const columnTypeToVariableType = { - string: 'String', - integer: 'Int', - float: 'Float', - boolean: 'Boolean', - array: '[String!]', - json: 'JSONPayload', - range: 'RangeFilter' -}; - +import { buildMutationIngredients, columnTypeToVariableType } from '$lib/helpers/buildMutationIngredients'; // purpose: build the strings and objects needed to pass with GraphQL request to filter the properties @@ -135,95 +106,6 @@ const buildQueryIngredients = (filters = []) => { }; - -// purpose: builds all the needed data to build and trigger GraphQL mutation -// arguments: FormData object with the column, type and value (column[value], column[type]) -// returns: variablesDefinition (string) - GraphQL variables definitions $variable: Type -// variables (object) - values for defined variables passed to GraphQL API -// properties (string) - list of GraphQL properties for given variables to use inside "properties: []" -// ------------------------------------------------------------------------ -const buildMutationIngredients = (formData) => { - - // entries from the form (object) - const formEntries = formData.entries(); - // graphql variables definition for the query (string) - let variablesDefinition = ''; - // variables passed with the query (object) - let variables = {}; - // properties list with variables as their value passed with the query (string) - let properties = ''; - // helper object that will store the column name with all it's corresponding propertiest needed to pass to graphql (object) - let columns = {}; - - // values we are getting from FormData are strings, this will parse them depending on the column type we are taking them from - function parseValue(type, value){ - if(value === ''){ - return null; - } - - if(type === 'integer'){ - return parseInt(value); - } - - if(type === 'float'){ - return parseFloat(value); - } - - if(type === 'boolean'){ - if(value === 'true'){ - return true; - } else { - return false; - } - } - - if(type === 'array'){ - return JSON.parse(value); - } - - if(type === 'json'){ - return JSON.parse(value); - } - - return value; - }; - - // parse FormData entries to an `columns` object - for(const [entry, value] of formEntries){ - // do it only for FormData entries related to columns - if(entry.indexOf('[') >= 0){ - // get the column name from FormData - let column = entry.slice(0, entry.indexOf('[')); - // get the column properties names like the 'type' and 'value' - let property = entry.slice(entry.indexOf('[')+1, entry.indexOf(']')); - - // build an object like: column_name = { type: 'type', value: 'value' } - (columns[column] ??= {})[property] = value; - } - }; - - // for each edited column build the needed strings and add the value to `variables` - for(const column in columns){ - variablesDefinition += `, $${column}: ${columnTypeToVariableType[columns[column].type] || 'String'}`; - - variables[column] = parseValue(columns[column].type, columns[column].value); - - properties += `{ name: "${column}", ${columnTypeToPropertyType[columns[column].type]}: $${column} }`; - } - - - // build the final variables definition string with all the needed variables and their types - if(variablesDefinition.length){ - variablesDefinition = variablesDefinition.slice(2); // remove first comma ', ' - variablesDefinition = `(${variablesDefinition})`; // add brackets to definition string - } - - return { variablesDefinition, variables, properties } - -}; - - - const record = { // purpose: gets records from the database for fiven table id diff --git a/gui/next/src/lib/api/user.js b/gui/next/src/lib/api/user.js index 08bead6c..e89a05c0 100644 --- a/gui/next/src/lib/api/user.js +++ b/gui/next/src/lib/api/user.js @@ -6,8 +6,7 @@ // imports // ------------------------------------------------------------------------ import { graphql } from '$lib/api/graphql'; -import { v4 } from 'uuid' - +import { buildMutationIngredients } from '$lib/helpers/buildMutationIngredients'; const user = { @@ -54,7 +53,7 @@ const user = { users( page: ${filters?.page ?? 1} per_page: 50 - sort: { id: { order: ASC } } + sort: { id: { order: DESC } } filter: { ${filtersString} } @@ -88,56 +87,40 @@ const user = { // purpose: creates a new user // arguments: - // properties: object containing first_name, last_name, email i password + // properties: object containing first_name, last_name, properties // returns: id of the new user // ------------------------------------------------------------------------ - create: async (email, password, firstName, lastName) => { + create: async (email, password, properties) => { + const ingredients = buildMutationIngredients(properties); const userQuery = ` - mutation { - user: user_create(user: { email: "${email}", password: "${password}", properties: []}) { + mutation${ingredients.variablesDefinition} { + user: user_create(user: { email: "${email}", password: "${password}", properties: [${ingredients.properties}] }) { id } } `; - return graphql({ query: userQuery }, false).then(data => { - if (data.errors) { - return data - } - const userId = data.user.id; - const name = `${firstName} ${lastName}`; - - const names = Array.from(new Set( - [email.toLowerCase(), firstName.toLowerCase(), lastName.toLowerCase()] - )).join(' '); - - const profileQuery = ` - mutation { - record: record_create( - record: { - table: "modules/user/profile" - properties: [ - { name: "user_id", value: "${userId}" } - { name: "uuid", value: "${v4()}" } - { name: "first_name", value: "${firstName}" } - { name: "last_name", value: "${lastName}" } - { name: "name", value: "${name}" } - { name: "email", value: "${email}" } - { name: "roles", value_array: ["member"] } - { name: "c__names", value: "${names}" } - ] - } - ) { - id - } - } - `; - - return graphql({query: profileQuery }, false).then(() => userId); - }); + return graphql({ query: userQuery, variables: ingredients.variables }, false); }, + // purpose: returns custom properies of the user schema + // arguments: + // returns: list of properties + // ------------------------------------------------------------------------ + getCustomProperties: async () => { + const propertiesQuery = ` + query { + admin_user_schema { + properties { + attribute_type + name + } + } + } + `; + return graphql({ query: propertiesQuery }, false).then(data => data.admin_user_schema.properties); + } }; diff --git a/gui/next/src/lib/helpers/buildMutationIngredients.js b/gui/next/src/lib/helpers/buildMutationIngredients.js new file mode 100644 index 00000000..9c2e5262 --- /dev/null +++ b/gui/next/src/lib/helpers/buildMutationIngredients.js @@ -0,0 +1,114 @@ + +// purpose: maps column types to corresponding property type used in GraphQL string +// ------------------------------------------------------------------------ +export const columnTypeToPropertyType = { + array: 'value_array', + boolean: 'value_boolean', + date: 'value', + datetime: 'value', + float: 'value_float', + integer: 'value_int', + string: 'value', + text: 'value', + upload: 'value', + json: 'value_json' +}; + + +// purpose: maps column types to corresponding variable type used in GraphQL variables definition +// ------------------------------------------------------------------------ +export const columnTypeToVariableType = { + string: 'String', + integer: 'Int', + float: 'Float', + boolean: 'Boolean', + array: '[String!]', + json: 'JSONPayload', + range: 'RangeFilter' +}; + +// purpose: builds all the needed data to build and trigger GraphQL mutation +// arguments: FormData object with the column, type and value (column[value], column[type]) +// returns: variablesDefinition (string) - GraphQL variables definitions $variable: Type +// variables (object) - values for defined variables passed to GraphQL API +// properties (string) - list of GraphQL properties for given variables to use inside "properties: []" +// ------------------------------------------------------------------------ +export const buildMutationIngredients = (formData) => { + + // entries from the form (object) + const formEntries = formData.entries(); + // graphql variables definition for the query (string) + let variablesDefinition = ''; + // variables passed with the query (object) + let variables = {}; + // properties list with variables as their value passed with the query (string) + let properties = ''; + // helper object that will store the column name with all it's corresponding propertiest needed to pass to graphql (object) + let columns = {}; + + // values we are getting from FormData are strings, this will parse them depending on the column type we are taking them from + function parseValue(type, value){ + if(value === ''){ + return null; + } + + if(type === 'integer'){ + return parseInt(value); + } + + if(type === 'float'){ + return parseFloat(value); + } + + if(type === 'boolean'){ + if(value === 'true'){ + return true; + } else { + return false; + } + } + + if(type === 'array'){ + return JSON.parse(value); + } + + if(type === 'json'){ + return JSON.parse(value); + } + + return value; + }; + + // parse FormData entries to an `columns` object + for(const [entry, value] of formEntries){ + // do it only for FormData entries related to columns + if(entry.indexOf('[') >= 0){ + // get the column name from FormData + let column = entry.slice(0, entry.indexOf('[')); + // get the column properties names like the 'type' and 'value' + let property = entry.slice(entry.indexOf('[')+1, entry.indexOf(']')); + + // build an object like: column_name = { type: 'type', value: 'value' } + (columns[column] ??= {})[property] = value; + } + }; + + // for each edited column build the needed strings and add the value to `variables` + for(const column in columns){ + variablesDefinition += `, $${column}: ${columnTypeToVariableType[columns[column].type] || 'String'}`; + + variables[column] = parseValue(columns[column].type, columns[column].value); + + properties += `{ name: "${column}", ${columnTypeToPropertyType[columns[column].type]}: $${column} }`; + } + + + // build the final variables definition string with all the needed variables and their types + if(variablesDefinition.length){ + variablesDefinition = variablesDefinition.slice(2); // remove first comma ', ' + variablesDefinition = `(${variablesDefinition})`; // add brackets to definition string + } + + return { variablesDefinition, variables, properties } + +}; \ No newline at end of file diff --git a/gui/next/src/lib/ui/Aside.svelte b/gui/next/src/lib/ui/Aside.svelte index fd727e8b..202922fe 100644 --- a/gui/next/src/lib/ui/Aside.svelte +++ b/gui/next/src/lib/ui/Aside.svelte @@ -88,7 +88,7 @@ aside { position: relative; overflow: hidden; display: flex; - + background-color: var(--color-page); border-inline-start: 1px solid var(--color-frame); } diff --git a/gui/next/src/lib/users/Create.svelte b/gui/next/src/lib/users/Create.svelte index fef88333..5c5ae051 100644 --- a/gui/next/src/lib/users/Create.svelte +++ b/gui/next/src/lib/users/Create.svelte @@ -7,7 +7,10 @@ import { onMount, createEventDispatcher } from 'svelte'; import { quintOut } from 'svelte/easing'; import { state } from '$lib/state.js'; import { user } from '$lib/api/user.js'; +import autosize from 'svelte-autosize'; + import Icon from '$lib/ui/Icon.svelte'; +import Toggle from '$lib/ui/forms/Toggle.svelte'; // properties @@ -18,6 +21,10 @@ let container; let form; // list of errors for the current form taken from back-end (array of objects) let errors = []; +// list of inline validation errors for the current form (object) +let validation = {}; +// list of user properties or null +export let userProperties; const dispatch = createEventDispatcher(); @@ -67,16 +74,36 @@ const save = async (event) => { // form data as object with properties const properties = new FormData(form); // create new record - if($state.user === null){ - const create = await user.create( - properties.get("email"), - properties.get("password"), - properties.get("firstName"), - properties.get("lastName") - ); + + validation = {}; + + for(const property of properties.entries()){ + if(property[0].endsWith('[type]')){ + if(property[1] === 'json' || property[1] === 'array'){ + const propertyName = property[0].replace('[type]', ''); + const propertyValue = properties.get(propertyName + '[value]') + if(propertyValue !== '' && !tryParseJSON(propertyValue)){ + validation[propertyName] = { property: propertyName, message: `Not a valid ${property[1]}` }; + } + } + } + } + + if(Object.keys(validation).length){ + + // if there is an inline validation error, scroll to it + await tick(); + document.querySelector('[role="alert"]:not(:empty)').scrollIntoView({behavior: 'smooth', block: 'center'}) + + } else { + const email = properties.get('email'); + const password = properties.get('password'); + properties.delete('email'); + properties.delete('password'); + const create = await user.create(email, password, properties); if(!create.errors){ $state.user = undefined; - state.notification.create('success', `User ${create} created`); + state.notification.create('success', `User ${create.user.id} created`); dispatch('success'); } else { @@ -137,9 +164,10 @@ label { word-break: break-all; } -input { +input, +textarea { width: 100%; - max-height: 40rem; + min-height: 53px; } [role="alert"]:not(:empty) { @@ -189,6 +217,13 @@ input { justify-content: space-between; } +.type { + margin-block-start: .2rem; + opacity: .5; + + font-size: .9em; +} + @@ -199,38 +234,13 @@ input {
-
- - - -
- -
-
-
- - - -
- -
-
@@ -245,6 +255,9 @@ input {
@@ -255,12 +268,52 @@ input { />
- + {#each userProperties as property} + {@const value = {type: property.attribute_type, value: ''}} +
+ + + +
+ {#if property.attribute_type === 'boolean'} + + {:else} + + {/if} +
+ {#if validation[property.name]} + {validation[property.name].message} + {/if} +
+
+
+ {/each} - @@ -405,7 +419,7 @@ const appear = function(node, { {/if} {#if $state.user !== undefined} - reloadUsers() } /> + reloadUsers() } /> {/if} From 96262e78bddb20c7e0da07ad64aa2efd1a1380ca Mon Sep 17 00:00:00 2001 From: Wojciech Grzeszczak Date: Wed, 14 May 2025 09:56:27 +0200 Subject: [PATCH 05/31] Package.json --- gui/next/package-lock.json | 16 +--------------- gui/next/package.json | 3 +-- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/gui/next/package-lock.json b/gui/next/package-lock.json index 5fa7bd3c..cbdc86de 100644 --- a/gui/next/package-lock.json +++ b/gui/next/package-lock.json @@ -9,8 +9,7 @@ "version": "0.0.1", "dependencies": { "svelte-autosize": "^1.1.0", - "svelte-json-tree": "^2.2.0", - "uuid": "^11.1.0" + "svelte-json-tree": "^2.2.0" }, "devDependencies": { "@playwright/test": "^1.48.2", @@ -636,19 +635,6 @@ "node": ">=6" } }, - "node_modules/uuid": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", - "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/esm/bin/uuid" - } - }, "node_modules/vite": { "version": "5.4.15", "dev": true, diff --git a/gui/next/package.json b/gui/next/package.json index b671bf37..8ddcf0c2 100644 --- a/gui/next/package.json +++ b/gui/next/package.json @@ -20,7 +20,6 @@ "type": "module", "dependencies": { "svelte-autosize": "^1.1.0", - "svelte-json-tree": "^2.2.0", - "uuid": "^11.1.0" + "svelte-json-tree": "^2.2.0" } } From 6b9916da893b1bcd56911e2b7241a3a24ee601e2 Mon Sep 17 00:00:00 2001 From: Wojciech Grzeszczak Date: Thu, 15 May 2025 10:57:48 +0200 Subject: [PATCH 06/31] Cleanup --- gui/next/src/routes/users/+layout.svelte | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gui/next/src/routes/users/+layout.svelte b/gui/next/src/routes/users/+layout.svelte index c65f5645..75fe1ee0 100644 --- a/gui/next/src/routes/users/+layout.svelte +++ b/gui/next/src/routes/users/+layout.svelte @@ -82,11 +82,10 @@ const appear = function(node, { const showCreateUserPopup = function() { if (userProperties === null) { user.getCustomProperties().then(properties => { - console.log(properties); userProperties = properties; $state.user = null; - }).catch(error => { - console.log(error); + }).catch(() => { + state.notification.create('error', 'Could not load table properties. Please try again later.'); }); } else { From be05aed6b0904b5fe5a60fd1c37535ee86b49948 Mon Sep 17 00:00:00 2001 From: Wojciech Grzeszczak Date: Fri, 16 May 2025 09:02:04 +0200 Subject: [PATCH 07/31] Editing users --- gui/next/src/lib/api/user.js | 22 +++++++++- gui/next/src/lib/parseValue.js | 1 + gui/next/src/lib/users/Create.svelte | 51 +++++++++++++++++------- gui/next/src/routes/users/+layout.svelte | 12 ++++-- 4 files changed, 67 insertions(+), 19 deletions(-) diff --git a/gui/next/src/lib/api/user.js b/gui/next/src/lib/api/user.js index e89a05c0..f2647a57 100644 --- a/gui/next/src/lib/api/user.js +++ b/gui/next/src/lib/api/user.js @@ -43,7 +43,6 @@ const user = { last_name slug language - properties `; } } @@ -64,6 +63,7 @@ const user = { id email ${details} + properties } } }`; @@ -103,6 +103,26 @@ const user = { return graphql({ query: userQuery, variables: ingredients.variables }, false); }, + // purpose: edits a user + // arguments: + // id: id of the user to modify + // email: email of the user + // properties: object containing additional custom properties + // returns: id of the new user + // ------------------------------------------------------------------------ + edit: async (id, email, properties) => { + const ingredients = buildMutationIngredients(properties); + const userQuery = ` + mutation${ingredients.variablesDefinition} { + user_update(user: { email: "${email}", properties: [${ingredients.properties}] }, id: ${id}) { + id + } + } + `; + + return graphql({ query: userQuery, variables: ingredients.variables }, false); + }, + // purpose: returns custom properies of the user schema // arguments: // returns: list of properties diff --git a/gui/next/src/lib/parseValue.js b/gui/next/src/lib/parseValue.js index 57654b66..92ce89c0 100644 --- a/gui/next/src/lib/parseValue.js +++ b/gui/next/src/lib/parseValue.js @@ -10,6 +10,7 @@ import { tryParseJSON } from '$lib/tryParseJSON.js'; // type of the value (string) // ------------------------------------------------------------------------ const parseValue = (value, type) => { + debugger let parsed = { value: value, type: type diff --git a/gui/next/src/lib/users/Create.svelte b/gui/next/src/lib/users/Create.svelte index 5c5ae051..bf70b8f9 100644 --- a/gui/next/src/lib/users/Create.svelte +++ b/gui/next/src/lib/users/Create.svelte @@ -7,7 +7,8 @@ import { onMount, createEventDispatcher } from 'svelte'; import { quintOut } from 'svelte/easing'; import { state } from '$lib/state.js'; import { user } from '$lib/api/user.js'; -import autosize from 'svelte-autosize'; +import { parseValue } from '$lib/parseValue.js'; +import { tryParseJSON } from '$lib/tryParseJSON.js'; import Icon from '$lib/ui/Icon.svelte'; import Toggle from '$lib/ui/forms/Toggle.svelte'; @@ -25,6 +26,10 @@ let errors = []; let validation = {}; // list of user properties or null export let userProperties; +// user to edit or null +export let userToEdit; +// if we should original values instead of parsed JSON for string types (bool) +let dontParseStringedJson = false; const dispatch = createEventDispatcher(); @@ -96,18 +101,33 @@ const save = async (event) => { document.querySelector('[role="alert"]:not(:empty)').scrollIntoView({behavior: 'smooth', block: 'center'}) } else { - const email = properties.get('email'); - const password = properties.get('password'); - properties.delete('email'); - properties.delete('password'); - const create = await user.create(email, password, properties); - if(!create.errors){ - $state.user = undefined; - state.notification.create('success', `User ${create.user.id} created`); - dispatch('success'); + if (userToEdit === null) { + const email = properties.get('email'); + const password = properties.get('password'); + properties.delete('email'); + properties.delete('password'); + const create = await user.create(email, password, properties); + if(!create.errors){ + $state.user = undefined; + state.notification.create('success', `User ${create.user.id} created`); + dispatch('success'); + } + else { + errors = create.errors; + } } else { - errors = create.errors; + const email = properties.get('email'); + properties.delete('email'); + const edit = await user.edit(userToEdit.id, email, properties); + if(!edit.errors){ + $state.user = undefined; + state.notification.create('success', `User ${edit.user_update.id} edited`); + dispatch('success'); + } + else { + errors = edit.errors; + } } } }; @@ -248,9 +268,11 @@ textarea { type="email" name="email" id="email" + value={userToEdit !== null ? userToEdit.email : ''} />
+ {#if userToEdit === null}
+ {/if} {#each userProperties as property} - {@const value = {type: property.attribute_type, value: ''}} + {@const value = userToEdit !== null ? parseValue(userToEdit.properties[property.name], property.attribute_type) : {type: property.attribute_type, value: ''}}
',I,w,L,j,se,ge="Page:",ae,d,N,g,G=l[3].totalPages+"",de,Ee,W,ne,ie,le,oe="Create a new user",Ne,Pe,$e,Ge,tt;We.title=e="Users"+((st=l[6].online)!=null&&st.MPKIT_URL?": "+l[6].online.MPKIT_URL.replace("https://",""):"");let X=l[3].value&&vt(l);$=new je({props:{icon:"arrowRight"}});let Q=l[1]&&ht(l);function yt(D){l[23](D)}let lt={form:"filters",name:"page",min:1,max:l[3].totalPages,step:1,decreaseLabel:"Previous page",increaseLabel:"Next page",style:"navigation"};l[3].page!==void 0&&(lt.value=l[3].page),d=new qt({props:lt}),Ue.push(()=>St(d,"value",yt)),d.$on("input",l[24]),ne=new je({props:{icon:"plus"}});let Z=l[5].params.id&&Et(l),x=l[6].user!==void 0&&$t(l);return{c(){a=A(),t=p("div"),s=p("section"),r=p("nav"),n=p("form"),f=p("label"),f.textContent=i,h=A(),m=p("fieldset"),c=p("select"),E=p("option"),E.textContent=T,y=p("option"),y.textContent=F,P=A(),k=p("input"),C=A(),X&&X.c(),J=A(),S=p("button"),R=p("span"),R.textContent=z,U=A(),me($.$$.fragment),V=A(),K=p("article"),q=p("table"),B=p("thead"),B.innerHTML=Y,I=A(),Q&&Q.c(),w=A(),L=p("nav"),j=p("div"),se=p("label"),se.textContent=ge,ae=A(),me(d.$$.fragment),g=fe(`\r + of `),de=fe(G),Ee=A(),W=p("button"),me(ne.$$.fragment),ie=A(),le=p("span"),le.textContent=oe,Ne=A(),Z&&Z.c(),Pe=A(),x&&x.c(),this.h()},l(D){wt("svelte-mcmxo",We.head).forEach(_),a=M(D),t=v(D,"DIV",{class:!0});var be=b(t);s=v(be,"SECTION",{class:!0});var ke=b(s);r=v(ke,"NAV",{class:!0});var at=b(r);n=v(at,"FORM",{action:!0,id:!0,class:!0});var Me=b(n);f=v(Me,"LABEL",{for:!0,"data-svelte-h":!0}),ue(f)!=="svelte-rbwhex"&&(f.textContent=i),h=M(Me),m=v(Me,"FIELDSET",{class:!0});var Te=b(m);c=v(Te,"SELECT",{id:!0,name:!0,class:!0});var Ye=b(c);E=v(Ye,"OPTION",{"data-svelte-h":!0}),ue(E)!=="svelte-51kto6"&&(E.textContent=T),y=v(Ye,"OPTION",{"data-svelte-h":!0}),ue(y)!=="svelte-ns3pfu"&&(y.textContent=F),Ye.forEach(_),P=M(Te),k=v(Te,"INPUT",{type:!0,name:!0,class:!0}),C=M(Te),X&&X.l(Te),J=M(Te),S=v(Te,"BUTTON",{type:!0,class:!0});var Re=b(S);R=v(Re,"SPAN",{class:!0,"data-svelte-h":!0}),ue(R)!=="svelte-ctu7wl"&&(R.textContent=z),U=M(Re),pe($.$$.fragment,Re),Re.forEach(_),Te.forEach(_),Me.forEach(_),at.forEach(_),V=M(ke),K=v(ke,"ARTICLE",{class:!0});var nt=b(K);q=v(nt,"TABLE",{class:!0});var Be=b(q);B=v(Be,"THEAD",{class:!0,"data-svelte-h":!0}),ue(B)!=="svelte-17vx132"&&(B.innerHTML=Y),I=M(Be),Q&&Q.l(Be),Be.forEach(_),nt.forEach(_),w=M(ke),L=v(ke,"NAV",{class:!0});var Ve=b(L);j=v(Ve,"DIV",{});var Le=b(j);se=v(Le,"LABEL",{for:!0,"data-svelte-h":!0}),ue(se)!=="svelte-1r8oyu6"&&(se.textContent=ge),ae=M(Le),pe(d.$$.fragment,Le),g=ce(Le,`\r + of `),de=ce(Le,G),Le.forEach(_),Ee=M(Ve),W=v(Ve,"BUTTON",{class:!0,title:!0});var Fe=b(W);pe(ne.$$.fragment,Fe),ie=M(Fe),le=v(Fe,"SPAN",{class:!0,"data-svelte-h":!0}),ue(le)!=="svelte-vjukmr"&&(le.textContent=oe),Fe.forEach(_),Ve.forEach(_),ke.forEach(_),Ne=M(be),Z&&Z.l(be),Pe=M(be),x&&x.l(be),be.forEach(_),this.h()},h(){u(f,"for","filters_attribute"),E.__value="email",Ie(E,E.__value),y.__value="id",Ie(y,y.__value),u(c,"id","filters_attribute"),u(c,"name","attribute"),u(c,"class","svelte-1g093it"),l[3].attribute===void 0&&et(()=>l[14].call(c)),u(k,"type","text"),u(k,"name","value"),u(k,"class","svelte-1g093it"),u(R,"class","label svelte-1g093it"),u(S,"type","submit"),u(S,"class","button svelte-1g093it"),u(m,"class","search svelte-1g093it"),u(n,"action",""),u(n,"id","filters"),u(n,"class","svelte-1g093it"),u(r,"class","filters svelte-1g093it"),u(B,"class","svelte-1g093it"),u(q,"class","svelte-1g093it"),u(K,"class","contetnt"),u(se,"for","page"),u(le,"class","label"),u(W,"class","button"),u(W,"title","Create user"),u(L,"class","pagination svelte-1g093it"),u(s,"class","container svelte-1g093it"),u(t,"class","page svelte-1g093it")},m(D,te){ee(D,a,te),ee(D,t,te),o(t,s),o(s,r),o(r,n),o(n,f),o(n,h),o(n,m),o(m,c),o(c,E),o(c,y),rt(c,l[3].attribute,!0),o(m,P),o(m,k),Ie(k,l[3].value),o(m,C),X&&X.m(m,null),o(m,J),o(m,S),o(S,R),o(S,U),ve($,S,null),l[17](n),o(s,V),o(s,K),o(K,q),o(q,B),o(q,I),Q&&Q.m(q,null),o(s,w),o(s,L),o(L,j),o(j,se),o(j,ae),ve(d,j,null),o(j,g),o(j,de),o(L,Ee),o(L,W),ve(ne,W,null),o(W,ie),o(W,le),o(t,Ne),Z&&Z.m(t,null),o(t,Pe),x&&x.m(t,null),$e=!0,Ge||(tt=[_e(c,"change",l[14]),_e(c,"change",l[15]),_e(k,"input",l[16]),_e(n,"submit",l[18]),_e(W,"click",kt(l[25]))],Ge=!0)},p(D,[te]){var ke;(!$e||te&64)&&e!==(e="Users"+((ke=D[6].online)!=null&&ke.MPKIT_URL?": "+D[6].online.MPKIT_URL.replace("https://",""):""))&&(We.title=e),te&8&&rt(c,D[3].attribute),te&8&&k.value!==D[3].value&&Ie(k,D[3].value),D[3].value?X?(X.p(D,te),te&8&&O(X,1)):(X=vt(D),X.c(),O(X,1),X.m(m,J)):X&&(ye(),H(X,1,1,()=>{X=null}),Ce()),D[1]?Q?(Q.p(D,te),te&2&&O(Q,1)):(Q=ht(D),Q.c(),O(Q,1),Q.m(q,null)):Q&&(ye(),H(Q,1,1,()=>{Q=null}),Ce());const be={};te&8&&(be.max=D[3].totalPages),!N&&te&8&&(N=!0,be.value=D[3].page,It(()=>N=!1)),d.$set(be),(!$e||te&8)&&G!==(G=D[3].totalPages+"")&&De(de,G),D[5].params.id?Z?(Z.p(D,te),te&32&&O(Z,1)):(Z=Et(D),Z.c(),O(Z,1),Z.m(t,Pe)):Z&&(ye(),H(Z,1,1,()=>{Z=null}),Ce()),D[6].user!==void 0?x?(x.p(D,te),te&64&&O(x,1)):(x=$t(D),x.c(),O(x,1),x.m(t,null)):x&&(ye(),H(x,1,1,()=>{x=null}),Ce())},i(D){$e||(O(X),O($.$$.fragment,D),O(Q),O(d.$$.fragment,D),O(ne.$$.fragment,D),O(Z),O(x),$e=!0)},o(D){H(X),H($.$$.fragment,D),H(Q),H(d.$$.fragment,D),H(ne.$$.fragment,D),H(Z),H(x),$e=!1},d(D){D&&(_(a),_(t)),X&&X.d(),he($),l[17](null),Q&&Q.d(),he(d),he(ne),Z&&Z.d(),x&&x.d(),Ge=!1,Je(tt)}}}function nl(l,e,a){let t,s;Qe(l,Mt,w=>a(5,t=w)),Qe(l,re,w=>a(6,s=w));let{$$slots:r={},$$scope:n}=e,f,i=[],h=null,m={page:1,attribute:"email",value:""},c={page:1,totalPages:1,attribute:"email",value:"",...Object.fromEntries(t.url.searchParams)};we(re,s.user=void 0,s);let E={id:null};const T=function(){const w=Object.fromEntries(t.url.searchParams);Ae.get(w).then(L=>{a(1,i=L.results),a(3,c.totalPages=L.total_pages,c)})},y=function(w,{delay:L=0,duration:j=150}){return{delay:L,duration:j,css:se=>`scale: ${Tt(se)};`}},F=function(w=null){h===null?Ae.getCustomProperties().then(L=>{a(2,h=L),we(re,s.user=w,s)}).catch(()=>{re.notification.create("error","Could not load table properties. Please try again later.")}):we(re,s.user=w,s)},P=async function(){a(3,c=structuredClone(m)),await it(),f.requestSubmit()},k=async function(w){w.preventDefault();const L=t.url.searchParams,j=new URLSearchParams(new FormData(w.target));L.get("value")!==j.get("value")&&(j.set("page",1),a(3,c.page=1,c)),await At(document.location.pathname+"?"+j.toString()),await it(),await T()};function C(){c.attribute=Ot(this),a(3,c)}const J=()=>a(3,c.value="",c);function S(){c.value=this.value,a(3,c)}function R(w){Ue[w?"unshift":"push"](()=>{f=w,a(0,f)})}const z=w=>k(w),U=w=>a(4,E.id=w.id,E),$=w=>{F(w)},V=()=>T(),K=()=>a(4,E.id=null,E);function q(w){l.$$.not_equal(c.page,w)&&(c.page=w,a(3,c))}const B=w=>{f.requestSubmit(w.detail.submitter)},Y=()=>F(),I=()=>T();return l.$$set=w=>{"$$scope"in w&&a(12,n=w.$$scope)},T(),[f,i,h,c,E,t,s,T,y,F,P,k,n,r,C,J,S,R,z,U,$,V,K,q,B,Y,I]}class El extends ze{constructor(e){super(),Ke(this,e,nl,al,He,{})}}export{El as component}; diff --git a/gui/next/build/_app/immutable/nodes/9.C0seAjWB.js b/gui/next/build/_app/immutable/nodes/9.C0seAjWB.js new file mode 100644 index 00000000..b26a8db0 --- /dev/null +++ b/gui/next/build/_app/immutable/nodes/9.C0seAjWB.js @@ -0,0 +1,6 @@ +import{P as co,Q as uo,R as Bl,S as fo,s as ho,a as i,e as l,t as I,p as vo,f as a,g as c,c as n,b as o,A as U,d as N,y as t,G as A,I as so,i as ks,h as e,C as q,j as be,r as po,k as mo,E as ca,n as z,v as lo,M as _o}from"../chunks/scheduler.CKQ5dLhN.js";import{g as ro,a as m,e as io,t as p,S as go,i as $o,c as $,d as b,m as k,f as L,h as no}from"../chunks/index.CGVWAVV-.js";import{f as ao}from"../chunks/index.WWWgbq8H.js";import{s as Ss}from"../chunks/state.nqMW8J5l.js";import{t as bo}from"../chunks/table.Cmn0kCDk.js";import{I as E}from"../chunks/Icon.CkKwi_WD.js";function ko(s,u){const w=u.token={};function d(f,_,v,C){if(u.token!==w)return;u.resolved=C;let D=u.ctx;v!==void 0&&(D=D.slice(),D[v]=C);const M=f&&(u.current=f)(D);let P=!1;u.block&&(u.blocks?u.blocks.forEach((S,ke)=>{ke!==_&&S&&(ro(),m(S,1,1,()=>{u.blocks[ke]===S&&(u.blocks[ke]=null)}),io())}):u.block.d(1),M.c(),p(M,1),M.m(u.mount(),u.anchor),P=!0),u.block=M,u.blocks&&(u.blocks[_]=M),P&&fo()}if(co(s)){const f=uo();if(s.then(_=>{Bl(f),d(u.then,1,u.value,_),Bl(null)},_=>{if(Bl(f),d(u.catch,2,u.error,_),Bl(null),!u.hasCatch)throw _}),u.current!==u.pending)return d(u.pending,0),!0}else{if(u.current!==u.then)return d(u.then,1,u.value,s),!0;u.resolved=s}}function Lo(s,u,w){const d=u.slice(),{resolved:f}=s;s.current===s.then&&(d[s.value]=f),s.current===s.catch&&(d[s.error]=f),s.block.p(d,w)}function Eo(s){return{c:z,l:z,m:z,p:z,i:z,o:z,d:z}}function wo(s){let u,w,d=s[23].version!==s[1].online.version&&oo(s);return{c(){d&&d.c(),u=lo()},l(f){d&&d.l(f),u=lo()},m(f,_){d&&d.m(f,_),ks(f,u,_),w=!0},p(f,_){f[23].version!==f[1].online.version?d?(d.p(f,_),_&2&&p(d,1)):(d=oo(f),d.c(),p(d,1),d.m(u.parentNode,u)):d&&(ro(),m(d,1,1,()=>{d=null}),io())},i(f){w||(p(d),w=!0)},o(f){m(d),w=!1},d(f){f&&a(u),d&&d.d(f)}}}function oo(s){let u,w,d,f,_="Update available",v,C,D,M;return w=new E({props:{icon:"arrowTripleUp"}}),{c(){u=l("button"),$(w.$$.fragment),d=i(),f=l("span"),f.textContent=_,this.h()},l(P){u=n(P,"BUTTON",{title:!0,class:!0});var S=o(u);b(w.$$.fragment,S),d=c(S),f=n(S,"SPAN",{"data-svelte-h":!0}),U(f)!=="svelte-16bfzxk"&&(f.textContent=_),S.forEach(a),this.h()},h(){t(u,"title","Update to pos-cli version "+s[23].version),t(u,"class","update svelte-50so3t")},m(P,S){ks(P,u,S),k(w,u,null),e(u,d),e(u,f),C=!0,D||(M=q(u,"click",s[6]),D=!0)},p:z,i(P){C||(p(w.$$.fragment,P),P&&_o(()=>{C&&(v||(v=no(u,ao,{},!0)),v.run(1))}),C=!0)},o(P){m(w.$$.fragment,P),P&&(v||(v=no(u,ao,{},!1)),v.run(0)),C=!1},d(P){P&&a(u),L(w),P&&v&&v.end(),D=!1,M()}}}function Uo(s){return{c:z,l:z,m:z,p:z,i:z,o:z,d:z}}function Co(s){var Da;let u,w,d,f,_,v,C,D,M,P,S="Database",ke,Le,Hl='
  • Inspect tables and records
  • Create, edit or delete records
  • Filter and find any record
  • ',As,ie,Ke,j,Ee,Ms,we,Ol="Show more information about Database tool",Bs,We,O,T,Ue,Xe,Ls=s[1].header.includes("database")?"Unpin Database from":"Pin Database to",Hs,Jl,Os,Fl,J,ce,Rt,Ye,Ql,Ze,ua="Users",Gl,ye,da='
  • Inspect registered users and their personal data
  • ',Vl,Ce,jt,te,xe,Rl,et,fa="Show more information about Users tool",jl,Kt,K,Pe,Kl,tt,Es=s[1].header.includes("users")?"Unpin Users from":"Pin Users to",Js,Wl,Fs,Xl,F,ue,Wt,st,Yl,lt,ha="Logs",Zl,nt,va='
  • View system logs
  • Inspect logs you've outputted yourself
  • Debug Liquid or GraphQL errors
  • ',yl,Te,Xt,se,at,xl,ot,pa="Show more information about Logs tool",en,Yt,W,Ie,tn,rt,ws=s[1].header.includes("logs")?"Unpin Logs from":"Pin Logs to",Qs,sn,Gs,ln,Q,de,Zt,it,nn,ct,ma="Background Jobs",an,ut,_a='
  • List scheduled background jobs
  • Debug background jobs that failed to run
  • ',on,Ne,yt,le,dt,rn,ft,ga="Show more information about Background Jobs tool",cn,xt,X,qe,un,ht,Us=s[1].header.includes("backgroundJobs")?"Unpin Background Jobs from":"Pin Background Jobs to",Vs,dn,Rs,fn,G,fe,es,vt,hn,pt,$a="Constants",vn,mt,ba='
  • Check all constants in one place
  • Create new constants
  • Edit or delete existing ones
  • ',pn,De,ts,ne,_t,mn,gt,ka="Show more information about Constants tool",_n,ss,Y,ze,gn,$t,Cs=s[1].header.includes("constants")?"Unpin Constants from":"Pin Constants to",js,$n,Ks,bn,ae,V,he,bt,kt,kn,Lt,La="Liquid Evaluator",Ln,Et,Ea='
  • Run Liquid code against your instance
  • Test Liquid logic
  • Quickly prototype your ideas
  • ',En,Se,ls,oe,wt,wn,Ut,wa="Show more information about Liquid Evaluator",Un,ns,Z,Ae,Cn,Ct,Ps=s[1].header.includes("liquid")?"Unpin Liquid Evaluator from":"Pin Liquid Evaluator to",Ws,Pn,Xs,Tn,R,ve,Pt,Tt,In,It,Ua="GraphiQL",Nn,Nt,Ca='
  • Run GraphQL against your instance
  • Explore documentation
  • Quickly prototype your queries and mutations
  • ',qn,Me,as,re,qt,Dn,Dt,Pa="Show more information about GraphiQL",zn,os,y,Be,Sn,zt,Ts=s[1].header.includes("graphiql")?"Unpin GraphiQL from":"Pin GraphiQL to",Ys,An,Zs,Mn,He,Oe,Je,x,Fe,Bn,St,Is=s[1].header.includes("logsv2")?"Unpin Logs v2 from":"Pin Logs v2 to",ys,Hn,xs,On,pe,rs,At,Jn,is,Ta="Logs v2",Fn,Qe,ee,Ge,Qn,Mt,Ns=s[1].header.includes("network")?"Unpin Network Logs from":"Pin Network Logs to",el,Gn,tl,Vn,me,cs,Bt,Rn,us,Ia="Network Logs",jn,Ht,Na=`Early access + New tools in testable versions`,sl,_e,ds,Kn,Ve,fs,Re,Ot,Wn,Xn,hs,je,Jt,Yn,g,Zn,qa;document.title=u="platformOS"+((Da=s[1].online)!=null&&Da.MPKIT_URL?": "+s[1].online.MPKIT_URL.replace("https://",""):""),D=new E({props:{icon:"database",size:"48"}}),Ee=new E({props:{icon:"info",size:"14"}}),T=new E({props:{icon:s[1].header.includes("database")?"pinFilled":"pin",size:"14"}}),Ye=new E({props:{icon:"users",size:"48"}}),xe=new E({props:{icon:"info",size:"14"}}),Pe=new E({props:{icon:s[1].header.includes("users")?"pinFilled":"pin",size:"14"}}),st=new E({props:{icon:"log",size:"48"}}),at=new E({props:{icon:"info",size:"14"}}),Ie=new E({props:{icon:s[1].header.includes("logs")?"pinFilled":"pin",size:"14"}}),it=new E({props:{icon:"backgroundJob",size:"48"}}),dt=new E({props:{icon:"info",size:"14"}}),qe=new E({props:{icon:s[1].header.includes("backgroundJobs")?"pinFilled":"pin",size:"14"}}),vt=new E({props:{icon:"constant",size:"48"}}),_t=new E({props:{icon:"info",size:"14"}}),ze=new E({props:{icon:s[1].header.includes("constants")?"pinFilled":"pin",size:"14"}}),kt=new E({props:{icon:"liquid",size:"48"}}),wt=new E({props:{icon:"info",size:"14"}}),Ae=new E({props:{icon:s[1].header.includes("liquid")?"pinFilled":"pin",size:"14"}}),Tt=new E({props:{icon:"graphql",size:"48"}}),qt=new E({props:{icon:"info",size:"14"}}),Be=new E({props:{icon:s[1].header.includes("graphiql")?"pinFilled":"pin",size:"14"}}),Fe=new E({props:{icon:s[1].header.includes("logsv2")?"pinFilled":"pin",size:"12"}}),At=new E({props:{icon:"logFresh",size:"24"}}),Ge=new E({props:{icon:s[1].header.includes("network")?"pinFilled":"pin",size:"12"}}),Bt=new E({props:{icon:"globeMessage",size:"24"}});let B={ctx:s,current:null,token:null,hasCatch:!1,pending:Uo,then:wo,catch:Eo,value:23,blocks:[,,,]};return ko(s[5](),B),Ot=new E({props:{icon:"book"}}),Jt=new E({props:{icon:"serverSettings"}}),{c(){w=i(),d=l("nav"),f=l("ul"),_=l("li"),v=l("a"),C=l("div"),$(D.$$.fragment),M=i(),P=l("h2"),P.textContent=S,ke=i(),Le=l("ul"),Le.innerHTML=Hl,As=i(),ie=l("ul"),Ke=l("li"),j=l("button"),$(Ee.$$.fragment),Ms=i(),we=l("span"),we.textContent=Ol,Bs=i(),We=l("li"),O=l("button"),$(T.$$.fragment),Ue=i(),Xe=l("span"),Hs=I(Ls),Jl=I(" header menu"),Fl=i(),J=l("li"),ce=l("a"),Rt=l("div"),$(Ye.$$.fragment),Ql=i(),Ze=l("h2"),Ze.textContent=ua,Gl=i(),ye=l("ul"),ye.innerHTML=da,Vl=i(),Ce=l("ul"),jt=l("li"),te=l("button"),$(xe.$$.fragment),Rl=i(),et=l("span"),et.textContent=fa,jl=i(),Kt=l("li"),K=l("button"),$(Pe.$$.fragment),Kl=i(),tt=l("span"),Js=I(Es),Wl=I(" header menu"),Xl=i(),F=l("li"),ue=l("a"),Wt=l("div"),$(st.$$.fragment),Yl=i(),lt=l("h2"),lt.textContent=ha,Zl=i(),nt=l("ul"),nt.innerHTML=va,yl=i(),Te=l("ul"),Xt=l("li"),se=l("button"),$(at.$$.fragment),xl=i(),ot=l("span"),ot.textContent=pa,en=i(),Yt=l("li"),W=l("button"),$(Ie.$$.fragment),tn=i(),rt=l("span"),Qs=I(ws),sn=I(" header menu"),ln=i(),Q=l("li"),de=l("a"),Zt=l("div"),$(it.$$.fragment),nn=i(),ct=l("h2"),ct.textContent=ma,an=i(),ut=l("ul"),ut.innerHTML=_a,on=i(),Ne=l("ul"),yt=l("li"),le=l("button"),$(dt.$$.fragment),rn=i(),ft=l("span"),ft.textContent=ga,cn=i(),xt=l("li"),X=l("button"),$(qe.$$.fragment),un=i(),ht=l("span"),Vs=I(Us),dn=I(" header menu"),fn=i(),G=l("li"),fe=l("a"),es=l("div"),$(vt.$$.fragment),hn=i(),pt=l("h2"),pt.textContent=$a,vn=i(),mt=l("ul"),mt.innerHTML=ba,pn=i(),De=l("ul"),ts=l("li"),ne=l("button"),$(_t.$$.fragment),mn=i(),gt=l("span"),gt.textContent=ka,_n=i(),ss=l("li"),Y=l("button"),$(ze.$$.fragment),gn=i(),$t=l("span"),js=I(Cs),$n=I(" header menu"),bn=i(),ae=l("ul"),V=l("li"),he=l("a"),bt=l("div"),$(kt.$$.fragment),kn=i(),Lt=l("h2"),Lt.textContent=La,Ln=i(),Et=l("ul"),Et.innerHTML=Ea,En=i(),Se=l("ul"),ls=l("li"),oe=l("button"),$(wt.$$.fragment),wn=i(),Ut=l("span"),Ut.textContent=wa,Un=i(),ns=l("li"),Z=l("button"),$(Ae.$$.fragment),Cn=i(),Ct=l("span"),Ws=I(Ps),Pn=I(" header menu"),Tn=i(),R=l("li"),ve=l("a"),Pt=l("div"),$(Tt.$$.fragment),In=i(),It=l("h2"),It.textContent=Ua,Nn=i(),Nt=l("ul"),Nt.innerHTML=Ca,qn=i(),Me=l("ul"),as=l("li"),re=l("button"),$(qt.$$.fragment),Dn=i(),Dt=l("span"),Dt.textContent=Pa,zn=i(),os=l("li"),y=l("button"),$(Be.$$.fragment),Sn=i(),zt=l("span"),Ys=I(Ts),An=I(" header menu"),Mn=i(),He=l("li"),Oe=l("ul"),Je=l("li"),x=l("button"),$(Fe.$$.fragment),Bn=i(),St=l("span"),ys=I(Is),Hn=I(" header menu"),On=i(),pe=l("a"),rs=l("i"),$(At.$$.fragment),Jn=i(),is=l("h3"),is.textContent=Ta,Fn=i(),Qe=l("li"),ee=l("button"),$(Ge.$$.fragment),Qn=i(),Mt=l("span"),el=I(Ns),Gn=I(" header menu"),Vn=i(),me=l("a"),cs=l("i"),$(Bt.$$.fragment),Rn=i(),us=l("h3"),us.textContent=Ia,jn=i(),Ht=l("h2"),Ht.innerHTML=Na,sl=i(),_e=l("footer"),ds=l("div"),B.block.c(),Kn=i(),Ve=l("ul"),fs=l("li"),Re=l("a"),$(Ot.$$.fragment),Wn=I(`\r + Documentation`),Xn=i(),hs=l("li"),je=l("a"),$(Jt.$$.fragment),Yn=I(`\r + Partner Portal`),this.h()},l(r){vo("svelte-zlk2mt",document.head).forEach(a),w=c(r),d=n(r,"NAV",{class:!0});var ge=o(d);f=n(ge,"UL",{class:!0});var H=o(f);_=n(H,"LI",{class:!0});var $e=o(_);v=n($e,"A",{href:!0,class:!0});var Ft=o(v);C=n(Ft,"DIV",{class:!0});var qs=o(C);b(D.$$.fragment,qs),qs.forEach(a),M=c(Ft),P=n(Ft,"H2",{class:!0,"data-svelte-h":!0}),U(P)!=="svelte-1a38a01"&&(P.textContent=S),Ft.forEach(a),ke=c($e),Le=n($e,"UL",{class:!0,"data-svelte-h":!0}),U(Le)!=="svelte-1tj1zl5"&&(Le.innerHTML=Hl),As=c($e),ie=n($e,"UL",{class:!0});var Qt=o(ie);Ke=n(Qt,"LI",{class:!0});var Ds=o(Ke);j=n(Ds,"BUTTON",{title:!0,class:!0});var Gt=o(j);b(Ee.$$.fragment,Gt),Ms=c(Gt),we=n(Gt,"SPAN",{class:!0,"data-svelte-h":!0}),U(we)!=="svelte-vg36pf"&&(we.textContent=Ol),Gt.forEach(a),Ds.forEach(a),Bs=c(Qt),We=n(Qt,"LI",{class:!0});var zs=o(We);O=n(zs,"BUTTON",{title:!0,class:!0});var Vt=o(O);b(T.$$.fragment,Vt),Ue=c(Vt),Xe=n(Vt,"SPAN",{class:!0});var yn=o(Xe);Hs=N(yn,Ls),Jl=N(yn," header menu"),yn.forEach(a),Vt.forEach(a),zs.forEach(a),Qt.forEach(a),$e.forEach(a),Fl=c(H),J=n(H,"LI",{class:!0});var vs=o(J);ce=n(vs,"A",{href:!0,class:!0});var ll=o(ce);Rt=n(ll,"DIV",{class:!0});var za=o(Rt);b(Ye.$$.fragment,za),za.forEach(a),Ql=c(ll),Ze=n(ll,"H2",{class:!0,"data-svelte-h":!0}),U(Ze)!=="svelte-bvmn5u"&&(Ze.textContent=ua),ll.forEach(a),Gl=c(vs),ye=n(vs,"UL",{class:!0,"data-svelte-h":!0}),U(ye)!=="svelte-ml78fh"&&(ye.innerHTML=da),Vl=c(vs),Ce=n(vs,"UL",{class:!0});var nl=o(Ce);jt=n(nl,"LI",{class:!0});var Sa=o(jt);te=n(Sa,"BUTTON",{title:!0,class:!0});var al=o(te);b(xe.$$.fragment,al),Rl=c(al),et=n(al,"SPAN",{class:!0,"data-svelte-h":!0}),U(et)!=="svelte-10o6fc2"&&(et.textContent=fa),al.forEach(a),Sa.forEach(a),jl=c(nl),Kt=n(nl,"LI",{class:!0});var Aa=o(Kt);K=n(Aa,"BUTTON",{title:!0,class:!0});var ol=o(K);b(Pe.$$.fragment,ol),Kl=c(ol),tt=n(ol,"SPAN",{class:!0});var xn=o(tt);Js=N(xn,Es),Wl=N(xn," header menu"),xn.forEach(a),ol.forEach(a),Aa.forEach(a),nl.forEach(a),vs.forEach(a),Xl=c(H),F=n(H,"LI",{class:!0});var ps=o(F);ue=n(ps,"A",{href:!0,class:!0});var rl=o(ue);Wt=n(rl,"DIV",{class:!0});var Ma=o(Wt);b(st.$$.fragment,Ma),Ma.forEach(a),Yl=c(rl),lt=n(rl,"H2",{class:!0,"data-svelte-h":!0}),U(lt)!=="svelte-1ef7qq7"&&(lt.textContent=ha),rl.forEach(a),Zl=c(ps),nt=n(ps,"UL",{class:!0,"data-svelte-h":!0}),U(nt)!=="svelte-16nvdoq"&&(nt.innerHTML=va),yl=c(ps),Te=n(ps,"UL",{class:!0});var il=o(Te);Xt=n(il,"LI",{class:!0});var Ba=o(Xt);se=n(Ba,"BUTTON",{title:!0,class:!0});var cl=o(se);b(at.$$.fragment,cl),xl=c(cl),ot=n(cl,"SPAN",{class:!0,"data-svelte-h":!0}),U(ot)!=="svelte-7a5jqd"&&(ot.textContent=pa),cl.forEach(a),Ba.forEach(a),en=c(il),Yt=n(il,"LI",{class:!0});var Ha=o(Yt);W=n(Ha,"BUTTON",{title:!0,class:!0});var ul=o(W);b(Ie.$$.fragment,ul),tn=c(ul),rt=n(ul,"SPAN",{class:!0});var ea=o(rt);Qs=N(ea,ws),sn=N(ea," header menu"),ea.forEach(a),ul.forEach(a),Ha.forEach(a),il.forEach(a),ps.forEach(a),ln=c(H),Q=n(H,"LI",{class:!0});var ms=o(Q);de=n(ms,"A",{href:!0,class:!0});var dl=o(de);Zt=n(dl,"DIV",{class:!0});var Oa=o(Zt);b(it.$$.fragment,Oa),Oa.forEach(a),nn=c(dl),ct=n(dl,"H2",{class:!0,"data-svelte-h":!0}),U(ct)!=="svelte-1bxtcha"&&(ct.textContent=ma),dl.forEach(a),an=c(ms),ut=n(ms,"UL",{class:!0,"data-svelte-h":!0}),U(ut)!=="svelte-198kha5"&&(ut.innerHTML=_a),on=c(ms),Ne=n(ms,"UL",{class:!0});var fl=o(Ne);yt=n(fl,"LI",{class:!0});var Ja=o(yt);le=n(Ja,"BUTTON",{title:!0,class:!0});var hl=o(le);b(dt.$$.fragment,hl),rn=c(hl),ft=n(hl,"SPAN",{class:!0,"data-svelte-h":!0}),U(ft)!=="svelte-12zm1eu"&&(ft.textContent=ga),hl.forEach(a),Ja.forEach(a),cn=c(fl),xt=n(fl,"LI",{class:!0});var Fa=o(xt);X=n(Fa,"BUTTON",{title:!0,class:!0});var vl=o(X);b(qe.$$.fragment,vl),un=c(vl),ht=n(vl,"SPAN",{class:!0});var ta=o(ht);Vs=N(ta,Us),dn=N(ta," header menu"),ta.forEach(a),vl.forEach(a),Fa.forEach(a),fl.forEach(a),ms.forEach(a),fn=c(H),G=n(H,"LI",{class:!0});var _s=o(G);fe=n(_s,"A",{href:!0,class:!0});var pl=o(fe);es=n(pl,"DIV",{class:!0});var Qa=o(es);b(vt.$$.fragment,Qa),Qa.forEach(a),hn=c(pl),pt=n(pl,"H2",{class:!0,"data-svelte-h":!0}),U(pt)!=="svelte-187k1uv"&&(pt.textContent=$a),pl.forEach(a),vn=c(_s),mt=n(_s,"UL",{class:!0,"data-svelte-h":!0}),U(mt)!=="svelte-1hxwc9f"&&(mt.innerHTML=ba),pn=c(_s),De=n(_s,"UL",{class:!0});var ml=o(De);ts=n(ml,"LI",{class:!0});var Ga=o(ts);ne=n(Ga,"BUTTON",{title:!0,class:!0});var _l=o(ne);b(_t.$$.fragment,_l),mn=c(_l),gt=n(_l,"SPAN",{class:!0,"data-svelte-h":!0}),U(gt)!=="svelte-96zp3x"&&(gt.textContent=ka),_l.forEach(a),Ga.forEach(a),_n=c(ml),ss=n(ml,"LI",{class:!0});var Va=o(ss);Y=n(Va,"BUTTON",{title:!0,class:!0});var gl=o(Y);b(ze.$$.fragment,gl),gn=c(gl),$t=n(gl,"SPAN",{class:!0});var sa=o($t);js=N(sa,Cs),$n=N(sa," header menu"),sa.forEach(a),gl.forEach(a),Va.forEach(a),ml.forEach(a),_s.forEach(a),H.forEach(a),bn=c(ge),ae=n(ge,"UL",{class:!0});var gs=o(ae);V=n(gs,"LI",{class:!0});var $s=o(V);he=n($s,"A",{href:!0,class:!0});var $l=o(he);bt=n($l,"DIV",{class:!0,style:!0});var Ra=o(bt);b(kt.$$.fragment,Ra),Ra.forEach(a),kn=c($l),Lt=n($l,"H2",{class:!0,"data-svelte-h":!0}),U(Lt)!=="svelte-1945w61"&&(Lt.textContent=La),$l.forEach(a),Ln=c($s),Et=n($s,"UL",{class:!0,"data-svelte-h":!0}),U(Et)!=="svelte-1k625ps"&&(Et.innerHTML=Ea),En=c($s),Se=n($s,"UL",{class:!0});var bl=o(Se);ls=n(bl,"LI",{class:!0});var ja=o(ls);oe=n(ja,"BUTTON",{title:!0,class:!0});var kl=o(oe);b(wt.$$.fragment,kl),wn=c(kl),Ut=n(kl,"SPAN",{class:!0,"data-svelte-h":!0}),U(Ut)!=="svelte-zgpe6t"&&(Ut.textContent=wa),kl.forEach(a),ja.forEach(a),Un=c(bl),ns=n(bl,"LI",{class:!0});var Ka=o(ns);Z=n(Ka,"BUTTON",{title:!0,class:!0});var Ll=o(Z);b(Ae.$$.fragment,Ll),Cn=c(Ll),Ct=n(Ll,"SPAN",{class:!0});var la=o(Ct);Ws=N(la,Ps),Pn=N(la," header menu"),la.forEach(a),Ll.forEach(a),Ka.forEach(a),bl.forEach(a),$s.forEach(a),Tn=c(gs),R=n(gs,"LI",{class:!0});var bs=o(R);ve=n(bs,"A",{href:!0,class:!0});var El=o(ve);Pt=n(El,"DIV",{class:!0,style:!0});var Wa=o(Pt);b(Tt.$$.fragment,Wa),Wa.forEach(a),In=c(El),It=n(El,"H2",{class:!0,"data-svelte-h":!0}),U(It)!=="svelte-v0z4e8"&&(It.textContent=Ua),El.forEach(a),Nn=c(bs),Nt=n(bs,"UL",{class:!0,"data-svelte-h":!0}),U(Nt)!=="svelte-17bqupm"&&(Nt.innerHTML=Ca),qn=c(bs),Me=n(bs,"UL",{class:!0});var wl=o(Me);as=n(wl,"LI",{class:!0});var Xa=o(as);re=n(Xa,"BUTTON",{title:!0,class:!0});var Ul=o(re);b(qt.$$.fragment,Ul),Dn=c(Ul),Dt=n(Ul,"SPAN",{class:!0,"data-svelte-h":!0}),U(Dt)!=="svelte-1mz1lxe"&&(Dt.textContent=Pa),Ul.forEach(a),Xa.forEach(a),zn=c(wl),os=n(wl,"LI",{class:!0});var Ya=o(os);y=n(Ya,"BUTTON",{title:!0,class:!0});var Cl=o(y);b(Be.$$.fragment,Cl),Sn=c(Cl),zt=n(Cl,"SPAN",{class:!0});var na=o(zt);Ys=N(na,Ts),An=N(na," header menu"),na.forEach(a),Cl.forEach(a),Ya.forEach(a),wl.forEach(a),bs.forEach(a),Mn=c(gs),He=n(gs,"LI",{class:!0});var Pl=o(He);Oe=n(Pl,"UL",{class:!0});var Tl=o(Oe);Je=n(Tl,"LI",{class:!0});var Il=o(Je);x=n(Il,"BUTTON",{title:!0,class:!0});var Nl=o(x);b(Fe.$$.fragment,Nl),Bn=c(Nl),St=n(Nl,"SPAN",{class:!0});var aa=o(St);ys=N(aa,Is),Hn=N(aa," header menu"),aa.forEach(a),Nl.forEach(a),On=c(Il),pe=n(Il,"A",{href:!0,class:!0});var ql=o(pe);rs=n(ql,"I",{class:!0});var Za=o(rs);b(At.$$.fragment,Za),Za.forEach(a),Jn=c(ql),is=n(ql,"H3",{"data-svelte-h":!0}),U(is)!=="svelte-12gavf5"&&(is.textContent=Ta),ql.forEach(a),Il.forEach(a),Fn=c(Tl),Qe=n(Tl,"LI",{class:!0});var Dl=o(Qe);ee=n(Dl,"BUTTON",{title:!0,class:!0});var zl=o(ee);b(Ge.$$.fragment,zl),Qn=c(zl),Mt=n(zl,"SPAN",{class:!0});var oa=o(Mt);el=N(oa,Ns),Gn=N(oa," header menu"),oa.forEach(a),zl.forEach(a),Vn=c(Dl),me=n(Dl,"A",{href:!0,class:!0});var Sl=o(me);cs=n(Sl,"I",{class:!0});var ya=o(cs);b(Bt.$$.fragment,ya),ya.forEach(a),Rn=c(Sl),us=n(Sl,"H3",{"data-svelte-h":!0}),U(us)!=="svelte-16npeyx"&&(us.textContent=Ia),Sl.forEach(a),Dl.forEach(a),Tl.forEach(a),jn=c(Pl),Ht=n(Pl,"H2",{class:!0,"data-svelte-h":!0}),U(Ht)!=="svelte-bhbezd"&&(Ht.innerHTML=Na),Pl.forEach(a),gs.forEach(a),ge.forEach(a),sl=c(r),_e=n(r,"FOOTER",{class:!0});var Al=o(_e);ds=n(Al,"DIV",{});var xa=o(ds);B.block.l(xa),xa.forEach(a),Kn=c(Al),Ve=n(Al,"UL",{class:!0});var Ml=o(Ve);fs=n(Ml,"LI",{class:!0});var eo=o(fs);Re=n(eo,"A",{href:!0,class:!0});var ra=o(Re);b(Ot.$$.fragment,ra),Wn=N(ra,`\r + Documentation`),ra.forEach(a),eo.forEach(a),Xn=c(Ml),hs=n(Ml,"LI",{class:!0});var to=o(hs);je=n(to,"A",{href:!0,class:!0});var ia=o(je);b(Jt.$$.fragment,ia),Yn=N(ia,`\r + Partner Portal`),ia.forEach(a),to.forEach(a),Ml.forEach(a),Al.forEach(a),this.h()},h(){t(C,"class","icon svelte-50so3t"),t(P,"class","svelte-50so3t"),t(v,"href","/database"),t(v,"class","svelte-50so3t"),t(Le,"class","description svelte-50so3t"),t(we,"class","label"),t(j,"title","More information"),t(j,"class","svelte-50so3t"),t(Ke,"class","svelte-50so3t"),t(Xe,"class","label"),t(O,"title",Os=(s[1].header.includes("database")?"Unpin Database from":"Pin Database to")+" header menu"),t(O,"class","svelte-50so3t"),t(We,"class","svelte-50so3t"),t(ie,"class","actions svelte-50so3t"),t(_,"class","application svelte-50so3t"),A(_,"showDescription",s[0].includes("database")),t(Rt,"class","icon svelte-50so3t"),t(Ze,"class","svelte-50so3t"),t(ce,"href","/users"),t(ce,"class","svelte-50so3t"),t(ye,"class","description svelte-50so3t"),t(et,"class","label"),t(te,"title","More information"),t(te,"class","svelte-50so3t"),t(jt,"class","svelte-50so3t"),t(tt,"class","label"),t(K,"title",Fs=(s[1].header.includes("users")?"Unpin Users from":"Pin Users to")+" header menu"),t(K,"class","svelte-50so3t"),t(Kt,"class","svelte-50so3t"),t(Ce,"class","actions svelte-50so3t"),t(J,"class","application svelte-50so3t"),A(J,"showDescription",s[0].includes("users")),t(Wt,"class","icon svelte-50so3t"),t(lt,"class","svelte-50so3t"),t(ue,"href","/logs"),t(ue,"class","svelte-50so3t"),t(nt,"class","description svelte-50so3t"),t(ot,"class","label"),t(se,"title","More information"),t(se,"class","svelte-50so3t"),t(Xt,"class","svelte-50so3t"),t(rt,"class","label"),t(W,"title",Gs=(s[1].header.includes("logs")?"Unpin Logs from":"Pin Logs to")+" header menu"),t(W,"class","svelte-50so3t"),t(Yt,"class","svelte-50so3t"),t(Te,"class","actions svelte-50so3t"),t(F,"class","application svelte-50so3t"),A(F,"showDescription",s[0].includes("logs")),t(Zt,"class","icon svelte-50so3t"),t(ct,"class","svelte-50so3t"),t(de,"href","/backgroundJobs"),t(de,"class","svelte-50so3t"),t(ut,"class","description svelte-50so3t"),t(ft,"class","label"),t(le,"title","More information"),t(le,"class","svelte-50so3t"),t(yt,"class","svelte-50so3t"),t(ht,"class","label"),t(X,"title",Rs=(s[1].header.includes("backgroundJobs")?"Unpin Background Jobs from":"Pin Background Jobs to")+" header menu"),t(X,"class","svelte-50so3t"),t(xt,"class","svelte-50so3t"),t(Ne,"class","actions svelte-50so3t"),t(Q,"class","application svelte-50so3t"),A(Q,"showDescription",s[0].includes("backgroundJobs")),t(es,"class","icon svelte-50so3t"),t(pt,"class","svelte-50so3t"),t(fe,"href","/constants"),t(fe,"class","svelte-50so3t"),t(mt,"class","description svelte-50so3t"),t(gt,"class","label"),t(ne,"title","More information"),t(ne,"class","svelte-50so3t"),t(ts,"class","svelte-50so3t"),t($t,"class","label"),t(Y,"title",Ks=(s[1].header.includes("constants")?"Unpin Constants from":"Pin Constants to")+" header menu"),t(Y,"class","svelte-50so3t"),t(ss,"class","svelte-50so3t"),t(De,"class","actions svelte-50so3t"),t(G,"class","application svelte-50so3t"),A(G,"showDescription",s[0].includes("constants")),t(f,"class","applications svelte-50so3t"),t(bt,"class","icon svelte-50so3t"),so(bt,"color","#aeb0b3"),t(Lt,"class","svelte-50so3t"),t(he,"href",(typeof window<"u"&&window.location.port!=="4173"&&window.location.port!=="5173"?`http://localhost:${parseInt(window.location.port)}`:"http://localhost:3333")+"/gui/liquid"),t(he,"class","svelte-50so3t"),t(Et,"class","description svelte-50so3t"),t(Ut,"class","label"),t(oe,"title","More information"),t(oe,"class","svelte-50so3t"),t(ls,"class","svelte-50so3t"),t(Ct,"class","label"),t(Z,"title",Xs=(s[1].header.includes("liquid")?"Unpin Liquid Evaluator from":"Pin Liquid Evaluator to")+" header menu"),t(Z,"class","svelte-50so3t"),t(ns,"class","svelte-50so3t"),t(Se,"class","actions svelte-50so3t"),t(V,"class","application svelte-50so3t"),A(V,"showDescription",s[0].includes("liquid")),t(Pt,"class","icon svelte-50so3t"),so(Pt,"color","#f30e9c"),t(It,"class","svelte-50so3t"),t(ve,"href",(typeof window<"u"&&window.location.port!=="4173"&&window.location.port!=="5173"?`http://localhost:${parseInt(window.location.port)}`:"http://localhost:3333")+"/gui/graphql"),t(ve,"class","svelte-50so3t"),t(Nt,"class","description svelte-50so3t"),t(Dt,"class","label"),t(re,"title","More information"),t(re,"class","svelte-50so3t"),t(as,"class","svelte-50so3t"),t(zt,"class","label"),t(y,"title",Zs=(s[1].header.includes("graphiql")?"Unpin GraphiQL from":"Pin GraphiQL to")+" header menu"),t(y,"class","svelte-50so3t"),t(os,"class","svelte-50so3t"),t(Me,"class","actions svelte-50so3t"),t(R,"class","application svelte-50so3t"),A(R,"showDescription",s[0].includes("graphiql")),t(St,"class","label"),t(x,"title",xs=(s[1].header.includes("logsv2")?"Unpin Logs v2 from":"Pin Logs v2 to")+" header menu"),t(x,"class","svelte-50so3t"),t(rs,"class","svelte-50so3t"),t(pe,"href","/logsv2"),t(pe,"class","svelte-50so3t"),t(Je,"class","svelte-50so3t"),t(Mt,"class","label"),t(ee,"title",tl=(s[1].header.includes("network")?"Unpin Network Logs from":"Pin Network Logs to")+" header menu"),t(ee,"class","svelte-50so3t"),t(cs,"class","svelte-50so3t"),t(me,"href","/network"),t(me,"class","svelte-50so3t"),t(Qe,"class","svelte-50so3t"),t(Oe,"class","svelte-50so3t"),t(Ht,"class","svelte-50so3t"),t(He,"class","early svelte-50so3t"),t(ae,"class","applications svelte-50so3t"),t(d,"class","svelte-50so3t"),t(Re,"href","https://documentation.platformos.com"),t(Re,"class","button svelte-50so3t"),t(fs,"class","svelte-50so3t"),t(je,"href","https://partners.platformos.com"),t(je,"class","button svelte-50so3t"),t(hs,"class","svelte-50so3t"),t(Ve,"class","svelte-50so3t"),t(_e,"class","svelte-50so3t")},m(r,h){ks(r,w,h),ks(r,d,h),e(d,f),e(f,_),e(_,v),e(v,C),k(D,C,null),e(v,M),e(v,P),e(_,ke),e(_,Le),e(_,As),e(_,ie),e(ie,Ke),e(Ke,j),k(Ee,j,null),e(j,Ms),e(j,we),e(ie,Bs),e(ie,We),e(We,O),k(T,O,null),e(O,Ue),e(O,Xe),e(Xe,Hs),e(Xe,Jl),e(f,Fl),e(f,J),e(J,ce),e(ce,Rt),k(Ye,Rt,null),e(ce,Ql),e(ce,Ze),e(J,Gl),e(J,ye),e(J,Vl),e(J,Ce),e(Ce,jt),e(jt,te),k(xe,te,null),e(te,Rl),e(te,et),e(Ce,jl),e(Ce,Kt),e(Kt,K),k(Pe,K,null),e(K,Kl),e(K,tt),e(tt,Js),e(tt,Wl),e(f,Xl),e(f,F),e(F,ue),e(ue,Wt),k(st,Wt,null),e(ue,Yl),e(ue,lt),e(F,Zl),e(F,nt),e(F,yl),e(F,Te),e(Te,Xt),e(Xt,se),k(at,se,null),e(se,xl),e(se,ot),e(Te,en),e(Te,Yt),e(Yt,W),k(Ie,W,null),e(W,tn),e(W,rt),e(rt,Qs),e(rt,sn),e(f,ln),e(f,Q),e(Q,de),e(de,Zt),k(it,Zt,null),e(de,nn),e(de,ct),e(Q,an),e(Q,ut),e(Q,on),e(Q,Ne),e(Ne,yt),e(yt,le),k(dt,le,null),e(le,rn),e(le,ft),e(Ne,cn),e(Ne,xt),e(xt,X),k(qe,X,null),e(X,un),e(X,ht),e(ht,Vs),e(ht,dn),e(f,fn),e(f,G),e(G,fe),e(fe,es),k(vt,es,null),e(fe,hn),e(fe,pt),e(G,vn),e(G,mt),e(G,pn),e(G,De),e(De,ts),e(ts,ne),k(_t,ne,null),e(ne,mn),e(ne,gt),e(De,_n),e(De,ss),e(ss,Y),k(ze,Y,null),e(Y,gn),e(Y,$t),e($t,js),e($t,$n),e(d,bn),e(d,ae),e(ae,V),e(V,he),e(he,bt),k(kt,bt,null),e(he,kn),e(he,Lt),e(V,Ln),e(V,Et),e(V,En),e(V,Se),e(Se,ls),e(ls,oe),k(wt,oe,null),e(oe,wn),e(oe,Ut),e(Se,Un),e(Se,ns),e(ns,Z),k(Ae,Z,null),e(Z,Cn),e(Z,Ct),e(Ct,Ws),e(Ct,Pn),e(ae,Tn),e(ae,R),e(R,ve),e(ve,Pt),k(Tt,Pt,null),e(ve,In),e(ve,It),e(R,Nn),e(R,Nt),e(R,qn),e(R,Me),e(Me,as),e(as,re),k(qt,re,null),e(re,Dn),e(re,Dt),e(Me,zn),e(Me,os),e(os,y),k(Be,y,null),e(y,Sn),e(y,zt),e(zt,Ys),e(zt,An),e(ae,Mn),e(ae,He),e(He,Oe),e(Oe,Je),e(Je,x),k(Fe,x,null),e(x,Bn),e(x,St),e(St,ys),e(St,Hn),e(Je,On),e(Je,pe),e(pe,rs),k(At,rs,null),e(pe,Jn),e(pe,is),e(Oe,Fn),e(Oe,Qe),e(Qe,ee),k(Ge,ee,null),e(ee,Qn),e(ee,Mt),e(Mt,el),e(Mt,Gn),e(Qe,Vn),e(Qe,me),e(me,cs),k(Bt,cs,null),e(me,Rn),e(me,us),e(He,jn),e(He,Ht),ks(r,sl,h),ks(r,_e,h),e(_e,ds),B.block.m(ds,B.anchor=null),B.mount=()=>ds,B.anchor=null,e(_e,Kn),e(_e,Ve),e(Ve,fs),e(fs,Re),k(Ot,Re,null),e(Re,Wn),e(Ve,Xn),e(Ve,hs),e(hs,je),k(Jt,je,null),e(je,Yn),g=!0,Zn||(qa=[q(v,"focus",s[2],{once:!0}),q(v,"mouseover",s[2],{once:!0}),q(j,"click",s[7]),q(O,"click",s[8]),q(te,"click",s[9]),q(K,"click",s[10]),q(se,"click",s[11]),q(W,"click",s[12]),q(le,"click",s[13]),q(X,"click",s[14]),q(ne,"click",s[15]),q(Y,"click",s[16]),q(oe,"click",s[17]),q(Z,"click",s[18]),q(re,"click",s[19]),q(y,"click",s[20]),q(x,"click",s[21]),q(ee,"click",s[22])],Zn=!0)},p(r,[h]){var Vt;s=r,(!g||h&2)&&u!==(u="platformOS"+((Vt=s[1].online)!=null&&Vt.MPKIT_URL?": "+s[1].online.MPKIT_URL.replace("https://",""):""))&&(document.title=u);const ge={};h&2&&(ge.icon=s[1].header.includes("database")?"pinFilled":"pin"),T.$set(ge),(!g||h&2)&&Ls!==(Ls=s[1].header.includes("database")?"Unpin Database from":"Pin Database to")&&be(Hs,Ls),(!g||h&2&&Os!==(Os=(s[1].header.includes("database")?"Unpin Database from":"Pin Database to")+" header menu"))&&t(O,"title",Os),(!g||h&1)&&A(_,"showDescription",s[0].includes("database"));const H={};h&2&&(H.icon=s[1].header.includes("users")?"pinFilled":"pin"),Pe.$set(H),(!g||h&2)&&Es!==(Es=s[1].header.includes("users")?"Unpin Users from":"Pin Users to")&&be(Js,Es),(!g||h&2&&Fs!==(Fs=(s[1].header.includes("users")?"Unpin Users from":"Pin Users to")+" header menu"))&&t(K,"title",Fs),(!g||h&1)&&A(J,"showDescription",s[0].includes("users"));const $e={};h&2&&($e.icon=s[1].header.includes("logs")?"pinFilled":"pin"),Ie.$set($e),(!g||h&2)&&ws!==(ws=s[1].header.includes("logs")?"Unpin Logs from":"Pin Logs to")&&be(Qs,ws),(!g||h&2&&Gs!==(Gs=(s[1].header.includes("logs")?"Unpin Logs from":"Pin Logs to")+" header menu"))&&t(W,"title",Gs),(!g||h&1)&&A(F,"showDescription",s[0].includes("logs"));const Ft={};h&2&&(Ft.icon=s[1].header.includes("backgroundJobs")?"pinFilled":"pin"),qe.$set(Ft),(!g||h&2)&&Us!==(Us=s[1].header.includes("backgroundJobs")?"Unpin Background Jobs from":"Pin Background Jobs to")&&be(Vs,Us),(!g||h&2&&Rs!==(Rs=(s[1].header.includes("backgroundJobs")?"Unpin Background Jobs from":"Pin Background Jobs to")+" header menu"))&&t(X,"title",Rs),(!g||h&1)&&A(Q,"showDescription",s[0].includes("backgroundJobs"));const qs={};h&2&&(qs.icon=s[1].header.includes("constants")?"pinFilled":"pin"),ze.$set(qs),(!g||h&2)&&Cs!==(Cs=s[1].header.includes("constants")?"Unpin Constants from":"Pin Constants to")&&be(js,Cs),(!g||h&2&&Ks!==(Ks=(s[1].header.includes("constants")?"Unpin Constants from":"Pin Constants to")+" header menu"))&&t(Y,"title",Ks),(!g||h&1)&&A(G,"showDescription",s[0].includes("constants"));const Qt={};h&2&&(Qt.icon=s[1].header.includes("liquid")?"pinFilled":"pin"),Ae.$set(Qt),(!g||h&2)&&Ps!==(Ps=s[1].header.includes("liquid")?"Unpin Liquid Evaluator from":"Pin Liquid Evaluator to")&&be(Ws,Ps),(!g||h&2&&Xs!==(Xs=(s[1].header.includes("liquid")?"Unpin Liquid Evaluator from":"Pin Liquid Evaluator to")+" header menu"))&&t(Z,"title",Xs),(!g||h&1)&&A(V,"showDescription",s[0].includes("liquid"));const Ds={};h&2&&(Ds.icon=s[1].header.includes("graphiql")?"pinFilled":"pin"),Be.$set(Ds),(!g||h&2)&&Ts!==(Ts=s[1].header.includes("graphiql")?"Unpin GraphiQL from":"Pin GraphiQL to")&&be(Ys,Ts),(!g||h&2&&Zs!==(Zs=(s[1].header.includes("graphiql")?"Unpin GraphiQL from":"Pin GraphiQL to")+" header menu"))&&t(y,"title",Zs),(!g||h&1)&&A(R,"showDescription",s[0].includes("graphiql"));const Gt={};h&2&&(Gt.icon=s[1].header.includes("logsv2")?"pinFilled":"pin"),Fe.$set(Gt),(!g||h&2)&&Is!==(Is=s[1].header.includes("logsv2")?"Unpin Logs v2 from":"Pin Logs v2 to")&&be(ys,Is),(!g||h&2&&xs!==(xs=(s[1].header.includes("logsv2")?"Unpin Logs v2 from":"Pin Logs v2 to")+" header menu"))&&t(x,"title",xs);const zs={};h&2&&(zs.icon=s[1].header.includes("network")?"pinFilled":"pin"),Ge.$set(zs),(!g||h&2)&&Ns!==(Ns=s[1].header.includes("network")?"Unpin Network Logs from":"Pin Network Logs to")&&be(el,Ns),(!g||h&2&&tl!==(tl=(s[1].header.includes("network")?"Unpin Network Logs from":"Pin Network Logs to")+" header menu"))&&t(ee,"title",tl),Lo(B,s,h)},i(r){g||(p(D.$$.fragment,r),p(Ee.$$.fragment,r),p(T.$$.fragment,r),p(Ye.$$.fragment,r),p(xe.$$.fragment,r),p(Pe.$$.fragment,r),p(st.$$.fragment,r),p(at.$$.fragment,r),p(Ie.$$.fragment,r),p(it.$$.fragment,r),p(dt.$$.fragment,r),p(qe.$$.fragment,r),p(vt.$$.fragment,r),p(_t.$$.fragment,r),p(ze.$$.fragment,r),p(kt.$$.fragment,r),p(wt.$$.fragment,r),p(Ae.$$.fragment,r),p(Tt.$$.fragment,r),p(qt.$$.fragment,r),p(Be.$$.fragment,r),p(Fe.$$.fragment,r),p(At.$$.fragment,r),p(Ge.$$.fragment,r),p(Bt.$$.fragment,r),p(B.block),p(Ot.$$.fragment,r),p(Jt.$$.fragment,r),g=!0)},o(r){m(D.$$.fragment,r),m(Ee.$$.fragment,r),m(T.$$.fragment,r),m(Ye.$$.fragment,r),m(xe.$$.fragment,r),m(Pe.$$.fragment,r),m(st.$$.fragment,r),m(at.$$.fragment,r),m(Ie.$$.fragment,r),m(it.$$.fragment,r),m(dt.$$.fragment,r),m(qe.$$.fragment,r),m(vt.$$.fragment,r),m(_t.$$.fragment,r),m(ze.$$.fragment,r),m(kt.$$.fragment,r),m(wt.$$.fragment,r),m(Ae.$$.fragment,r),m(Tt.$$.fragment,r),m(qt.$$.fragment,r),m(Be.$$.fragment,r),m(Fe.$$.fragment,r),m(At.$$.fragment,r),m(Ge.$$.fragment,r),m(Bt.$$.fragment,r);for(let h=0;h<3;h+=1){const ge=B.blocks[h];m(ge)}m(Ot.$$.fragment,r),m(Jt.$$.fragment,r),g=!1},d(r){r&&(a(w),a(d),a(sl),a(_e)),L(D),L(Ee),L(T),L(Ye),L(xe),L(Pe),L(st),L(at),L(Ie),L(it),L(dt),L(qe),L(vt),L(_t),L(ze),L(kt),L(wt),L(Ae),L(Tt),L(qt),L(Be),L(Fe),L(At),L(Ge),L(Bt),B.block.d(),B.token=null,B=null,L(Ot),L(Jt),Zn=!1,po(qa)}}}function Po(s,u,w){let d;mo(s,Ss,T=>w(1,d=T));let f=[];const _=async()=>{d.tables.length||ca(Ss,d.tables=await bo.get(),d)},v=T=>{d.header.indexOf(T)>-1?ca(Ss,d.header=d.header.filter(Ue=>Ue!==T),d):ca(Ss,d.header=[...d.header,T],d),localStorage.header=JSON.stringify(d.header)},C=T=>{f.indexOf(T)>-1?w(0,f=f.filter(Ue=>Ue!==T)):w(0,f=[...f,T])};return[f,d,_,v,C,async()=>await(await fetch("https://registry.npmjs.org/@platformos/pos-cli/latest")).json(),()=>{navigator.clipboard.writeText("npm i -g @platformos/pos-cli@latest").then(()=>{Ss.notification.create("info","
    Update command copied to clipboard Run npm i -g @platformos/pos-cli@latest in the terminal
    ")}).catch(T=>{copying=!1,error=!0,console.error(T)})},()=>C("database"),()=>v("database"),()=>C("users"),()=>v("users"),()=>C("logs"),()=>v("logs"),()=>C("backgroundJobs"),()=>v("backgroundJobs"),()=>C("constants"),()=>v("constants"),()=>C("liquid"),()=>v("liquid"),()=>C("graphiql"),()=>v("graphiql"),()=>v("logsv2"),()=>v("network")]}class So extends go{constructor(u){super(),$o(this,u,Po,Co,ho,{})}}export{So as component}; diff --git a/gui/next/build/_app/version.json b/gui/next/build/_app/version.json new file mode 100644 index 00000000..4b974e5e --- /dev/null +++ b/gui/next/build/_app/version.json @@ -0,0 +1 @@ +{"version":"1750758919196"} \ No newline at end of file diff --git a/gui/next/build/favicon.png b/gui/next/build/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..9fffb15c24546ca430e79b2b4fc71f9369178820 GIT binary patch literal 1548 zcmV+n2J`ueP)esbKb1`dne5V<-=be*5GQdz4qGY z?8`JA-s=B~KPCa&<-xUhIZo;TewRNtb*WI+fBubzj!`A5)j>m;qWD_`c)51tcscet zCWoDK9WOX8cPp_rr00qmXP=>AD~>xZzE~4yR3y zI*aS1xD%)IE`+zAP4hbCrC3s{xkYhJr%TDa(Zpp@DUpzng4xK!M59eS_w5vZeZAxw z!=EO=<~j&zaFrx4;2Xc>6@`rJClCOJhpnhGI7gs!s>ptR5j`&{ z)wLja=eq=6?Wk>a{$zvFGka9Xp+UytG<8n`>@{rr`I=hykJoAiks>)CjsPt~#oz$` zTTi)IM$k6=@?+!V=m8+{O#+`TF*D!qk|QKmhP>{i%mqTwN7`e`a8F|(xzVt__^@eb z;@*F?ShZcGSS4gZB^Zs_Ld;`V64mI*q;^b4qPx@cK3in(Rf#|b<5&Yg_McM}^1sZh zNklUg$eRHT#U%y;(IvJ&IoPr{N$=H>ESeljCPuX2&|@iIl6|09wq2-LzWrCw|N3)- z#Padpgo*Ru0AIQ0+OMkE)(o5tbKTHtoc+|JotWZHPiwMkjfuF;F_y5I&VQWxaV_aOX z)(N?V;BSO1R{~L#9QiCE@cA-BiZg1F@!1C413XUgh#<|sjDUA?0IA!jkyQ5d9H5=( z#mP?z09fdx2*90p3|h^H>KNjdg`9${Q>fp4`Mc*Q-Lc7&7Q&~-G^B0 zV6mWmRWaZ0DqCo0C)EWXlj^FAX2>OdnJNFVDgvSmX6KGg>LE3|H!f&6NWf+4u!s)@ zIN%tFKppr4WrA7=4q`Z8ce)R$x6qqlopD|5m4L*hT7s-$YJZs_KlaOX`Dc{C$ICL0 z(Vid(2Q$LPN6Xh7@`H@#lz>9s7WYB~EpJ+sp#1fes9Qq7v7l|9^`r>Ua(tO4EBu@& zclF~rnbV&$n8r9p&q*G#21euDKh}@SikahmR3Y5U0h<;t&#srm?HeR!dj`pI9@kUF zX!-an_~-r8{FSR+qd%p}^Ky>WF{K-nOBOp1JELKYcY#Dkv=_xDCeh8T;&zTj$KkNs z9OG$$&!{h`c`Fk5F0d1_c@9yu11y&L5`{QVF&8}EL%X{BFc;`_n!DPd-(=!4r!(?)wJh+>m!Vdr;s)B|vb_;?-2@tS|?Lu5OG~J0({Z?RP3!jY1G}zZI+e{RC z*x?a>WxzT?Nwomc+JBhkB#W z7uRn?rkQjlhAkE&Am+t?6NtR25*#(EVPH&y|JtkBW1Ug{(dL5>XtxSKtKK^C9R1eq yzGkIz%WzlPw*NH(csLdoWLX~HdrkZ2?f74#ixE> + + + + + + + + + + + + + + +
    + +
    + + diff --git a/gui/next/build/prism.js b/gui/next/build/prism.js new file mode 100644 index 00000000..ea520171 --- /dev/null +++ b/gui/next/build/prism.js @@ -0,0 +1,8 @@ +/* PrismJS 1.29.0 +https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+liquid+markup-templating&plugins=line-numbers+normalize-whitespace */ +var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,r={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof i?new i(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/=g.reach);A+=w.value.length,w=w.next){var E=w.value;if(n.length>e.length)return;if(!(E instanceof i)){var P,L=1;if(y){if(!(P=l(b,A,e,m))||P.index>=e.length)break;var S=P.index,O=P.index+P[0].length,j=A;for(j+=w.value.length;S>=j;)j+=(w=w.next).value.length;if(A=j-=w.value.length,w.value instanceof i)continue;for(var C=w;C!==n.tail&&(jg.reach&&(g.reach=W);var z=w.prev;if(_&&(z=u(n,z,_),A+=_.length),c(n,z,L),w=u(n,z,new i(f,p?a.tokenize(N,p):N,k,N)),M&&u(n,w,M),L>1){var I={cause:f+","+d,reach:W};o(e,n,t,w.prev,A,I),g&&I.reach>g.reach&&(g.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function u(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function c(e,n,t){for(var r=n.next,a=0;a"+i.content+""},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(n){var t=JSON.parse(n.data),r=t.language,i=t.code,l=t.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),l&&e.close()}),!1),a):a;var g=a.util.currentScript();function f(){a.manual||a.highlightAll()}if(g&&(a.filename=g.src,g.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&g&&g.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return a}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); +Prism.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var t={"included-cdata":{pattern://i,inside:s}};t["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var n={};n[a]={pattern:RegExp("(<__[^>]*>)(?:))*\\]\\]>|(?!)".replace(/__/g,(function(){return a})),"i"),lookbehind:!0,greedy:!0,inside:t},Prism.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(a,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+a+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml; +!function(e){function n(e,n){return"___"+e.toUpperCase()+n+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(t,a,r,o){if(t.language===a){var c=t.tokenStack=[];t.code=t.code.replace(r,(function(e){if("function"==typeof o&&!o(e))return e;for(var r,i=c.length;-1!==t.code.indexOf(r=n(a,i));)++i;return c[i]=e,r})),t.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(t,a){if(t.language===a&&t.tokenStack){t.grammar=e.languages[a];var r=0,o=Object.keys(t.tokenStack);!function c(i){for(var u=0;u=o.length);u++){var g=i[u];if("string"==typeof g||g.content&&"string"==typeof g.content){var l=o[r],s=t.tokenStack[l],f="string"==typeof g?g:g.content,p=n(a,l),k=f.indexOf(p);if(k>-1){++r;var m=f.substring(0,k),d=new e.Token(a,e.tokenize(s,t.grammar),"language-"+a,s),h=f.substring(k+p.length),v=[];m&&v.push.apply(v,c([m])),v.push(d),h&&v.push.apply(v,c([h])),"string"==typeof g?i.splice.apply(i,[u,1].concat(v)):g.content=v}}else g.content&&c(g.content)}return i}(t.tokens)}}}})}(Prism); +Prism.languages.liquid={comment:{pattern:/(^\{%\s*comment\s*%\})[\s\S]+(?=\{%\s*endcomment\s*%\}$)/,lookbehind:!0},delimiter:{pattern:/^\{(?:\{\{|[%\{])-?|-?(?:\}\}|[%\}])\}$/,alias:"punctuation"},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},keyword:/\b(?:as|assign|break|(?:end)?(?:capture|case|comment|for|form|if|paginate|raw|style|tablerow|unless)|continue|cycle|decrement|echo|else|elsif|in|include|increment|limit|liquid|offset|range|render|reversed|section|when|with)\b/,object:/\b(?:address|all_country_option_tags|article|block|blog|cart|checkout|collection|color|country|country_option_tags|currency|current_page|current_tags|customer|customer_address|date|discount_allocation|discount_application|external_video|filter|filter_value|font|forloop|fulfillment|generic_file|gift_card|group|handle|image|line_item|link|linklist|localization|location|measurement|media|metafield|model|model_source|order|page|page_description|page_image|page_title|part|policy|product|product_option|recommendations|request|robots|routes|rule|script|search|selling_plan|selling_plan_allocation|selling_plan_group|shipping_method|shop|shop_locale|sitemap|store_availability|tax_line|template|theme|transaction|unit_price_measurement|user_agent|variant|video|video_source)\b/,function:[{pattern:/(\|\s*)\w+/,lookbehind:!0,alias:"filter"},{pattern:/(\.\s*)(?:first|last|size)/,lookbehind:!0}],boolean:/\b(?:false|nil|true)\b/,range:{pattern:/\.\./,alias:"operator"},number:/\b\d+(?:\.\d+)?\b/,operator:/[!=]=|<>|[<>]=?|[|?:=-]|\b(?:and|contains(?=\s)|or)\b/,punctuation:/[.,\[\]()]/,empty:{pattern:/\bempty\b/,alias:"keyword"}},Prism.hooks.add("before-tokenize",(function(e){var t=!1;Prism.languages["markup-templating"].buildPlaceholders(e,"liquid",/\{%\s*comment\s*%\}[\s\S]*?\{%\s*endcomment\s*%\}|\{(?:%[\s\S]*?%|\{\{[\s\S]*?\}\}|\{[\s\S]*?\})\}/g,(function(e){var n=/^\{%-?\s*(\w+)/.exec(e);if(n){var i=n[1];if("raw"===i&&!t)return t=!0,!0;if("endraw"===i)return t=!1,!0}return!t}))})),Prism.hooks.add("after-tokenize",(function(e){Prism.languages["markup-templating"].tokenizePlaceholders(e,"liquid")})); +!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var e="line-numbers",n=/\n(?!$)/g,t=Prism.plugins.lineNumbers={getLine:function(n,t){if("PRE"===n.tagName&&n.classList.contains(e)){var i=n.querySelector(".line-numbers-rows");if(i){var r=parseInt(n.getAttribute("data-start"),10)||1,s=r+(i.children.length-1);ts&&(t=s);var l=t-r;return i.children[l]}}},resize:function(e){r([e])},assumeViewportIndependence:!0},i=void 0;window.addEventListener("resize",(function(){t.assumeViewportIndependence&&i===window.innerWidth||(i=window.innerWidth,r(Array.prototype.slice.call(document.querySelectorAll("pre.line-numbers"))))})),Prism.hooks.add("complete",(function(t){if(t.code){var i=t.element,s=i.parentNode;if(s&&/pre/i.test(s.nodeName)&&!i.querySelector(".line-numbers-rows")&&Prism.util.isActive(i,e)){i.classList.remove(e),s.classList.add(e);var l,o=t.code.match(n),a=o?o.length+1:1,u=new Array(a+1).join("");(l=document.createElement("span")).setAttribute("aria-hidden","true"),l.className="line-numbers-rows",l.innerHTML=u,s.hasAttribute("data-start")&&(s.style.counterReset="linenumber "+(parseInt(s.getAttribute("data-start"),10)-1)),t.element.appendChild(l),r([s]),Prism.hooks.run("line-numbers",t)}}})),Prism.hooks.add("line-numbers",(function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}))}function r(e){if(0!=(e=e.filter((function(e){var n,t=(n=e,n?window.getComputedStyle?getComputedStyle(n):n.currentStyle||null:null)["white-space"];return"pre-wrap"===t||"pre-line"===t}))).length){var t=e.map((function(e){var t=e.querySelector("code"),i=e.querySelector(".line-numbers-rows");if(t&&i){var r=e.querySelector(".line-numbers-sizer"),s=t.textContent.split(n);r||((r=document.createElement("span")).className="line-numbers-sizer",t.appendChild(r)),r.innerHTML="0",r.style.display="block";var l=r.getBoundingClientRect().height;return r.innerHTML="",{element:e,lines:s,lineHeights:[],oneLinerHeight:l,sizer:r}}})).filter(Boolean);t.forEach((function(e){var n=e.sizer,t=e.lines,i=e.lineHeights,r=e.oneLinerHeight;i[t.length-1]=void 0,t.forEach((function(e,t){if(e&&e.length>1){var s=n.appendChild(document.createElement("span"));s.style.display="block",s.textContent=e}else i[t]=r}))})),t.forEach((function(e){for(var n=e.sizer,t=e.lineHeights,i=0,r=0;rt&&(o[l]="\n"+o[l],a=s)}n[i]=o.join("")}return n.join("\n")}},"undefined"!=typeof module&&module.exports&&(module.exports=n),Prism.plugins.NormalizeWhitespace=new n({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",(function(e){var n=Prism.plugins.NormalizeWhitespace;if((!e.settings||!1!==e.settings["whitespace-normalization"])&&Prism.util.isActive(e.element,"whitespace-normalization",!0))if(e.element&&e.element.parentNode||!e.code){var r=e.element.parentNode;if(e.code&&r&&"pre"===r.nodeName.toLowerCase()){for(var i in null==e.settings&&(e.settings={}),t)if(Object.hasOwnProperty.call(t,i)){var o=t[i];if(r.hasAttribute("data-"+i))try{var a=JSON.parse(r.getAttribute("data-"+i)||"true");typeof a===o&&(e.settings[i]=a)}catch(e){}}for(var l=r.childNodes,s="",c="",u=!1,m=0;m { await page.getByRole('link', { name: 'Background Jobs', exact: true}).first().click(); - await expect(page).toHaveTitle('Jobs: qa-poscli-gui-ci.staging.oregon.platform-os.com/'); + await expect(page).toHaveTitle(`Jobs: ${posInstance.MPKIT_URL.replace('https://', '')}`); }); test('viewing scheduled background jobs', async ({ page }) => { await page.goto(posInstance.MPKIT_URL + 'background_job'); await expect(page.getByText('background job scheduled')).toBeVisible(); - await page.waitForTimeout(5000); + await page.waitForTimeout(1000); await page.goto(url); - await expect(page.getByRole('cell', { name: 'scheduled background job' }).first()).toBeVisible(); + await expect(page.getByRole('cell', { name: 'scheduled background job' }).first()).toBeVisible({ timeout: 10000 }); await expect(page.getByRole('cell', { name: 'high' }).first()).toBeVisible(); await expect(page.getByRole('cell', { name: 'in 10 minutes' }).first()).toBeVisible(); }); @@ -30,7 +30,7 @@ test('viewing scheduled background jobs', async ({ page }) => { test('viewing background job details', async ({ page }) => { await page.goto(posInstance.MPKIT_URL + 'background_job'); await expect(page.getByText('background job scheduled')).toBeVisible(); - await page.waitForTimeout(5000); + await page.waitForTimeout(1000); await page.goto(url); @@ -47,7 +47,7 @@ test('viewing background job details', async ({ page }) => { test('deleting scheduled background job', async ({ page }) => { await page.goto(posInstance.MPKIT_URL + 'background_job_to_delete'); await expect(page.getByText('background job scheduled')).toBeVisible(); - await page.waitForTimeout(5000); + await page.waitForTimeout(1000); page.on('dialog', async dialog => { expect(dialog.message()).toEqual('Are you sure you want to delete this background job?'); @@ -55,7 +55,7 @@ test('deleting scheduled background job', async ({ page }) => { }); await page.goto(url); - await expect(page.locator('tr:has-text("background job to delete")').first()).toBeVisible(); + await expect(page.locator('tr:has-text("background job to delete")').first()).toBeVisible({ timeout: 10000 }); for(const job of await page.locator('tr:has-text("background job to delete")').all()){ await job.getByRole('button', { name: 'More options' }).click(); diff --git a/gui/next/playwright/constants.spec.js b/gui/next/playwright/constants.spec.js index 7ba6924e..00637d8c 100644 --- a/gui/next/playwright/constants.spec.js +++ b/gui/next/playwright/constants.spec.js @@ -1,4 +1,5 @@ import { test, expect } from '@playwright/test'; +import { posInstance } from './helpers/posInstance.js'; const url = './constants'; @@ -9,7 +10,7 @@ test('see home screen', async ({ page }) => { await page.getByRole('link', { name: 'Constants', exact: true}).first().click(); - await expect(page).toHaveTitle('Constants: qa-poscli-gui-ci.staging.oregon.platform-os.com/'); + await expect(page).toHaveTitle(`Constants: ${posInstance.MPKIT_URL.replace('https://', '')}`); }); diff --git a/gui/next/playwright/database.spec.js b/gui/next/playwright/database.spec.js index 08b97157..a716aeb8 100644 --- a/gui/next/playwright/database.spec.js +++ b/gui/next/playwright/database.spec.js @@ -1,4 +1,5 @@ import { test, expect } from '@playwright/test'; +import { posInstance } from './helpers/posInstance.js'; const url = './database'; @@ -9,7 +10,7 @@ test('see home screen', async ({ page }) => { await page.getByRole('link', { name: 'Database', exact: true}).first().click(); - await expect(page).toHaveTitle('Database: qa-poscli-gui-ci.staging.oregon.platform-os.com/'); + await expect(page).toHaveTitle(`Database: ${posInstance.MPKIT_URL.replace('https://', '')}`); }); diff --git a/gui/next/playwright/logs.spec.js b/gui/next/playwright/logs.spec.js index 65b0f3c3..78fbea5b 100644 --- a/gui/next/playwright/logs.spec.js +++ b/gui/next/playwright/logs.spec.js @@ -10,7 +10,7 @@ test('see home screen', async ({ page }) => { await page.getByRole('link', { name: 'Logs', exact: true}).first().click(); - await expect(page).toHaveTitle('Logs: qa-poscli-gui-ci.staging.oregon.platform-os.com/'); + await expect(page).toHaveTitle(`Logs: ${posInstance.MPKIT_URL.replace('https://', '')}`); await expect(page.getByText('No newer logs to show')).toBeVisible(); }); diff --git a/gui/next/playwright/users.spec.js b/gui/next/playwright/users.spec.js index d59799e2..93ae00b2 100644 --- a/gui/next/playwright/users.spec.js +++ b/gui/next/playwright/users.spec.js @@ -1,4 +1,5 @@ import { test, expect } from '@playwright/test'; +import { posInstance } from './helpers/posInstance.js'; const url = './users'; @@ -9,7 +10,7 @@ test('see home screen', async ({ page }) => { await page.getByRole('link', { name: 'Users', exact: true}).first().click(); - await expect(page).toHaveTitle('Users: qa-poscli-gui-ci.staging.oregon.platform-os.com/'); + await expect(page).toHaveTitle(`Users: ${posInstance.MPKIT_URL.replace('https://', '')}`); }); From 8966c0680b5d0b989a553f312b6ae10da2bd2323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Krysiewicz?= Date: Tue, 24 Jun 2025 12:49:12 +0200 Subject: [PATCH 26/31] Hmmm --- gui/next/playwright/backgroundJobs.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/next/playwright/backgroundJobs.spec.js b/gui/next/playwright/backgroundJobs.spec.js index 5186c999..88804b67 100644 --- a/gui/next/playwright/backgroundJobs.spec.js +++ b/gui/next/playwright/backgroundJobs.spec.js @@ -21,7 +21,7 @@ test('viewing scheduled background jobs', async ({ page }) => { await page.goto(url); - await expect(page.getByRole('cell', { name: 'scheduled background job' }).first()).toBeVisible({ timeout: 10000 }); + await expect(page.getByRole('cell', { name: 'scheduled background job' }).first()).toBeVisible({ timeout: 15000 }); await expect(page.getByRole('cell', { name: 'high' }).first()).toBeVisible(); await expect(page.getByRole('cell', { name: 'in 10 minutes' }).first()).toBeVisible(); }); @@ -55,7 +55,7 @@ test('deleting scheduled background job', async ({ page }) => { }); await page.goto(url); - await expect(page.locator('tr:has-text("background job to delete")').first()).toBeVisible({ timeout: 10000 }); + await expect(page.locator('tr:has-text("background job to delete")').first()).toBeVisible({ timeout: 15000 }); for(const job of await page.locator('tr:has-text("background job to delete")').all()){ await job.getByRole('button', { name: 'More options' }).click(); From 9d3a66660ab9197a74b74d3ff791c0b126b0a3c7 Mon Sep 17 00:00:00 2001 From: dariusz gorzeba Date: Tue, 24 Jun 2025 14:25:08 +0200 Subject: [PATCH 27/31] fix jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3e5d2dd9..fb9e059e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -65,7 +65,7 @@ def podTemplate(version) { memory: 2Gi requests: cpu: 2 - memory: 2Gi + memory: 2Gi image: 'node:${version}-alpine' imagePullPolicy: IfNotPresent command: From df890eeda249f4fdc8a4b051df58c255a40bade5 Mon Sep 17 00:00:00 2001 From: Wojciech Grzeszczak Date: Wed, 25 Jun 2025 12:23:18 +0200 Subject: [PATCH 28/31] Cleanup tests --- gui/next/playwright/users.spec.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/gui/next/playwright/users.spec.js b/gui/next/playwright/users.spec.js index d59799e2..0a73272b 100644 --- a/gui/next/playwright/users.spec.js +++ b/gui/next/playwright/users.spec.js @@ -70,16 +70,6 @@ test('adding a new user successfully', async ({ page }) => { test('editing an existing user', async ({ page }) => { await page.goto(url); - - await page.getByRole('button', { name: 'Create a new user' }).click(); - - await page.getByLabel('Email').fill('testedit@test.test'); - await page.getByLabel('Password').fill('testpassword'); - - await page.getByRole('button', { name: 'Create user' }).click(); - - await expect(page.getByRole('cell', { name: 'testedit@test.test' })).toBeVisible(); - await page.getByRole('button', { name: 'Edit user' }).first().click(); await page.getByLabel('Email').fill('testedit2@test.test'); const dialog = page.locator('dialog'); @@ -97,13 +87,6 @@ test('deleting an existing user', async ({ page }) => { }); await page.goto(url); - await page.getByRole('button', { name: 'Create a new user' }).click(); - - await page.getByLabel('Email').fill('testdelete@test.test'); - await page.getByLabel('Password').fill('testpassword'); - - await page.getByRole('button', { name: 'Create user' }).click(); - await expect(page.getByRole('cell', { name: 'testdelete@test.test' })).toBeVisible(); await page.getByRole('button', { name: 'More options' }).first().click(); From ff358e0fea7844d60f4bc1c8ae2c7934c3efa7ec Mon Sep 17 00:00:00 2001 From: Wojciech Grzeszczak Date: Thu, 26 Jun 2025 09:15:11 +0200 Subject: [PATCH 29/31] Test fix --- gui/next/playwright/users.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/next/playwright/users.spec.js b/gui/next/playwright/users.spec.js index ea0ba7a5..430b2b78 100644 --- a/gui/next/playwright/users.spec.js +++ b/gui/next/playwright/users.spec.js @@ -71,7 +71,7 @@ test('adding a new user successfully', async ({ page }) => { test('editing an existing user', async ({ page }) => { await page.goto(url); - await page.getByRole('button', { name: 'Edit user' }).first().click(); + await page.getByRole('button', { name: 'Edit user' }).nth(1).click(); await page.getByLabel('Email').fill('testedit2@test.test'); const dialog = page.locator('dialog'); await dialog.getByRole('button', { name: 'Edit user' }).first().click(); From b27c9db6a4a2894f9ec5671bc13a7838885810d7 Mon Sep 17 00:00:00 2001 From: Wojciech Grzeszczak Date: Mon, 7 Jul 2025 09:05:25 +0200 Subject: [PATCH 30/31] Tests fix --- gui/next/playwright/users.spec.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gui/next/playwright/users.spec.js b/gui/next/playwright/users.spec.js index 430b2b78..1e626d11 100644 --- a/gui/next/playwright/users.spec.js +++ b/gui/next/playwright/users.spec.js @@ -88,10 +88,12 @@ test('deleting an existing user', async ({ page }) => { }); await page.goto(url); - await expect(page.getByRole('cell', { name: 'testdelete@test.test' })).toBeVisible(); - await page.getByRole('button', { name: 'More options' }).first().click(); - await page.getByRole('button', { name: 'Delete user' }).click(); + const user = page.getByRole('cell', { name: 'testdelete@test.test' }); + await expect().toBeVisible(user); + const userRow = user.locator(".."); + await userRow.getByRole('button', { name: 'More options' }).first().click(); + await userRow.getByRole('button', { name: 'Delete user' }).click(); await expect(page.getByRole('cell', { name: 'testdelete@test.test' })).toBeHidden(); }); From ef13c331f16aa79687764396f450d380b40d1154 Mon Sep 17 00:00:00 2001 From: Wojciech Grzeszczak Date: Mon, 7 Jul 2025 09:08:14 +0200 Subject: [PATCH 31/31] Tests fix --- gui/next/playwright/users.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/next/playwright/users.spec.js b/gui/next/playwright/users.spec.js index 1e626d11..8d66732b 100644 --- a/gui/next/playwright/users.spec.js +++ b/gui/next/playwright/users.spec.js @@ -90,7 +90,7 @@ test('deleting an existing user', async ({ page }) => { await page.goto(url); const user = page.getByRole('cell', { name: 'testdelete@test.test' }); - await expect().toBeVisible(user); + await expect(user).toBeVisible(); const userRow = user.locator(".."); await userRow.getByRole('button', { name: 'More options' }).first().click(); await userRow.getByRole('button', { name: 'Delete user' }).click();
    ID Email
    + + + + {user.id} From deec7445b01176c3915f850a006920c5391199dc Mon Sep 17 00:00:00 2001 From: Wojciech Grzeszczak Date: Wed, 2 Apr 2025 08:42:43 +0200 Subject: [PATCH 02/31] Fix displaying errors when editing records --- gui/next/src/lib/database/Create.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/next/src/lib/database/Create.svelte b/gui/next/src/lib/database/Create.svelte index bec5589a..cfd8f875 100644 --- a/gui/next/src/lib/database/Create.svelte +++ b/gui/next/src/lib/database/Create.svelte @@ -314,7 +314,7 @@ select {
      {#each errors as error}
    • - {JSON.stringify(errors)} + {JSON.stringify(error)}
    • {/each}
    From da8fb31bf48d50e70386bd33254c8c80394c8b9f Mon Sep 17 00:00:00 2001 From: Wojciech Grzeszczak Date: Wed, 7 May 2025 10:09:18 +0200 Subject: [PATCH 03/31] Adding users, pagination fix --- gui/next/package-lock.json | 724 +++++++++++++++++++++++ gui/next/package.json | 3 +- gui/next/src/lib/api/user.js | 57 +- gui/next/src/lib/users/Create.svelte | 278 +++++++++ gui/next/src/lib/users/Delete.svelte | 4 +- gui/next/src/routes/users/+layout.svelte | 102 +++- gui/next/src/style/forms.css | 2 + 7 files changed, 1138 insertions(+), 32 deletions(-) create mode 100644 gui/next/package-lock.json create mode 100644 gui/next/src/lib/users/Create.svelte diff --git a/gui/next/package-lock.json b/gui/next/package-lock.json new file mode 100644 index 00000000..5fa7bd3c --- /dev/null +++ b/gui/next/package-lock.json @@ -0,0 +1,724 @@ +{ + "name": "admin-v2", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "admin-v2", + "version": "0.0.1", + "dependencies": { + "svelte-autosize": "^1.1.0", + "svelte-json-tree": "^2.2.0", + "uuid": "^11.1.0" + }, + "devDependencies": { + "@playwright/test": "^1.48.2", + "@sveltejs/adapter-auto": "^3.3.1", + "@sveltejs/adapter-static": "^3.0.6", + "@sveltejs/kit": "^2.7.3", + "@sveltejs/vite-plugin-svelte": "^3.1.2", + "svelte": "^4.2.19", + "vite": "^5.4.10" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@playwright/test": { + "version": "1.51.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.51.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polka/url": { + "version": "1.0.0-next.28", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.37.0", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sveltejs/adapter-auto": { + "version": "3.3.1", + "dev": true, + "license": "MIT", + "dependencies": { + "import-meta-resolve": "^4.1.0" + }, + "peerDependencies": { + "@sveltejs/kit": "^2.0.0" + } + }, + "node_modules/@sveltejs/adapter-static": { + "version": "3.0.8", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@sveltejs/kit": "^2.0.0" + } + }, + "node_modules/@sveltejs/kit": { + "version": "2.20.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/cookie": "^0.6.0", + "cookie": "^0.6.0", + "devalue": "^5.1.0", + "esm-env": "^1.2.2", + "import-meta-resolve": "^4.1.0", + "kleur": "^4.1.5", + "magic-string": "^0.30.5", + "mrmime": "^2.0.0", + "sade": "^1.8.1", + "set-cookie-parser": "^2.6.0", + "sirv": "^3.0.0" + }, + "bin": { + "svelte-kit": "svelte-kit.js" + }, + "engines": { + "node": ">=18.13" + }, + "peerDependencies": { + "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0", + "svelte": "^4.0.0 || ^5.0.0-next.0", + "vite": "^5.0.3 || ^6.0.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte": { + "version": "3.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@sveltejs/vite-plugin-svelte-inspector": "^2.1.0", + "debug": "^4.3.4", + "deepmerge": "^4.3.1", + "kleur": "^4.1.5", + "magic-string": "^0.30.10", + "svelte-hmr": "^0.16.0", + "vitefu": "^0.2.5" + }, + "engines": { + "node": "^18.0.0 || >=20" + }, + "peerDependencies": { + "svelte": "^4.0.0 || ^5.0.0-next.0", + "vite": "^5.0.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte-inspector": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.0.0 || >=20" + }, + "peerDependencies": { + "@sveltejs/vite-plugin-svelte": "^3.0.0", + "svelte": "^4.0.0 || ^5.0.0-next.0", + "vite": "^5.0.0" + } + }, + "node_modules/@types/autosize": { + "version": "4.0.3", + "license": "MIT" + }, + "node_modules/@types/cookie": { + "version": "0.6.0", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.7", + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.14.1", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/aria-query": { + "version": "5.3.2", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/autosize": { + "version": "6.0.1", + "license": "MIT" + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/code-red": { + "version": "1.0.4", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15", + "@types/estree": "^1.0.1", + "acorn": "^8.10.0", + "estree-walker": "^3.0.3", + "periscopic": "^3.1.0" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/css-tree": { + "version": "2.3.1", + "license": "MIT", + "dependencies": { + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/debug": { + "version": "4.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/devalue": { + "version": "5.1.1", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.21.5", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/esm-env": { + "version": "1.2.2", + "dev": true, + "license": "MIT" + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/import-meta-resolve": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-reference": { + "version": "3.0.3", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.6" + } + }, + "node_modules/kleur": { + "version": "4.1.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/locate-character": { + "version": "3.0.0", + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.17", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/mdn-data": { + "version": "2.0.30", + "license": "CC0-1.0" + }, + "node_modules/mri": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/mrmime": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/periscopic": { + "version": "3.1.0", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^3.0.0", + "is-reference": "^3.0.0" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "dev": true, + "license": "ISC" + }, + "node_modules/playwright": { + "version": "1.51.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.51.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.51.1", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/postcss": { + "version": "8.5.3", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "4.37.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.37.0", + "@rollup/rollup-android-arm64": "4.37.0", + "@rollup/rollup-darwin-arm64": "4.37.0", + "@rollup/rollup-darwin-x64": "4.37.0", + "@rollup/rollup-freebsd-arm64": "4.37.0", + "@rollup/rollup-freebsd-x64": "4.37.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.37.0", + "@rollup/rollup-linux-arm-musleabihf": "4.37.0", + "@rollup/rollup-linux-arm64-gnu": "4.37.0", + "@rollup/rollup-linux-arm64-musl": "4.37.0", + "@rollup/rollup-linux-loongarch64-gnu": "4.37.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.37.0", + "@rollup/rollup-linux-riscv64-gnu": "4.37.0", + "@rollup/rollup-linux-riscv64-musl": "4.37.0", + "@rollup/rollup-linux-s390x-gnu": "4.37.0", + "@rollup/rollup-linux-x64-gnu": "4.37.0", + "@rollup/rollup-linux-x64-musl": "4.37.0", + "@rollup/rollup-win32-arm64-msvc": "4.37.0", + "@rollup/rollup-win32-ia32-msvc": "4.37.0", + "@rollup/rollup-win32-x64-msvc": "4.37.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/rollup/node_modules/@types/estree": { + "version": "1.0.6", + "dev": true, + "license": "MIT" + }, + "node_modules/sade": { + "version": "1.8.1", + "dev": true, + "license": "MIT", + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/set-cookie-parser": { + "version": "2.7.1", + "dev": true, + "license": "MIT" + }, + "node_modules/sirv": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svelte": { + "version": "4.2.19", + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.1", + "@jridgewell/sourcemap-codec": "^1.4.15", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/estree": "^1.0.1", + "acorn": "^8.9.0", + "aria-query": "^5.3.0", + "axobject-query": "^4.0.0", + "code-red": "^1.0.3", + "css-tree": "^2.3.1", + "estree-walker": "^3.0.3", + "is-reference": "^3.0.1", + "locate-character": "^3.0.0", + "magic-string": "^0.30.4", + "periscopic": "^3.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/svelte-autosize": { + "version": "1.1.5", + "license": "MIT", + "dependencies": { + "@types/autosize": "^4.0.3", + "autosize": "*" + }, + "peerDependencies": { + "svelte": ">=3.0.0" + } + }, + "node_modules/svelte-hmr": { + "version": "0.16.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "^12.20 || ^14.13.1 || >= 16" + }, + "peerDependencies": { + "svelte": "^3.19.0 || ^4.0.0" + } + }, + "node_modules/svelte-json-tree": { + "version": "2.2.0", + "license": "MIT", + "peerDependencies": { + "svelte": "^4.0.0" + } + }, + "node_modules/totalist": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/uuid": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, + "node_modules/vite": { + "version": "5.4.15", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vitefu": { + "version": "0.2.5", + "dev": true, + "license": "MIT", + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + } + } +} diff --git a/gui/next/package.json b/gui/next/package.json index 8ddcf0c2..b671bf37 100644 --- a/gui/next/package.json +++ b/gui/next/package.json @@ -20,6 +20,7 @@ "type": "module", "dependencies": { "svelte-autosize": "^1.1.0", - "svelte-json-tree": "^2.2.0" + "svelte-json-tree": "^2.2.0", + "uuid": "^11.1.0" } } diff --git a/gui/next/src/lib/api/user.js b/gui/next/src/lib/api/user.js index db653939..08bead6c 100644 --- a/gui/next/src/lib/api/user.js +++ b/gui/next/src/lib/api/user.js @@ -6,7 +6,7 @@ // imports // ------------------------------------------------------------------------ import { graphql } from '$lib/api/graphql'; - +import { v4 } from 'uuid' const user = { @@ -84,7 +84,60 @@ const user = { `; return graphql({ query }, false) - } + }, + + // purpose: creates a new user + // arguments: + // properties: object containing first_name, last_name, email i password + // returns: id of the new user + // ------------------------------------------------------------------------ + create: async (email, password, firstName, lastName) => { + const userQuery = ` + mutation { + user: user_create(user: { email: "${email}", password: "${password}", properties: []}) { + id + } + } + `; + + return graphql({ query: userQuery }, false).then(data => { + if (data.errors) { + return data + } + const userId = data.user.id; + const name = `${firstName} ${lastName}`; + + const names = Array.from(new Set( + [email.toLowerCase(), firstName.toLowerCase(), lastName.toLowerCase()] + )).join(' '); + + const profileQuery = ` + mutation { + record: record_create( + record: { + table: "modules/user/profile" + properties: [ + { name: "user_id", value: "${userId}" } + { name: "uuid", value: "${v4()}" } + { name: "first_name", value: "${firstName}" } + { name: "last_name", value: "${lastName}" } + { name: "name", value: "${name}" } + { name: "email", value: "${email}" } + { name: "roles", value_array: ["member"] } + { name: "c__names", value: "${names}" } + ] + } + ) { + id + } + } + `; + + return graphql({query: profileQuery }, false).then(() => userId); + }); + }, + + }; diff --git a/gui/next/src/lib/users/Create.svelte b/gui/next/src/lib/users/Create.svelte new file mode 100644 index 00000000..fef88333 --- /dev/null +++ b/gui/next/src/lib/users/Create.svelte @@ -0,0 +1,278 @@ + + + + + + + + + + + + +
    + +
    +
    + + + +
    + +
    +
    +
    + + + +
    + +
    +
    +
    + + + +
    + +
    +
    +
    + + + +
    + +
    +
    + + +
    +
    + +
    diff --git a/gui/next/src/lib/users/Delete.svelte b/gui/next/src/lib/users/Delete.svelte index eca3a84f..7de6cfc0 100644 --- a/gui/next/src/lib/users/Delete.svelte +++ b/gui/next/src/lib/users/Delete.svelte @@ -18,6 +18,8 @@ let dispatch = createEventDispatcher(); const deleteUser = async (event) => { event.preventDefault(); if(confirm('Are you sure you want to delete this user?')){ + dispatch('close'); + const formData = new FormData(form); const id = formData.get('id') const remove = await user.delete(id); @@ -28,8 +30,6 @@ const deleteUser = async (event) => { } else { state.notification.create('error', `Record ${id} could not be deleted`); } - - dispatch('close'); } } diff --git a/gui/next/src/routes/users/+layout.svelte b/gui/next/src/routes/users/+layout.svelte index 43a007e4..6b2ed7d2 100644 --- a/gui/next/src/routes/users/+layout.svelte +++ b/gui/next/src/routes/users/+layout.svelte @@ -10,6 +10,7 @@ import { quintOut } from 'svelte/easing'; import { page } from '$app/stores'; import { user } from '$lib/api/user.js'; import ContextMenu from '$lib/users/ContextMenu.svelte'; +import CreateUser from '$lib/users/Create.svelte'; import Icon from '$lib/ui/Icon.svelte'; import Number from '$lib/ui/forms/Number.svelte'; @@ -36,6 +37,7 @@ let filters = { ...Object.fromEntries($page.url.searchParams) }; +$state.user = undefined; let contextMenu = { // item id for which the context menu is opened for @@ -47,8 +49,14 @@ let contextMenu = { // ------------------------------------------------------------------------ $: reloadUsers(); -const reloadUsers = function() { - user.get(Object.fromEntries($page.url.searchParams)).then(data => { +const reloadUsers = function(currentPage = null) { + debugger + const params = Object.fromEntries($page.url.searchParams); + if (currentPage) { + params['page'] = currentPage + } + user.get(params).then(data => { + debugger items = data.results; filters.totalPages = data.total_pages; }); @@ -90,6 +98,7 @@ const appear = function(node, { .container { min-height: 0; max-width: 100vw; + overflow-y: auto; display: grid; grid-template-rows: min-content 1fr; } @@ -156,6 +165,10 @@ const appear = function(node, { display: flex; align-items: center; gap: .5em; + position: fixed; + bottom: 0; + width: 100%; + justify-content: space-between; border-block-start: 1px solid var(--color-frame); background-color: rgba(var(--color-rgb-background), .8); @@ -166,7 +179,7 @@ const appear = function(node, { /* content table */ table { min-width: 100%; - + margin-bottom: 70px; line-height: 1.27em; } @@ -244,8 +257,23 @@ const appear = function(node, { width: 30px; } + tr .inner-menu { + background-color: transparent; + opacity: 0; + transition: opacity .1s linear; + } + + tr:hover .inner-menu { + opacity: .5; + } + + .menu:hover .inner-menu, .context .menu .inner-menu { + opacity: 1; + } + .menu button.active { border-end-start-radius: 0; + border-end-end-radius: 0; } @@ -267,7 +295,13 @@ const appear = function(node, { id="filters" on:submit={ // reset page number when changing filters except when directly changing a page - async event => { if(event.submitter?.dataset.action !== 'numberIncrease'){ event.preventDefault(); filters.page = 1; await tick(); goto(document.location.pathname + '?' + (new URLSearchParams(new FormData(event.target)).toString())); } } + async event => { + event.preventDefault(); + const params = new URLSearchParams(new FormData(event.target)); + goto(document.location.pathname + '?' + params.toString()); + await tick(); + await reloadUsers(params.get('page') ?? null); + } } > @@ -305,17 +339,20 @@ const appear = function(node, { {#each items as user}
    ID Email