Skip to content

Commit

Permalink
Replace browser native crypto.randomUUID() with alternative implement…
Browse files Browse the repository at this point in the history
…ation (#777)
  • Loading branch information
markus-moser authored Dec 2, 2024
1 parent 06454c3 commit d9f0eec
Show file tree
Hide file tree
Showing 33 changed files with 1,897 additions and 1,893 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { verifyUpdate } from '@Pimcore/modules/element/editor/shared-tab-manager
import { type CustomMetadata } from '@Pimcore/modules/asset/draft/hooks/use-custom-metadata'
import { Box } from '@Pimcore/components/box/box'
import { Flex } from '@Pimcore/components/flex/flex'
import { uuid } from '@Pimcore/utils/uuid'

interface CustomMetadataWithActions extends CustomMetadata {
actions: React.ReactNode
Expand All @@ -45,7 +46,7 @@ export const CustomMetadataTable = ({ showDuplicateEntryModal, showMandatoryModa
return data.map((item) => {
return {
...item,
rowId: crypto.randomUUID()
rowId: uuid()
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { type CustomMetadata } from '@Pimcore/modules/asset/draft/hooks/use-cust
import { Space } from '@Pimcore/components/space/space'
import { Select } from '@Pimcore/components/select/select'
import { type DynamicTypeMetaDataRegistry } from '@Pimcore/modules/element/dynamic-types/defintinitions/meta-data/dynamic-type-metadata-registry'
import { uuid } from '@Pimcore/utils/uuid'

export const CustomMetadataTabContainer = (): React.JSX.Element => {
const { t } = useTranslation()
Expand Down Expand Up @@ -100,7 +101,7 @@ export const CustomMetadataTabContainer = (): React.JSX.Element => {
type: typeSelectValue.current,
language: languageSelectValue.current,
data: null,
rowId: crypto.randomUUID()
rowId: uuid()
}

addCustomMetadata(newCustomMetadata)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { type DataProperty } from '@Pimcore/modules/element/draft/hooks/use-prop
import { useElementContext } from '@Pimcore/modules/element/hooks/use-element-context'
import { Text } from '@Pimcore/components/text/text'
import { Box } from '@Pimcore/components/box/box'
import { uuid } from '@Pimcore/utils/uuid'

interface ITableProps {
propertiesTableTab: string
Expand Down Expand Up @@ -65,7 +66,7 @@ export const Table = ({
return data.map((item) => {
return {
...item,
rowId: crypto.randomUUID()
rowId: uuid()
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { Segmented } from '@Pimcore/components/segmented/segmented'
import { Space } from '@Pimcore/components/space/space'
import { Split } from '@Pimcore/components/split/split'
import { Select } from '@Pimcore/components/select/select'
import { uuid } from '@Pimcore/utils/uuid'

export const PropertiesContainer = (): React.JSX.Element => {
const { t } = useTranslation()
Expand Down Expand Up @@ -210,7 +211,7 @@ export const PropertiesContainer = (): React.JSX.Element => {
config: property.config,
description: property.description,
predefinedName: property.name,
rowId: crypto.randomUUID()
rowId: uuid()
}

addProperty(newDataProperty)
Expand Down Expand Up @@ -245,7 +246,7 @@ export const PropertiesContainer = (): React.JSX.Element => {
data: null,
inherited: false,
inheritable: false,
rowId: crypto.randomUUID()
rowId: uuid()
}

addProperty(newDataProperty)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entrypoints": {
"main": {
"js": [
"/bundles/pimcorestudioui/build/47b4536f-d226-4dbb-8150-5233d60922bc/main.js"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"bundles/pimcorestudioui/build/47b4536f-d226-4dbb-8150-5233d60922bc/main.js": "/bundles/pimcorestudioui/build/47b4536f-d226-4dbb-8150-5233d60922bc/main.js"
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions public/build/7b4eea79-036f-4a5a-acbf-d5a06e6fefac/entrypoints.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entrypoints": {
"vendor": {
"js": [
"/bundles/pimcorestudioui/build/83e39c9f-3b6d-4e76-b4b8-cc0a07e7809b/vendor.js"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"bundles/pimcorestudioui/build/83e39c9f-3b6d-4e76-b4b8-cc0a07e7809b/vendor.js": "/bundles/pimcorestudioui/build/83e39c9f-3b6d-4e76-b4b8-cc0a07e7809b/vendor.js"
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions public/build/a2f43857-2988-4fde-aa15-0d9d6888896f/entrypoints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"entrypoints": {
"core-dll": {
"css": [
"/bundles/pimcorestudioui/build/a2f43857-2988-4fde-aa15-0d9d6888896f/core-dll.css"
],
"js": [
"/bundles/pimcorestudioui/build/a2f43857-2988-4fde-aa15-0d9d6888896f/core-dll.js"
]
}
}
}
Loading

0 comments on commit d9f0eec

Please sign in to comment.