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

Makes the resource manager build as the other projects #3799

Merged
merged 9 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions DNN Platform/Modules/ResourceManager/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/yarn-error.log
**/scripts/*-bundle.*
10 changes: 0 additions & 10 deletions DNN Platform/Modules/ResourceManager/Module.build
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\packages\Yarn.MSBuild.1.16.0\build\Yarn.MSBuild.props" Condition="Exists('..\..\..\packages\Yarn.MSBuild.1.16.0\build\Yarn.MSBuild.props')" />
<Import Project="..\..\..\packages\Yarn.MSBuild.1.16.0\build\Yarn.MSBuild.targets" Condition="Exists('..\..\..\packages\Yarn.MSBuild.1.16.0\build\Yarn.MSBuild.targets')" />
<PropertyGroup>
<RootDirectory>$(MSBuildProjectDirectory)\..\..\..</RootDirectory>
<ReactDirectory>$(MSBuildProjectDirectory)\ResourceManager.Web</ReactDirectory>
Expand All @@ -22,12 +20,4 @@
<Resources Remove="web.config" />
</ItemGroup>
</Target>
<Target Name="BuildReact">
<Message Importance="high" Text="Running Yarn for $(ReactDirectory)" />
<Yarn Command="install" WorkingDirectory="$(ReactDirectory)" IgnoreExitCode="false" Condition="$(ReactDirectory.Length) > 0" />
<Yarn Command="build" WorkingDirectory="$(ReactDirectory)" IgnoreExitCode="false" Condition="$(ReactDirectory.Length) > 0" />
</Target>
<Target Name="BeforeBuild">
<CallTarget Targets="BuildReact" />
</Target>
</Project>
15 changes: 11 additions & 4 deletions DNN Platform/Modules/ResourceManager/ResourceManager.Web/.babelrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{
"presets": [
"es2015",
"react"
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"transform-object-assign",
"transform-object-rest-spread"
]
"@babel/plugin-proposal-object-rest-spread"
],
"env": {
"production": {
"plugins": [
"transform-react-remove-prop-types"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./node_modules/**/*
**/dnn-react-common.min.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module.exports = {
"plugins": [
"react",
"spellcheck"
"react"
],
"env": {
"browser": true,
Expand All @@ -10,44 +9,34 @@ module.exports = {
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
"jsx": true
},
"ecmaVersion": 6,
"ecmaVersion": 2018,
"sourceType": "module"
},
},
"settings": {
"react":{
"version": "16"
}
},
"globals": {
"__": false,
"Promise": false,
"VERSION": false,
"process": false
"VERSION": false
},
"rules": {
"spellcheck/spell-checker": [1,
{
"comments": "true",
"strings": "true",
"identifiers": "true",
"skipWords": require("./.eslintskipwords"),
"skipIfMatch": [
"http://[^s]*",
"https://[^s]*",
"(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)" // CSS hex color
]
}
],
"rules": {
"semi": "error",
"no-var": "error",
"quotes": ["warn", "double" ],
"indent": ["warn", 4, {"SwitchCase": 1}],
"no-unused-vars": "warn",
"no-console": "warn",
"keyword-spacing": "warn",
"no-console": "warn",
"keyword-spacing": "warn",
"eqeqeq": "warn",
"space-before-function-paren": ["warn", { "anonymous": "always", "named": "never" }],
"space-before-blocks": "warn",
"no-multiple-empty-lines": "warn",
"react/jsx-equals-spacing": ["warn", "never"],
"id-match": ["error", "^([A-Za-z0-9_])+$", {"properties": true}]
}
};
};

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,21 @@ const addAssetPanelActions = {

files.forEach (
file => uploadFilePromises.push(ItemsService.uploadFile(file, folderPath, overwrite, trackProgress.bind(null, file.name))
.then(
response => fileUploadedHandler(dispatch, file, overwrite, response),
reason => dispatch (fileUploadError(file.name, reason.message))
))
.then(
response => fileUploadedHandler(dispatch, file, overwrite, response),
reason => dispatch (fileUploadError(file.name, reason.message))
))
);

Promise.all(uploadFilePromises).then(
() => ItemsService.getContent(folderId, 0, numItems, sorting)
)
.then(
getContentResponse => dispatch ({
type: folderPanelActionTypes.CONTENT_LOADED,
data: getContentResponse
})
);
.then(
getContentResponse => dispatch ({
type: folderPanelActionTypes.CONTENT_LOADED,
data: getContentResponse
})
);
};
},
trackProgress(fileName, progress) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,32 +62,32 @@ const addFolderPanelActions = {

return (dispatch) => {
ItemsService.addFolder(newFolderData)
.then(
addFolderResponse =>
ItemsService.getContent(folderId, 0, numItems, sorting)
.then(
getContentResponse => {
dispatch({
type: folderPanelActionTypes.CONTENT_LOADED,
data: getContentResponse
});
addFolderResponse =>
ItemsService.getContent(folderId, 0, numItems, sorting)
.then(
getContentResponse => {
dispatch({
type: folderPanelActionTypes.CONTENT_LOADED,
data: getContentResponse
});

dispatch({
type: actionTypes.FOLDER_CREATED,
data: addFolderResponse
});
}
),
reason => dispatch({
type: actionTypes.ADD_FOLDER_ERROR,
data: reason.data ? reason.data.message : null
})
)
.catch(
dispatch({
type: actionTypes.ADD_FOLDER_ERROR
})
);
dispatch({
type: actionTypes.FOLDER_CREATED,
data: addFolderResponse
});
}
),
reason => dispatch({
type: actionTypes.ADD_FOLDER_ERROR,
data: reason.data ? reason.data.message : null
})
)
.catch(
dispatch({
type: actionTypes.ADD_FOLDER_ERROR
})
);
};
},
setValidationErrors(validationErrors) {
Expand Down
Loading