Skip to content

Commit

Permalink
TASK: refactor asset replace dialog and asset upload screen
Browse files Browse the repository at this point in the history
  • Loading branch information
andrehoffmann30 committed Feb 10, 2023
1 parent a29faec commit 277cc45
Show file tree
Hide file tree
Showing 26 changed files with 255 additions and 977 deletions.
2 changes: 0 additions & 2 deletions Configuration/Settings.Neos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ Neos:
javascript:
Flowpack.Media.Ui:AssetEditor:
resource: resource://Flowpack.Media.Ui/Public/AssetEditor/Plugin.js
Flowpack.Media.Ui:ImageUpload:
resource: resource://Flowpack.Media.Ui/Public/AssetUpload/Plugin.js
stylesheets:
Flowpack.Media.Ui:AssetEditor:
resource: resource://Flowpack.Media.Ui/Public/AssetEditor/Plugin.css
Expand Down
1 change: 1 addition & 0 deletions Resources/Private/JavaScript/asset-upload-screen/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src';
17 changes: 8 additions & 9 deletions Resources/Private/JavaScript/asset-upload-screen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@
"engines": {
"node": ">=12"
},
"scripts": {
"build": "NODE_ENV=production neos-react-scripts build",
"watch": "neos-react-scripts watch"
},
"dependencies": {
"@apollo/client": "^3.3.13",
"@media-ui/core": "*",
"@media-ui/feature-asset-upload": "*",
"@media-ui/media-module": "*",
"@neos-project/neos-ui-extensibility": "^5.3.4"
"apollo-upload-client": "^14.1.3",
"plow-js": "^2.2.0",
"react-redux": "^5.1.2",
"react": "^17.0.1",
"recoil": "^0.2.0"
},
"devDependencies": {
"webpack": "^4.44.2",
"webpack-graphql-loader": "^1.0.2"
},
"browserslist": [
"defaults and > 1% and not ie <= 11"
],
"neos": {
"buildTargetDirectory": "../../../Public/AssetUpload"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ interface AssetUploadScreenState {
i18nRegistry: globalRegistry.get('i18n'),
frontendConfiguration: globalRegistry.get('frontendConfiguration').get('Flowpack.Media.Ui'),
}))
export default class AssetUploadScreen extends React.PureComponent<AssetUploadScreenProps, AssetUploadScreenState> {
export class AssetUploadScreen extends React.PureComponent<AssetUploadScreenProps, AssetUploadScreenState> {
constructor(props) {
super(props);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { AssetUploadScreen } from './AssetUploadScreen';
15 changes: 0 additions & 15 deletions Resources/Private/JavaScript/asset-upload-screen/src/manifest.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,20 @@ const ReplaceAssetDialog: React.FC = () => {
});

if (hasApprovalToReplaceAsset) {
try {
const result = await replaceAsset({ asset: selectedAsset, file, options: replacementOptions });

Notify.ok(translate('uploadDialog.replacementFinished', 'Replacement finished'));
closeDialog();
void refetchAssets();
if (result?.data.replaceAsset.success) {
setLabel(file.title);
setCaption(file.caption);
setCopyrightNotice(file.copyrightNotice);
}
} catch (error) {
Notify.error(translate('assetReplacement.error', 'Replacement failed'), error);
}
replaceAsset({ asset: selectedAsset, file, options: replacementOptions })
.then((result) => {
if (result?.data.replaceAsset.success) {
setLabel(file.title);
setCaption(file.caption);
setCopyrightNotice(file.copyrightNotice);
}
Notify.ok(translate('uploadDialog.replacementFinished', 'Replacement finished'));
closeDialog();
refetchAssets();
})
.catch((error) => {
Notify.error(translate('assetReplacement.error', 'Replacement failed'), error);
});
}
}, [
replaceAsset,
Expand Down
1 change: 0 additions & 1 deletion Resources/Private/JavaScript/media-upload-screen/Readme.md

This file was deleted.

28 changes: 0 additions & 28 deletions Resources/Private/JavaScript/media-upload-screen/package.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 277cc45

Please sign in to comment.