-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial setup for loading states in trees (#882)
* Add initial setup for loading states in trees * Apply eslint-fixer changes * Automatic frontend build --------- Co-authored-by: vin0401 <[email protected]>
- Loading branch information
Showing
34 changed files
with
1,766 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
assets/js/src/core/modules/asset/tree/node/with-action-states.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - Pimcore Open Core License (POCL) | ||
* - Pimcore Commercial License (PCL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL | ||
*/ | ||
|
||
import { type TreeNodeProps } from '@Pimcore/components/element-tree/node/tree-node' | ||
import React, { type ElementType, type ReactElement } from 'react' | ||
import { useAssetPatchByIdMutation } from '../../asset-api-slice-enhanced' | ||
import { useElementDeleteMutation } from '@Pimcore/modules/element/element-api-slice.gen' | ||
|
||
export const withActionStates = (Component: ElementType<TreeNodeProps>): ElementType<TreeNodeProps> => { | ||
const ActionStates = (props: TreeNodeProps): ReactElement => { | ||
const [, { isLoading }] = useAssetPatchByIdMutation({ fixedCacheKey: `ASSET_ACTION_RENAME_ID_${props.id}` }) | ||
const [, { isLoading: isDeleteLoading }] = useElementDeleteMutation({ fixedCacheKey: `ASSET_ACTION_DELETE_ID_${props.id}` }) | ||
|
||
return ( | ||
<Component | ||
{ ...props } | ||
danger={ isDeleteLoading } | ||
isLoading={ isLoading || isDeleteLoading } | ||
/> | ||
) | ||
} | ||
|
||
return ActionStates | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
public/build/398bdaff-dc7f-46da-a861-3f949842c411/105.js.LICENSE.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*! | ||
* | ||
* /** | ||
* * Pimcore | ||
* * | ||
* * This source file is available under two different licenses: | ||
* * - Pimcore Open Core License (POCL) | ||
* * - Pimcore Commercial License (PCL) | ||
* * Full copyright and license information is available in | ||
* * LICENSE.md which is distributed with this source code. | ||
* * | ||
* * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* * @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL | ||
* * / | ||
* | ||
*/ |
16 changes: 16 additions & 0 deletions
16
public/build/398bdaff-dc7f-46da-a861-3f949842c411/core-dll.css
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
public/build/398bdaff-dc7f-46da-a861-3f949842c411/core-dll.js
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.