diff --git a/app/javascript/scss/elements/_warning.scss b/app/javascript/scss/elements/_warning.scss index 76d3ee302..7ae989071 100644 --- a/app/javascript/scss/elements/_warning.scss +++ b/app/javascript/scss/elements/_warning.scss @@ -27,7 +27,6 @@ &--orange, &--warning { background: $orange; - font-size: $font-size-small; } p { diff --git a/app/javascript/scss/utilities/_text.scss b/app/javascript/scss/utilities/_text.scss index 3be3c6fee..58145f754 100644 --- a/app/javascript/scss/utilities/_text.scss +++ b/app/javascript/scss/utilities/_text.scss @@ -28,6 +28,12 @@ } } +.text-truncate { + overflow-x: hidden; + text-overflow: ellipsis; + display: inline-block; +} + .text-small { font-size: $font-size-small; line-height: 1.35em; diff --git a/app/javascript/src/components/editor/Editor.svelte b/app/javascript/src/components/editor/Editor.svelte index 6d054054c..b3bbe34cc 100644 --- a/app/javascript/src/components/editor/Editor.svelte +++ b/app/javascript/src/components/editor/Editor.svelte @@ -20,6 +20,7 @@ import Bugsnag from "@components/Bugsnag.svelte" import EyeIcon from "@components/icon/Eye.svelte" import Logs from "@components/editor/Logs.svelte" + import { fetchProject } from "@src/utils/project" export let bugsnagApiKey = "" export let _isSignedIn = false @@ -60,6 +61,12 @@ loading = false }) + $: if ($currentProjectUUID && !$projects.some(({ uuid }) => uuid === $currentProjectUUID)) { + fetchProject($currentProjectUUID).then((currentProject) => { + $projects.push(currentProject) + }) + } + function parseKeywords() { const { events, values, actions, constants, heroes, maps } = data @@ -196,6 +203,7 @@ if (!data) throw Error("No projects data was returned.") return JSON.parse(data) + .map((project) => ({ ... project, is_owner: true })) }) .catch(error => { alert(`Something went wrong while loading, please try again. ${error}`) diff --git a/app/javascript/src/components/editor/EditorActions.svelte b/app/javascript/src/components/editor/EditorActions.svelte index 22b536473..262250a1f 100644 --- a/app/javascript/src/components/editor/EditorActions.svelte +++ b/app/javascript/src/components/editor/EditorActions.svelte @@ -17,8 +17,8 @@
{#if $currentProjectUUID && !$currentProject?.is_owner && !$isMobile} -
- You do not own this project and can not save +
+ You do not own this project
{/if} @@ -68,7 +68,7 @@
{/if} - {#if $isSignedIn && $currentProject?.is_owner} + {#if $isSignedIn} {/if}
diff --git a/app/javascript/src/components/editor/Modals/CreateProjectModal.svelte b/app/javascript/src/components/editor/Modals/CreateProjectModal.svelte index 0cde56fb7..06377440d 100644 --- a/app/javascript/src/components/editor/Modals/CreateProjectModal.svelte +++ b/app/javascript/src/components/editor/Modals/CreateProjectModal.svelte @@ -13,9 +13,9 @@ loading = true const data = await createProject(value) - if (data != "error") { + if (data) { modal.close() - if (data) setUrl(data.uuid) + setUrl(data.uuid) } loading = false @@ -47,7 +47,7 @@ {#if !$isSignedIn} -
+
You are not signed in and this is for demonstration purposes only. Any changes you make will not be saved.
{/if} diff --git a/app/javascript/src/components/editor/ProjectsDropdown.svelte b/app/javascript/src/components/editor/ProjectsDropdown.svelte index 0206b9b84..30bdc8bac 100644 --- a/app/javascript/src/components/editor/ProjectsDropdown.svelte +++ b/app/javascript/src/components/editor/ProjectsDropdown.svelte @@ -1,6 +1,6 @@ -