Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SonarCloud pipeline in 1.x branch #831

Open
wants to merge 36 commits into
base: 1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
25ec581
fixed the ButtonGroup stories
ValeriaMaltseva Dec 18, 2024
1b1dc41
update the name of stories case
ValeriaMaltseva Dec 18, 2024
edd5e76
update the StackList stories by adding keys to list items
ValeriaMaltseva Dec 18, 2024
e138f03
Automatic frontend build
ValeriaMaltseva Dec 18, 2024
7cb84f3
fixed the error in the store of Redux
ValeriaMaltseva Dec 18, 2024
3aca1f1
Automatic frontend build
ValeriaMaltseva Dec 18, 2024
8573b16
updated the Breadcrumb component
ValeriaMaltseva Dec 18, 2024
b067330
refactored the useBreadcrumbSize hook
ValeriaMaltseva Dec 18, 2024
ca4bb41
updated the webpack file
ValeriaMaltseva Dec 18, 2024
6fdfcc3
updated naming
ValeriaMaltseva Dec 18, 2024
a82e147
fixed build
ValeriaMaltseva Dec 18, 2024
b1045c4
fixed build
ValeriaMaltseva Dec 18, 2024
f8f30cb
fixed build
ValeriaMaltseva Dec 18, 2024
2445e3e
refactored the component
ValeriaMaltseva Dec 19, 2024
bc9f518
refactored the Region component
ValeriaMaltseva Dec 19, 2024
e381104
refactored the useFilters hook
ValeriaMaltseva Dec 19, 2024
7a25dd1
Automatic frontend build
ValeriaMaltseva Dec 19, 2024
5c07182
refactored the ListContainerInner component
ValeriaMaltseva Dec 19, 2024
40ac144
Automatic frontend build
ValeriaMaltseva Dec 19, 2024
9703d81
updated the GridContainer
ValeriaMaltseva Dec 19, 2024
d87c13b
updated the ComparisonView component
ValeriaMaltseva Dec 19, 2024
67ad9b2
refactored the WorkflowCard component
ValeriaMaltseva Dec 19, 2024
ad8438d
Automatic frontend build
ValeriaMaltseva Dec 19, 2024
14dfeac
refactored the Grid component
ValeriaMaltseva Dec 19, 2024
38f3cf1
added a small refactoring
ValeriaMaltseva Dec 19, 2024
5add685
Automatic frontend build
ValeriaMaltseva Dec 19, 2024
b560980
refactoring
ValeriaMaltseva Dec 19, 2024
85f1398
fixed lint
ValeriaMaltseva Dec 19, 2024
5bb6ea2
Automatic frontend build
ValeriaMaltseva Dec 19, 2024
6cc2fa0
added refactoring
ValeriaMaltseva Dec 20, 2024
5528a19
refactored the useCssComponentHash
ValeriaMaltseva Dec 20, 2024
c18f7ea
Automatic frontend build
ValeriaMaltseva Dec 20, 2024
093ab2b
refactored components
ValeriaMaltseva Dec 20, 2024
32a12bf
updated the component
ValeriaMaltseva Dec 20, 2024
f370a82
fixed the type
ValeriaMaltseva Dec 20, 2024
dd69010
Automatic frontend build
ValeriaMaltseva Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions assets/js/src/core/app/plugin-system/plugin-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ import { container } from '@Pimcore/app/depency-injection'
import { type Container } from 'inversify'
import { moduleSystem } from '../module-system/module-system'

export interface lifeCycleEvents {
export interface ILifeCycleEvents {
onInit?: (config: { container: Container }) => void
onStartup?: (config: { moduleSystem: typeof moduleSystem }) => void
}

export interface abstractPlugin extends lifeCycleEvents {
export interface IAbstractPlugin extends ILifeCycleEvents {
name: string
}

export class PluginSystem {
private registry: Record<string, abstractPlugin> = {}
private registry: Record<string, IAbstractPlugin> = {}

async loadPlugins (): Promise<void> {
const promises: any[] = []
Expand All @@ -48,7 +48,7 @@ export class PluginSystem {
await Promise.allSettled(promises)
}

registerPlugin (plugin: abstractPlugin): void {
registerPlugin (plugin: IAbstractPlugin): void {
this.registry[plugin.name] = plugin
}

Expand Down
12 changes: 8 additions & 4 deletions assets/js/src/core/app/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ const slices: AnySliceLike[] = [
pimcoreApi
]

export let rootReducer = combineSlices({}, ...slices).withLazyLoadedSlices<LazyloadedSlices>()
const createRootReducer = (): CombinedSliceReducer<Record<string, any>, Record<string, any>> => {
return combineSlices({}, ...slices).withLazyLoadedSlices<LazyloadedSlices>()
}

export const rootReducer = createRootReducer()

export const store = configureStore({
reducer: rootReducer,
Expand All @@ -47,10 +51,10 @@ export const store = configureStore({
export const injectSliceWithState = (newSlice: AnySliceLike): CombinedSliceReducer<Record<string, any>, Record<string, any>> => {
slices.push(newSlice)

rootReducer = combineSlices({}, ...slices).withLazyLoadedSlices<LazyloadedSlices>()
store.replaceReducer(rootReducer)
const updatedRootReducer = createRootReducer()
store.replaceReducer(updatedRootReducer)

return rootReducer
return updatedRootReducer
}

export type AppStore = typeof store
Expand Down
4 changes: 2 additions & 2 deletions assets/js/src/core/components/alert/alert.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ export const Success = {
}
}

export const Error = {
export const WithError = {
args: {
..._default.args,
type: 'error'
}
}

export const Warning = {
export const WithWarning = {
args: {
..._default.args,
type: 'warning'
Expand Down
44 changes: 22 additions & 22 deletions assets/js/src/core/components/breadcrumb/breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,30 @@ export const Breadcrumb = ({ path, elementType, editorTabsWidth, pageSize }: Bre

let items: NonNullable<AntBreadcrumbProps['items']> = []

// Handle click event for intermediate parts of breadcrumb
const handleMenuItemClick = (path: string): void => {
const elementIdFetcher = dispatch(elementApi.endpoints.elementGetIdByPath.initiate({
elementType,
elementPath: path
}))

elementIdFetcher
.then(({ data }) => {
if (data !== undefined) {
openElement({
id: data.id,
type: elementType
}).catch(() => {})
}
})
.catch(() => {})
}

function getBreadcrumbItems (path: string): AntBreadcrumbProps['items'] {
// Split to check if it has more that just a single key
const partList = path.split('/')
const partListAmount = partList.length

// Handle click event for intermediate parts
const onMenuItemClick = (path: string): void => {
const elementIdFetcher = dispatch(elementApi.endpoints.elementGetIdByPath.initiate({
elementType,
elementPath: path
}))

elementIdFetcher
.then(({ data }) => {
if (data !== undefined) {
openElement({
id: data.id,
type: elementType
}).catch(() => {})
}
})
.catch(() => {})
}

// Generate the breadcrumb text with ellipsis
const generateBreadcrumbText = ({ content, style, className, hasFilename = false }: { content: string, style?: CSSProperties, className?: string, hasFilename?: boolean }): ReactElement => {
if (hasFilename) {
Expand Down Expand Up @@ -116,7 +116,7 @@ export const Breadcrumb = ({ path, elementType, editorTabsWidth, pageSize }: Bre
title: generateBreadcrumbText({ content: partList[partListAmount - 2], style: { maxWidth: '100px' } }),
className: styles.pathItem,
onClick: () => {
onMenuItemClick(partList.slice(0, partListAmount - 1).join('/'))
handleMenuItemClick(partList.slice(0, partListAmount - 1).join('/'))
}
})

Expand All @@ -128,7 +128,7 @@ export const Breadcrumb = ({ path, elementType, editorTabsWidth, pageSize }: Bre
partList[i]
),
onClick: () => {
onMenuItemClick(partList.slice(0, i + 1).join('/'))
handleMenuItemClick(partList.slice(0, i + 1).join('/'))
}
})
}
Expand All @@ -146,7 +146,7 @@ export const Breadcrumb = ({ path, elementType, editorTabsWidth, pageSize }: Bre
partList[i]
),
onClick: () => {
onMenuItemClick(partList.slice(0, i + 1).join('/'))
handleMenuItemClick(partList.slice(0, i + 1).join('/'))
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,60 +23,28 @@ export const useBreadcrumbSize = (editorTabsWidth?: number, initialBreadcrumbLas
useLayoutEffect(() => {
if (editorTabsWidth == null || initialBreadcrumbLastElementWidth == null) return

if (editorTabsWidth <= 375) {
setIsHideBreadcrumb(true)
setCurrentBreadcrumbWidth(50)
}

if (editorTabsWidth > 375 && editorTabsWidth <= 450) {
setIsHideBreadcrumb(true)
setCurrentBreadcrumbWidth(70)
}

if (editorTabsWidth > 450 && editorTabsWidth <= 550) {
setIsHideBreadcrumb(true)
setCurrentBreadcrumbWidth(85)
}

if (editorTabsWidth > 550 && editorTabsWidth <= 700) {
setIsHideBreadcrumb(true)
setCurrentBreadcrumbWidth(100)
}

if (editorTabsWidth > 700 && editorTabsWidth <= 800) {
setIsHideBreadcrumb(true)
setCurrentBreadcrumbWidth(150)
}

if (editorTabsWidth > 800 && editorTabsWidth <= 900) {
setIsHideBreadcrumb(true)
setCurrentBreadcrumbWidth(200)
}

if (editorTabsWidth > 900 && editorTabsWidth <= 1000) {
setIsHideBreadcrumb(true)
setCurrentBreadcrumbWidth(300)
}

if (editorTabsWidth > 1000 && editorTabsWidth <= 1100) {
setIsHideBreadcrumb(true)
setCurrentBreadcrumbWidth(400)
}

if (editorTabsWidth > 1100 && editorTabsWidth <= 1200) {
setIsHideBreadcrumb(true)
setCurrentBreadcrumbWidth(500)
}

if (editorTabsWidth > 1200 && editorTabsWidth <= 1300) {
setIsHideBreadcrumb(true)
setCurrentBreadcrumbWidth(600)
}

if (editorTabsWidth > 1300) {
setIsHideBreadcrumb(false)
setCurrentBreadcrumbWidth(initialBreadcrumbLastElementWidth)
}
const getBreadcrumbSettings = (width: number): { isHide: boolean, width: number } => {
if (width <= 375) return { isHide: true, width: 50 }
if (width <= 450) return { isHide: true, width: 70 }
if (width <= 550) return { isHide: true, width: 85 }
if (width <= 700) return { isHide: true, width: 100 }
if (width <= 800) return { isHide: true, width: 150 }
if (width <= 900) return { isHide: true, width: 200 }
if (width <= 1000) return { isHide: true, width: 300 }
if (width <= 1100) return { isHide: true, width: 400 }
if (width <= 1200) return { isHide: true, width: 500 }
if (width <= 1300) return { isHide: true, width: 600 }

return {
isHide: false,
width: initialBreadcrumbLastElementWidth
}
}

const { isHide, width } = getBreadcrumbSettings(editorTabsWidth)

setIsHideBreadcrumb(isHide)
setCurrentBreadcrumbWidth(width)
}, [editorTabsWidth, initialBreadcrumbLastElementWidth])

return { isHideBreadcrumb, currentBreadcrumbWidth }
Expand Down
Loading