Date: Thu, 15 Aug 2024 10:26:01 -0700
Subject: [PATCH 03/15] ensure thumbnails only ever assign themselves as their
thumbnail (#10957)
---
.../src/common/services/FileThumbnailJobState.tsx | 6 ++++++
.../src/projects/project/project-helper.ts | 12 +++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/packages/client-core/src/common/services/FileThumbnailJobState.tsx b/packages/client-core/src/common/services/FileThumbnailJobState.tsx
index 96f65cb962..148bac50a5 100644
--- a/packages/client-core/src/common/services/FileThumbnailJobState.tsx
+++ b/packages/client-core/src/common/services/FileThumbnailJobState.tsx
@@ -158,6 +158,12 @@ export const FileThumbnailJobState = defineState({
if (seenResources.has(resource.key)) continue
seenResources.add(resource.key)
+ if (resource.type === 'thumbnail') {
+ //set thumbnail's thumbnail as itself
+ Engine.instance.api.service(staticResourcePath).patch(resource.id, { thumbnailKey: resource.key })
+ continue
+ }
+
if (resource.thumbnailKey != null || !extensionCanHaveThumbnail(resource.key.split('.').pop() ?? '')) continue
getMutableState(FileThumbnailJobState).merge([
diff --git a/packages/server-core/src/projects/project/project-helper.ts b/packages/server-core/src/projects/project/project-helper.ts
index fe7121309d..a40a792edd 100644
--- a/packages/server-core/src/projects/project/project-helper.ts
+++ b/packages/server-core/src/projects/project/project-helper.ts
@@ -1784,9 +1784,15 @@ export const uploadLocalProjectToProvider = async (
const stats = await getStats(fileResult, contentType)
const resourceInfo = resourcesJson?.[filePathRelative]
const type = isScene ? 'scene' : getResourceType(filePathRelative, resourceInfo!)
- const thumbnailKey =
- resourceInfo?.thumbnailKey ?? (isScene ? key.split('.').slice(0, -1).join('.') + '.thumbnail.jpg' : undefined)
-
+ let thumbnailKey = resourceInfo?.thumbnailKey
+ if (!thumbnailKey) {
+ if (isScene) {
+ thumbnailKey = key.split('.').slice(0, -1).join('.') + '.thumbnail.jpg'
+ } else if (type === 'thumbnail') {
+ //since thumbnails are not in resource json, we need to redefine their thumbnail keys here
+ thumbnailKey = key
+ }
+ }
if (existingKeySet.has(key)) {
const id = existingKeySet.get(key)!
existingKeySet.delete(key)
From a98fd43bfe05296c0bb10612f95227c139b09968 Mon Sep 17 00:00:00 2001
From: MbfloydIR <144718558+MbfloydIR@users.noreply.github.com>
Date: Thu, 15 Aug 2024 17:35:46 -0700
Subject: [PATCH 04/15] removed the ee url from the link component (#10967)
---
packages/engine/src/scene/components/LinkComponent.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/engine/src/scene/components/LinkComponent.ts b/packages/engine/src/scene/components/LinkComponent.ts
index a4f0dbdd5a..eae4c6238e 100755
--- a/packages/engine/src/scene/components/LinkComponent.ts
+++ b/packages/engine/src/scene/components/LinkComponent.ts
@@ -73,7 +73,7 @@ export const LinkComponent = defineComponent({
onInit: (entity) => {
return {
- url: 'https://www.etherealengine.org',
+ url: '',
sceneNav: false,
location: ''
}
From 13ad7d16fc63b82eec5e20febc07857c1eaef5a0 Mon Sep 17 00:00:00 2001
From: Appaji <52322531+CITIZENDOT@users.noreply.github.com>
Date: Fri, 16 Aug 2024 06:08:32 +0530
Subject: [PATCH 05/15] IR-3921: Copying resource should create a
static-resource entry (#10949)
* Copy operation should create a static-resource with `create`
Currently, if we copy a resource in studio's file browser, it does not create an entry in static-resource table. But it updates the existing entry with new key. This PR fixes it by identifying copy operations and creating a fresh entry for them.
* Add test
---
.../media/file-browser/file-browser.class.ts | 39 +++++++++++++++----
.../media/file-browser/file-browser.test.ts | 25 ++++++++++--
2 files changed, 52 insertions(+), 12 deletions(-)
diff --git a/packages/server-core/src/media/file-browser/file-browser.class.ts b/packages/server-core/src/media/file-browser/file-browser.class.ts
index f196369c3b..47da48a5bf 100755
--- a/packages/server-core/src/media/file-browser/file-browser.class.ts
+++ b/packages/server-core/src/media/file-browser/file-browser.class.ts
@@ -244,14 +244,37 @@ export class FileBrowserService
const results = [] as StaticResourceType[]
for (const resource of staticResources) {
const newKey = resource.key.replace(path.join(oldDirectory, oldName), path.join(newDirectory, fileName))
- const result = await this.app.service(staticResourcePath).patch(
- resource.id,
- {
- key: newKey
- },
- { isInternal: true }
- )
- results.push(result)
+
+ if (data.isCopy) {
+ const result = await this.app.service(staticResourcePath).create(
+ {
+ key: newKey,
+ hash: resource.hash,
+ mimeType: resource.mimeType,
+ project: data.newProject,
+ stats: resource.stats,
+ type: resource.type,
+ tags: resource.tags,
+ dependencies: resource.dependencies,
+ licensing: resource.licensing,
+ description: resource.description,
+ attribution: resource.attribution,
+ thumbnailKey: resource.thumbnailKey,
+ thumbnailMode: resource.thumbnailMode
+ },
+ { isInternal: true }
+ )
+ results.push(result)
+ } else {
+ const result = await this.app.service(staticResourcePath).patch(
+ resource.id,
+ {
+ key: newKey
+ },
+ { isInternal: true }
+ )
+ results.push(result)
+ }
}
if (config.fsProjectSyncEnabled) {
diff --git a/packages/server-core/src/media/file-browser/file-browser.test.ts b/packages/server-core/src/media/file-browser/file-browser.test.ts
index 82681a7901..577ec87280 100644
--- a/packages/server-core/src/media/file-browser/file-browser.test.ts
+++ b/packages/server-core/src/media/file-browser/file-browser.test.ts
@@ -28,7 +28,7 @@ import assert from 'assert'
import { fileBrowserPath } from '@etherealengine/common/src/schemas/media/file-browser.schema'
import { destroyEngine } from '@etherealengine/ecs/src/Engine'
-import { ProjectType, projectPath } from '@etherealengine/common/src/schema.type.module'
+import { ProjectType, projectPath, staticResourcePath } from '@etherealengine/common/src/schema.type.module'
import { Application } from '../../../declarations'
import { createFeathersKoaApp } from '../../createApp'
import { getStorageProvider } from '../storageprovider/storageprovider'
@@ -227,18 +227,35 @@ describe('file-browser.test', () => {
})
it('copies file', async () => {
+ const oldPath = 'projects/' + testProjectName2 + '/public/'
+ const newPath = 'projects/' + testProjectName + '/public/'
+
const copyFileResult = await app.service(fileBrowserPath).update(null, {
oldProject: testProjectName2,
newProject: testProjectName,
oldName: testFileName2,
newName: testFileName2,
- oldPath: 'projects/' + testProjectName2 + '/public/',
- newPath: 'projects/' + testProjectName + '/public/',
+ oldPath,
+ newPath,
isCopy: true
})
assert.equal(copyFileResult.length, 1)
- assert(copyFileResult[0].key === 'projects/' + testProjectName + '/public/' + testFileName2)
+ assert(copyFileResult[0].key === newPath + testFileName2)
+
+ const originalResource = await app.service(staticResourcePath).find({
+ query: {
+ key: oldPath + testFileName2
+ }
+ })
+ assert.ok(originalResource.data.length === 1, 'Original resource not found')
+
+ const copiedResource = await app.service(staticResourcePath).find({
+ query: {
+ key: newPath + testFileName2
+ }
+ })
+ assert.ok(copiedResource.data.length === 1, 'Copied resource not found')
})
it('copies directory', async () => {
From 983bcfc28ce8247d87b77f409030659e60947de7 Mon Sep 17 00:00:00 2001
From: Hanzla Mateen
Date: Fri, 16 Aug 2024 05:57:50 +0500
Subject: [PATCH 06/15] Changes to fix exception with zendesk not defined
(#10974)
---
packages/client-core/src/hooks/useZendesk.ts | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/packages/client-core/src/hooks/useZendesk.ts b/packages/client-core/src/hooks/useZendesk.ts
index a03a811f7f..5f194eb746 100644
--- a/packages/client-core/src/hooks/useZendesk.ts
+++ b/packages/client-core/src/hooks/useZendesk.ts
@@ -32,7 +32,7 @@ import { AuthState } from '../user/services/AuthService'
declare global {
interface Window {
- zE: (...args: any) => void
+ zE?: (...args: any) => void
}
}
@@ -49,7 +49,7 @@ export const useZendesk = () => {
const authenticateUser = () => {
if (authenticated.value || config.client.zendesk.authenticationEnabled !== 'true') return
- window.zE('messenger', 'loginUser', function (callback: any) {
+ window.zE?.('messenger', 'loginUser', function (callback: any) {
zendeskMutation.create().then(async (token) => {
authenticated.set(true)
await callback(token)
@@ -71,10 +71,10 @@ export const useZendesk = () => {
hideWidget()
authenticateUser()
}
- window.zE('messenger:on', 'close', () => {
+ window.zE?.('messenger:on', 'close', () => {
hideWidget()
})
- window.zE('messenger:on', 'open', function () {
+ window.zE?.('messenger:on', 'open', function () {
showWidget()
})
})
@@ -89,28 +89,28 @@ export const useZendesk = () => {
authenticateUser()
} else if (user.isGuest.value && initialized.value) {
closeChat()
- window.zE('messenger', 'logoutUser')
+ window.zE?.('messenger', 'logoutUser')
}
}, [user.value])
const hideWidget = () => {
if (!initialized.value) return
- window.zE('messenger', 'hide')
+ window.zE?.('messenger', 'hide')
isWidgetVisible.set(false)
}
const showWidget = () => {
if (!initialized.value) return
- window.zE('messenger', 'show')
+ window.zE?.('messenger', 'show')
isWidgetVisible.set(true)
}
const openChat = () => {
if (!initialized.value) return
- window.zE('messenger', 'open')
+ window.zE?.('messenger', 'open')
}
const closeChat = () => {
if (!initialized.value) return
- window.zE('messenger', 'close')
+ window.zE?.('messenger', 'close')
}
return {
From 3646b0b825556efcd0cb681b0eb07d481013a387 Mon Sep 17 00:00:00 2001
From: Hanzla Mateen
Date: Fri, 16 Aug 2024 13:40:28 +0500
Subject: [PATCH 07/15] Changes to pass environment in metabase params (#10982)
* Changes to pass environment in metabase params
* Added migration
---
.../metabase/metabase-setting.schema.ts | 2 +
.../metabase-setting/metabase-setting.seed.ts | 1 +
...40816095000_metabase-environment-column.ts | 74 +++++++++++++++++++
.../metabase-url/metabase-url.hooks.ts | 5 +-
4 files changed, 81 insertions(+), 1 deletion(-)
create mode 100644 packages/server-core/src/integrations/metabase/metabase-setting/migrations/20240816095000_metabase-environment-column.ts
diff --git a/packages/common/src/schemas/integrations/metabase/metabase-setting.schema.ts b/packages/common/src/schemas/integrations/metabase/metabase-setting.schema.ts
index 4877d8a324..cf3f8063c1 100644
--- a/packages/common/src/schemas/integrations/metabase/metabase-setting.schema.ts
+++ b/packages/common/src/schemas/integrations/metabase/metabase-setting.schema.ts
@@ -40,6 +40,7 @@ export const metabaseSettingSchema = Type.Object(
}),
siteUrl: Type.String(),
secretKey: Type.String(),
+ environment: Type.String(),
crashDashboardId: Type.Optional(Type.String()),
expiration: Type.Number(),
createdAt: Type.String({ format: 'date-time' }),
@@ -70,6 +71,7 @@ export const metabaseSettingQueryProperties = Type.Pick(metabaseSettingSchema, [
'id',
'siteUrl',
'secretKey',
+ 'environment',
'crashDashboardId'
])
diff --git a/packages/server-core/src/integrations/metabase/metabase-setting/metabase-setting.seed.ts b/packages/server-core/src/integrations/metabase/metabase-setting/metabase-setting.seed.ts
index bb830a8893..814be9d4c3 100644
--- a/packages/server-core/src/integrations/metabase/metabase-setting/metabase-setting.seed.ts
+++ b/packages/server-core/src/integrations/metabase/metabase-setting/metabase-setting.seed.ts
@@ -42,6 +42,7 @@ export async function seed(knex: Knex): Promise {
{
siteUrl: process.env.METABASE_SITE_URL!,
secretKey: process.env.METABASE_SECRET_KEY!,
+ environment: process.env.METABASE_ENVIRONMENT!,
crashDashboardId: process.env.METABASE_CRASH_DASHBOARD_ID!,
expiration: isNaN(parseInt(process.env.METABASE_EXPIRATION!)) ? 10 : parseInt(process.env.METABASE_EXPIRATION!)
}
diff --git a/packages/server-core/src/integrations/metabase/metabase-setting/migrations/20240816095000_metabase-environment-column.ts b/packages/server-core/src/integrations/metabase/metabase-setting/migrations/20240816095000_metabase-environment-column.ts
new file mode 100644
index 0000000000..391b52006f
--- /dev/null
+++ b/packages/server-core/src/integrations/metabase/metabase-setting/migrations/20240816095000_metabase-environment-column.ts
@@ -0,0 +1,74 @@
+/*
+CPAL-1.0 License
+
+The contents of this file are subject to the Common Public Attribution License
+Version 1.0. (the "License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE.
+The License is based on the Mozilla Public License Version 1.1, but Sections 14
+and 15 have been added to cover use of software over a computer network and
+provide for limited attribution for the Original Developer. In addition,
+Exhibit A has been modified to be consistent with Exhibit B.
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
+specific language governing rights and limitations under the License.
+
+The Original Code is Ethereal Engine.
+
+The Original Developer is the Initial Developer. The Initial Developer of the
+Original Code is the Ethereal Engine team.
+
+All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023
+Ethereal Engine. All Rights Reserved.
+*/
+
+import { metabaseSettingPath } from '@etherealengine/common/src/schemas/integrations/metabase/metabase-setting.schema'
+import type { Knex } from 'knex'
+
+/**
+ * @param { import("knex").Knex } knex
+ * @returns { Promise }
+ */
+export async function up(knex: Knex): Promise {
+ await knex.raw('SET FOREIGN_KEY_CHECKS=0')
+
+ const tableExists = await knex.schema.hasTable(metabaseSettingPath)
+ if (tableExists) {
+ const environmentExists = await knex.schema.hasColumn(metabaseSettingPath, 'environment')
+ if (environmentExists === false) {
+ await knex.schema.alterTable(metabaseSettingPath, async (table) => {
+ table.string('environment').nullable()
+ })
+
+ const metabaseSettings = await knex.table(metabaseSettingPath).first()
+
+ if (metabaseSettings) {
+ await knex.table(metabaseSettingPath).update({
+ environment: process.env.METABASE_ENVIRONMENT
+ })
+ }
+ }
+ }
+ await knex.raw('SET FOREIGN_KEY_CHECKS=1')
+}
+
+/**
+ * @param { import("knex").Knex } knex
+ * @returns { Promise }
+ */
+export async function down(knex: Knex): Promise {
+ await knex.raw('SET FOREIGN_KEY_CHECKS=0')
+
+ const tableExists = await knex.schema.hasTable(metabaseSettingPath)
+ if (tableExists) {
+ const environmentExists = await knex.schema.hasColumn(metabaseSettingPath, 'environment')
+ if (environmentExists) {
+ await knex.schema.alterTable(metabaseSettingPath, async (table) => {
+ table.dropColumn('environment')
+ })
+ }
+ }
+
+ await knex.raw('SET FOREIGN_KEY_CHECKS=1')
+}
diff --git a/packages/server-core/src/integrations/metabase/metabase-url/metabase-url.hooks.ts b/packages/server-core/src/integrations/metabase/metabase-url/metabase-url.hooks.ts
index 4f5c1f0333..69e1ea8800 100644
--- a/packages/server-core/src/integrations/metabase/metabase-url/metabase-url.hooks.ts
+++ b/packages/server-core/src/integrations/metabase/metabase-url/metabase-url.hooks.ts
@@ -47,6 +47,7 @@ export const metabaseCrashDashboard = async (context: HookContext
Date: Fri, 16 Aug 2024 14:28:15 +0500
Subject: [PATCH 08/15] Changes to add metabase environment in admin panel
---
packages/client-core/i18n/en/admin.json | 1 +
.../src/admin/components/settings/tabs/metabase.tsx | 13 ++++++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/packages/client-core/i18n/en/admin.json b/packages/client-core/i18n/en/admin.json
index d40aa031d7..d4ca45826f 100755
--- a/packages/client-core/i18n/en/admin.json
+++ b/packages/client-core/i18n/en/admin.json
@@ -571,6 +571,7 @@
"subtitle": "Edit Metabase Settings",
"siteUrl": "Site Url",
"secretKey": "Secret Key",
+ "environment": "Environment",
"expiration": "Expiration",
"crashDashboardId": "Crash Dashboard Id"
},
diff --git a/packages/client-core/src/admin/components/settings/tabs/metabase.tsx b/packages/client-core/src/admin/components/settings/tabs/metabase.tsx
index 40b4fe6f52..ee76c62584 100644
--- a/packages/client-core/src/admin/components/settings/tabs/metabase.tsx
+++ b/packages/client-core/src/admin/components/settings/tabs/metabase.tsx
@@ -44,6 +44,7 @@ const MetabaseTab = forwardRef(({ open }: { open: boolean }, ref: React.MutableR
const id = useHookstate(undefined)
const siteUrl = useHookstate('')
const secretKey = useHookstate('')
+ const environment = useHookstate('')
const expiration = useHookstate(10)
const crashDashboardId = useHookstate('')
const metabaseSettingMutation = useMutation(metabaseSettingPath)
@@ -55,6 +56,7 @@ const MetabaseTab = forwardRef(({ open }: { open: boolean }, ref: React.MutableR
id.set(data[0].id)
siteUrl.set(data[0].siteUrl)
secretKey.set(data[0].secretKey)
+ environment.set(data[0].environment)
expiration.set(data[0].expiration)
crashDashboardId.set(data[0].crashDashboardId || '')
}
@@ -63,13 +65,14 @@ const MetabaseTab = forwardRef(({ open }: { open: boolean }, ref: React.MutableR
const handleSubmit = (event) => {
event.preventDefault()
- if (!siteUrl.value || !secretKey.value) return
+ if (!siteUrl.value || !secretKey.value || !environment.value) return
state.loading.set(true)
const setting = {
siteUrl: siteUrl.value,
secretKey: secretKey.value,
+ environment: environment.value,
crashDashboardId: crashDashboardId.value
}
@@ -90,6 +93,7 @@ const MetabaseTab = forwardRef(({ open }: { open: boolean }, ref: React.MutableR
id.set(data[0].id)
siteUrl.set(data[0].siteUrl)
secretKey.set(data[0].secretKey)
+ environment.set(data[0].environment)
expiration.set(data[0].expiration)
crashDashboardId.set(data[0].crashDashboardId || '')
}
@@ -112,6 +116,13 @@ const MetabaseTab = forwardRef(({ open }: { open: boolean }, ref: React.MutableR
onChange={(e) => siteUrl.set(e.target.value)}
/>
+ environment.set(e.target.value)}
+ />
+
Date: Fri, 16 Aug 2024 05:37:12 -0400
Subject: [PATCH 09/15] fixed asset image height (#10978)
---
.../ui/src/components/editor/panels/Assets/container/index.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/ui/src/components/editor/panels/Assets/container/index.tsx b/packages/ui/src/components/editor/panels/Assets/container/index.tsx
index 75677ce558..62de188807 100644
--- a/packages/ui/src/components/editor/panels/Assets/container/index.tsx
+++ b/packages/ui/src/components/editor/panels/Assets/container/index.tsx
@@ -211,7 +211,7 @@ const ResourceFile = (props: {
className="mb-3 flex h-auto min-w-40 cursor-pointer flex-col items-center text-center"
>
From 85aaea52bc6cf65bcf882980254d18bf96373f09 Mon Sep 17 00:00:00 2001
From: Andres David Jimenez
Date: Fri, 16 Aug 2024 03:55:59 -0600
Subject: [PATCH 10/15] fix(IR-37-46): fixed class for labels into Radio
buttons component (#10975)
---
packages/ui/src/primitives/tailwind/Radio/index.tsx | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/packages/ui/src/primitives/tailwind/Radio/index.tsx b/packages/ui/src/primitives/tailwind/Radio/index.tsx
index 4455038ba9..f4da3d2e74 100644
--- a/packages/ui/src/primitives/tailwind/Radio/index.tsx
+++ b/packages/ui/src/primitives/tailwind/Radio/index.tsx
@@ -6,8 +6,8 @@ Version 1.0. (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE.
The License is based on the Mozilla Public License Version 1.1, but Sections 14
-and 15 have been added to cover use of software over a computer network and
-provide for limited attribution for the Original Developer. In addition,
+and 15 have been added to cover use of software over a computer network and
+provide for limited attribution for the Original Developer. In addition,
Exhibit A has been modified to be consistent with Exhibit B.
Software distributed under the License is distributed on an "AS IS" basis,
@@ -19,7 +19,7 @@ The Original Code is Ethereal Engine.
The Original Developer is the Initial Developer. The Initial Developer of the
Original Code is the Ethereal Engine team.
-All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023
+All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023
Ethereal Engine. All Rights Reserved.
*/
@@ -32,6 +32,7 @@ export const RadioRoot = ({
onChange,
selected,
className,
+ labelClassName,
disabled,
description
}: {
@@ -40,6 +41,7 @@ export const RadioRoot = ({
onChange: React.ChangeEventHandler
selected: boolean
className?: string
+ labelClassName?: string
disabled?: boolean
description?: string
}) => {
@@ -49,7 +51,7 @@ export const RadioRoot = ({