diff --git a/DNN Platform/Modules/ResourceManager/.gitignore b/DNN Platform/Modules/ResourceManager/.gitignore new file mode 100644 index 00000000000..1374d0c3fea --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/.gitignore @@ -0,0 +1 @@ +/Scripts \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/App_LocalResources/ResourceManager.resx b/DNN Platform/Modules/ResourceManager/App_LocalResources/ResourceManager.resx index 1c35ffd4857..1cb26e65040 100644 --- a/DNN Platform/Modules/ResourceManager/App_LocalResources/ResourceManager.resx +++ b/DNN Platform/Modules/ResourceManager/App_LocalResources/ResourceManager.resx @@ -1,321 +1,426 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Add Asset - - - Add Folder - - - Use the tools above to add an asset or create a folder - - - This Folder is Empty - - - Cancel - - - Close - - - Database - - - Confirm delete - - - Are you sure to delete the file? - - - Confirm delete - - - Are you sure to delete the folder? - - - The file you want to upload already exists in this folder. - - - File Uploaded. - - - File upload stopped - - - Enter folder name - - - The folder name is required - - - Folder Parent - - - The folder type is required - - - Name - - - Save - - - Secure - - - Standard - - - Type - - - The user does not have permission to delete folder. - - - The user does not have permission to download this file. - - - Drag and Drop a File or Select an Option - - - Your Search Produced No Results - - - Search Files - - - Search - - - Url copied to clipboard - - - Created - - - Description - - - Last Modified - - - Size - - - Title - - - URL - - - Name is required - - - User has no permission to read file properties. - - - An error has ocurred. - - - Item saved. - - - Folder Type - - - Created on Date - - - Item Name - - - Last Modified on Date - - - is too big. The maximun file size allowed is - - - The user does not have permission to delete file. - - - User has no permission to manage file properties. - - - The user does not have permission to manage this folder. - - - No Folder Selected - - - Search Folder - - - Disabled for anonymous users. - - - The user does not have permission to add new folders. - - - The Group Icon file can't be deleted. - - - is not of a type that is allowed to be uploaded - - - Refresh - - - Sync This Folder - - - Sync This Folder & Subfolders - - - Manage Folder Types - - - Add Folder Type - - - Folder Provider - - - Folder Type Definitions - - - Edit Folder Type - - - Remove Folder Type - - - Are you sure you want to remove this folder type? - - - Remove Folder Type - - - Move Item - - - New Location - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add Asset + + + Add Folder + + + Use the tools above to add an asset or create a folder + + + This Folder is Empty + + + Cancel + + + Close + + + Database + + + The file you want to upload already exists in this folder. + + + File Uploaded. + + + File upload stopped + + + Enter folder name + + + The folder name is required + + + Folder Parent + + + The folder type is required + + + Name + + + Save + + + Secure + + + Standard + + + Type + + + The user does not have permission to delete folder. + + + The user does not have permission to download this file. + + + Drag and Drop a File or Select an Option + + + Your Search Produced No Results + + + Search Files + + + Search + + + Url copied to clipboard + + + Created + + + Description + + + Last Modified + + + Size + + + Title + + + URL + + + Name is required + + + User has no permission to read file properties. + + + An error has ocurred. + + + Item saved. + + + Folder Type + + + Created on Date + + + Item Name + + + Last Modified on Date + + + is too big. The maximun file size allowed is + + + The user does not have permission to delete file. + + + User has no permission to manage file properties. + + + The user does not have permission to manage this folder. + + + No Folder Selected + + + Search Folder + + + Disabled for anonymous users. + + + The user does not have permission to add new folders. + + + The Group Icon file can't be deleted. + + + is not of a type that is allowed to be uploaded + + + Refresh + + + Sync + + + Sync This Folder + + + Sync This Folder & Subfolders + + + Manage Folder Types + + + Add Folder Type + + + Folder Provider + + + Folder Type Definitions + + + Edit Folder Type + + + Remove Folder Type + + + Are you sure you want to remove this folder type? + + + Remove Folder Type + + + Move Item(s) + + + New Location + + + Name + + + Last Modified + + + Size + + + Parent Folder + + + Date Created + + + Sort + + + Items + + + Mapped Path + + + Edit + + + Role Permissions + + + User Permissions + + + Folder ID + + + General + + + Permissions + + + File ID + + + Are you sure you want to delete the selected items? + + + Are you sure you want to move the selected items? + + + Are you sure you want to unlink the following folders? + + + Delete + + + Delete Items + + + Deleting Items + + + Files + + + Folders + + + Move + + + Moving Items + + + No + + + Select the destination folder. + + + Unlink + + + Unlink Folder(s) + + + Unlinking Folders + + + Yes + + + Copy URL + + + Showing {0} of {1} items + + + Download + + + Upload + + + Extract uploaded ZIP files + + + Overwrite + + + Edit Folder Mappings + \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/Components/ItemsManager.cs b/DNN Platform/Modules/ResourceManager/Components/ItemsManager.cs index 495703a4ef2..f116cdd1ac7 100644 --- a/DNN Platform/Modules/ResourceManager/Components/ItemsManager.cs +++ b/DNN Platform/Modules/ResourceManager/Components/ItemsManager.cs @@ -133,7 +133,7 @@ public void SaveFileDetails(IFileInfo file, FileDetailsRequest fileDetails) public void SaveFolderDetails(IFolderInfo folder, FolderDetailsRequest folderDetails) { this.assetManager.RenameFolder(folderDetails.FolderId, folderDetails.FolderName); - folder.FolderPermissions.Clear(); + folder.FolderPermissions.Clear(); folder.FolderPermissions.AddRange(folderDetails.Permissions.RolePermissions.ToPermissionInfos(folderDetails.FolderId)); folder.FolderPermissions.AddRange(folderDetails.Permissions.UserPermissions.ToPermissionInfos(folderDetails.FolderId)); FolderManager.Instance.UpdateFolder(folder); diff --git a/DNN Platform/Modules/ResourceManager/Components/PermissionHelper.cs b/DNN Platform/Modules/ResourceManager/Components/PermissionHelper.cs index 805a45e126b..cb9335c4d9e 100644 --- a/DNN Platform/Modules/ResourceManager/Components/PermissionHelper.cs +++ b/DNN Platform/Modules/ResourceManager/Components/PermissionHelper.cs @@ -229,7 +229,7 @@ public static ArrayList ToPermissionInfos(this IList permissions AllowAccess = p.AllowAccess, FolderID = folderId, PermissionID = p.PermissionId, - RoleID = Null.NullInteger, + RoleID = int.Parse(Globals.glbRoleNothing), UserID = permission.UserId, }); } diff --git a/DNN Platform/Modules/ResourceManager/Components/PersonaBarMenuController.cs b/DNN Platform/Modules/ResourceManager/Components/PersonaBarMenuController.cs new file mode 100644 index 00000000000..8113435ec08 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/Components/PersonaBarMenuController.cs @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information + +namespace Dnn.Modules.ResourceManager.Components +{ + using System.Collections.Generic; + using System.Linq; + + using Dnn.PersonaBar.Library.Controllers; + using Dnn.PersonaBar.Library.Model; + using DotNetNuke.Entities.Portals; + using DotNetNuke.Entities.Users; + + /// + /// Manages the behaviour of the Resource Manager persona bar menu item. + /// + public class PersonaBarMenuController : IMenuItemController + { + /// + public IDictionary GetSettings(MenuItem menuItem) + { + return null; + } + + /// + public void UpdateParameters(MenuItem menuItem) + { + } + + /// + public bool Visible(MenuItem menuItem) + { + var user = UserController.Instance.GetCurrentUserInfo(); + return user.Roles.Contains(PortalSettings.Current.AdministratorRoleName) || user.IsSuperUser; + } + } +} diff --git a/DNN Platform/Modules/ResourceManager/Dnn.Modules.ResourceManager.csproj b/DNN Platform/Modules/ResourceManager/Dnn.Modules.ResourceManager.csproj index 3b0ab07ee20..a2f6e9a9872 100644 --- a/DNN Platform/Modules/ResourceManager/Dnn.Modules.ResourceManager.csproj +++ b/DNN Platform/Modules/ResourceManager/Dnn.Modules.ResourceManager.csproj @@ -107,6 +107,7 @@ + @@ -133,6 +134,7 @@ + @@ -147,13 +149,6 @@ Settings.ascx - - View.ascx - ASPXCodeBehind - - - View.ascx - stylecop.json @@ -196,9 +191,7 @@ - - @@ -217,6 +210,10 @@ + + {8b50ba8b-0a08-41b8-81b8-ea70707c7379} + Dnn.PersonaBar.Library + {6928A9B1-F88A-4581-A132-D3EB38669BB0} DotNetNuke.Abstractions @@ -257,6 +254,7 @@ + web.config @@ -269,6 +267,9 @@ + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-azure-folder.png b/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-azure-folder.png deleted file mode 100644 index bb623f5b979..00000000000 Binary files a/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-azure-folder.png and /dev/null differ diff --git a/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-azure-folder.svg b/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-azure-folder.svg new file mode 100644 index 00000000000..192add01da5 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-azure-folder.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-database-folder.png b/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-database-folder.png deleted file mode 100644 index cd409e1a308..00000000000 Binary files a/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-database-folder.png and /dev/null differ diff --git a/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-database-folder.svg b/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-database-folder.svg new file mode 100644 index 00000000000..8aebcab225e --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-database-folder.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-secure-folder.png b/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-secure-folder.png deleted file mode 100644 index 1d0c0e7a85d..00000000000 Binary files a/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-secure-folder.png and /dev/null differ diff --git a/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-secure-folder.svg b/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-secure-folder.svg new file mode 100644 index 00000000000..4adefda9037 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-secure-folder.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-standard-folder.png b/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-standard-folder.png deleted file mode 100644 index 45a92f639d4..00000000000 Binary files a/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-standard-folder.png and /dev/null differ diff --git a/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-standard-folder.svg b/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-standard-folder.svg new file mode 100644 index 00000000000..1366ecd8623 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/Images/icon-asset-manager-standard-folder.svg @@ -0,0 +1,3 @@ + + + diff --git a/DNN Platform/Modules/ResourceManager/Module.build b/DNN Platform/Modules/ResourceManager/Module.build index c98adaa0095..614fcd05bc0 100644 --- a/DNN Platform/Modules/ResourceManager/Module.build +++ b/DNN Platform/Modules/ResourceManager/Module.build @@ -1,23 +1,36 @@ - - - - $(MSBuildProjectDirectory)\..\..\.. - $(MSBuildProjectDirectory)\ResourceManager.Web - - - - zip - ResourceManager - DNNCE_ResourceManager - $(WebsitePath)\DesktopModules\ResourceManager - $(WebsiteInstallPath)\Module - - - - - - - - + + + + $(MSBuildProjectDirectory)\..\..\.. + $(MSBuildProjectDirectory)\ResourceManager.Web + + + + zip + ResourceManager + DNNCE_ResourceManager + $(WebsitePath)\DesktopModules\ResourceManager + $(WebsiteInstallPath)\Module + + + + + + + + + $(MSBuildProjectDirectory)\Scripts\dnn-resource-manager + + + + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.babelrc b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.babelrc deleted file mode 100644 index 59a01ef24ee..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.babelrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "presets": [ - "@babel/preset-env", - "@babel/preset-react" - ], - "plugins": [ - "transform-object-assign", - "@babel/plugin-proposal-object-rest-spread", - "@babel/plugin-proposal-class-properties" - ], - "env": { - "production": { - "plugins": [ - "transform-react-remove-prop-types" - ] - } - } -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.editorconfig b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.editorconfig new file mode 100644 index 00000000000..f1cc3ad329c --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.editorconfig @@ -0,0 +1,15 @@ +# http://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.eslintignore b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.eslintignore deleted file mode 100644 index ca83d8f7145..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -./node_modules/**/* -**/dnn-react-common.min.js \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.eslintrc.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.eslintrc.js deleted file mode 100644 index de205a18d94..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.eslintrc.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = { - "plugins": [ - "react" - ], - "env": { - "browser": true, - "commonjs": true - }, - "extends": ["eslint:recommended", "plugin:react/recommended"], - "parser": "babel-eslint", - "parserOptions": { - "ecmaFeatures": { - "jsx": true - }, - "ecmaVersion": 2018, - "sourceType": "module" - }, - "settings": { - "react":{ - "version": "16" - } - }, - "globals": { - "__": false, - "Promise": false, - "VERSION": false - }, - "rules": { - "semi": "error", - "no-var": "error", - "quotes": ["warn", "double" ], - "indent": ["warn", 4, {"SwitchCase": 1}], - "no-unused-vars": "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}] - } -}; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.gitignore b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.gitignore new file mode 100644 index 00000000000..c3ea58a61b7 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/.gitignore @@ -0,0 +1,26 @@ +dist/ +www/ +loader/ + +*~ +*.sw[mnpcod] +*.log +*.lock +*.tmp +*.tmp.* +log.txt +*.sublime-project +*.sublime-workspace + +.stencil/ +.idea/ +.vscode/ +.sass-cache/ +.versions/ +node_modules/ +$RECYCLE.BIN/ + +.DS_Store +Thumbs.db +UserInterfaceState.xcuserstate +.env diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/addAssetPanelActionsTypes.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/addAssetPanelActionsTypes.js deleted file mode 100644 index 1a21d251e45..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/addAssetPanelActionsTypes.js +++ /dev/null @@ -1,12 +0,0 @@ -const addAssetPanelActionsTypes = { - SHOW_ADD_ASSET_PANEL: "SHOW_ADD_ASSET_PANEL", - HIDE_ADD_ASSET_PANEL: "HIDE_ADD_ASSET_PANEL", - UPDATE_PROGRESS: "UPDATE_PROGRESS", - RESET_PANEL: "RESET_PANEL", - ASSET_ADDED: "ASSET_ADDED", - ASSET_ADDED_ERROR: "ASSET_ADDED_ERROR", - FILE_ALREADY_EXIST: "FILE_ALREADY_EXIST", - STOP_UPLOAD: "STOP_UPLOAD" -}; - -export default addAssetPanelActionsTypes; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/addFolderPanelActionsTypes.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/addFolderPanelActionsTypes.js deleted file mode 100644 index d5b87983b90..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/addFolderPanelActionsTypes.js +++ /dev/null @@ -1,13 +0,0 @@ -const addFolderPanelActionsTypes = { - SHOW_ADD_FOLDER_PANEL: "SHOW_ADD_FOLDER_PANEL", - HIDE_ADD_FOLDER_PANEL: "HIDE_ADD_FOLDER_PANEL", - FOLDER_MAPPINGS_LOADED: "FOLDER_MAPPINGS_LOADED", - LOAD_FOLDER_MAPPINGS_ERROR: "LOAD_FOLDER_MAPPINGS_ERROR", - CHANGE_NAME: "CHANGE_NAME", - CHANGE_FOLDER_TYPE: "CHANGE_FOLDER_TYPE", - FOLDER_CREATED: "FOLDER_CREATED", - ADD_FOLDER_ERROR: "ADD_FOLDER_ERROR", - SET_VALIDATION_ERRORS: "SET_VALIDATION_ERRORS" -}; - -export default addFolderPanelActionsTypes; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/dialogModalActionsTypes.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/dialogModalActionsTypes.js deleted file mode 100644 index b509d6dfb98..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/dialogModalActionsTypes.js +++ /dev/null @@ -1,6 +0,0 @@ -const dialogModalActionsTypes = { - OPEN_DIALOG_MODAL: "OPEN_DIALOG_MODAL", - CLOSE_DIALOG_MODAL: "CLOSE_DIALOG_MODAL" -}; - -export default dialogModalActionsTypes; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/folderPanelActionsTypes.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/folderPanelActionsTypes.js deleted file mode 100644 index 8d932a7f6e8..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/folderPanelActionsTypes.js +++ /dev/null @@ -1,19 +0,0 @@ -const folderPanelActionsTypes = { - SET_LOADING: "SET_LOADING", - CONTENT_LOADED: "CONTENT_LOADED", - MORE_CONTENT_LOADED: "MORE_CONTENT_LOADED", - LOAD_CONTENT_ERROR: "LOAD_CONTENT_ERROR", - FILE_DOWNLOADED: "FILE_DOWNLOADED", - FOLDER_DELETED: "FOLDER_DELETED", - DELETE_FOLDER_ERROR: "DELETE_FOLDER_ERROR", - CLOSE_TOP_PANELS: "CLOSE_TOP_PANELS", - FILE_DELETED: "FILE_DELETED", - DELETE_FILE_ERROR: "DELETE_FILE_ERROR", - CHANGE_SEARCH: "CHANGE_SEARCH", - FILES_SEARCHED: "FILES_SEARCHED", - SEARCH_FILES_ERROR: "SEARCH_FILES_ERROR", - URL_COPIED_TO_CLIPBOARD: "URL_COPIED_TO_CLIPBOARD", - CHANGE_SORTING: "CHANGE_SORTING" -}; - -export default folderPanelActionsTypes; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/globalActionsTypes.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/globalActionsTypes.js deleted file mode 100644 index dd8f4eada35..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/globalActionsTypes.js +++ /dev/null @@ -1,5 +0,0 @@ -const globalActionsTypes = { - MODULE_PARAMETERS_LOADED: "MODULE_PARAMETERS_LOADED" -}; - -export default globalActionsTypes; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/infiniteScrollActionsTypes.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/infiniteScrollActionsTypes.js deleted file mode 100644 index 9de0b6c683b..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/infiniteScrollActionsTypes.js +++ /dev/null @@ -1,5 +0,0 @@ -const infiniteScrollActionsTypes = { - SET_MAX_SCROLL_TOP: "SET_MAX_SCROLL_TOP" -}; - -export default infiniteScrollActionsTypes; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/itemDetailsActionsTypes.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/itemDetailsActionsTypes.js deleted file mode 100644 index d1cd5d9e8f2..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/itemDetailsActionsTypes.js +++ /dev/null @@ -1,18 +0,0 @@ -const itemDetailsActionsTypes = { - EDIT_ITEM: "EDIT_ITEM", - EDIT_ITEM_ERROR: "EDIT_ITEM_ERROR", - CANCEL_EDIT_ITEM: "CANCEL_EDIT_ITEM", - CHANGE_NAME: "CHANGE_NAME", - CHANGE_TITLE: "CHANGE_TITLE", - CHANGE_DESCRIPTION: "CHANGE_DESCRIPTION", - CHANGE_PERMISSIONS: "CHANGE_PERMISSIONS", - SET_VALIDATION_ERRORS: "SET_VALIDATION_ERRORS", - ITEM_SAVED: "ITEM_SAVED", - SAVE_ITEM_ERROR: "SAVE_ITEM_ERROR", - MOVE_ITEM: "MOVE_ITEM", - MOVE_ITEM_ERROR: "MOVE_ITEM_ERROR", - CANCEL_MOVE_ITEM: "CANCEL_MOVE_ITEM", - ITEM_MOVED: "ITEM_MOVED", -}; - -export default itemDetailsActionsTypes; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/manageFolderTypesPanelActionsTypes.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/manageFolderTypesPanelActionsTypes.js deleted file mode 100644 index 4df0637de47..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/manageFolderTypesPanelActionsTypes.js +++ /dev/null @@ -1,7 +0,0 @@ -const manageFolderTypesPanelActionsTypes = { - SHOW_MANAGE_FOLDER_TYPES_PANEL: "SHOW_MANAGE_FOLDER_TYPES_PANEL", - HIDE_MANAGE_FOLDER_TYPES_PANEL: "HIDE_MANAGE_FOLDER_TYPES_PANEL", - ADD_FOLDER_TYPE_URL_LOADED: "ADD_FOLDER_TYPE_URL_LOADED", -} - -export default manageFolderTypesPanelActionsTypes; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/messageModalActionsTypes.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/messageModalActionsTypes.js deleted file mode 100644 index f2a9b23adae..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/messageModalActionsTypes.js +++ /dev/null @@ -1,5 +0,0 @@ -const messageModalActionsTypes = { - CLOSE_MESSAGE_MODAL: "CLOSE_MESSAGE_MODAL" -}; - -export default messageModalActionsTypes; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/topBarActionsTypes.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/topBarActionsTypes.js deleted file mode 100644 index e4e21064484..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/action types/topBarActionsTypes.js +++ /dev/null @@ -1,5 +0,0 @@ -const topBarActionsTypes = { - CHANGE_SEARCH_FIELD: "CHANGE_SEARCH_FIELD" -}; - -export default topBarActionsTypes; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/addAssetPanelActions.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/addAssetPanelActions.js deleted file mode 100644 index 6d709ee13ac..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/addAssetPanelActions.js +++ /dev/null @@ -1,133 +0,0 @@ -import actionTypes from "../action types/addAssetPanelActionsTypes"; -import folderPanelActionTypes from "../action types/folderPanelActionsTypes"; -import ItemsService from "../services/itemsService"; -import LocalizeService from "../services/localizeService"; - -let files = {}; - -function fileUploadedHandler(dispatch, file, overwrite, response) { - const {alreadyExists, fileName, message} = response; - - if (alreadyExists) { - files[fileName] = file; - - return dispatch ({ - type: actionTypes.FILE_ALREADY_EXIST, - data: response - }); - } - - if (!fileName || message) { - return dispatch (fileUploadError(file.name, message)); - } - - files[fileName] = undefined; - - dispatch ({ - type: actionTypes.ASSET_ADDED, - data: response - }); -} - -function fileUploadError(fileName, message) { - return { - type: actionTypes.ASSET_ADDED_ERROR, - data: { - fileName, - message - } - }; -} - -const addAssetPanelActions = { - showPanel() { - return (dispatch) => { - dispatch ({ - type: folderPanelActionTypes.CLOSE_TOP_PANELS - }); - - dispatch ({ - type: actionTypes.SHOW_ADD_ASSET_PANEL - }); - }; - }, - hidePanel() { - return (dispatch) => { - dispatch ({ - type: actionTypes.HIDE_ADD_ASSET_PANEL - }); - - dispatch ({ - type: actionTypes.RESET_PANEL - }); - }; - }, - overwriteFile(fileName, folderPath, folderPanelState, trackProgress) { - let file = files[fileName]; - return this.uploadFiles([file], folderPath, folderPanelState, trackProgress, true); - }, - uploadFiles(files, folderPath, folderPanelState, trackProgress, overwrite=false) { - const { numItems, sorting } = folderPanelState; - const folderId = folderPanelState.folder ? folderPanelState.folder.folderId : folderPanelState.homeFolderId; - - return dispatch => { - const uploadFilePromises = []; - - 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)) - )) - ); - - Promise.all(uploadFilePromises).then( - () => ItemsService.getContent(folderId, 0, numItems, sorting) - ) - .then( - getContentResponse => dispatch ({ - type: folderPanelActionTypes.CONTENT_LOADED, - data: getContentResponse - }) - ); - }; - }, - trackProgress(fileName, progress) { - return dispatch => - dispatch ({ - type: actionTypes.UPDATE_PROGRESS, - data: { - fileName, - percent: progress.percent - } - }); - }, - stopUpload(fileName) { - files[fileName] = undefined; - - return dispatch => dispatch ({ - type: actionTypes.STOP_UPLOAD, - data: fileName - }); - }, - fileSizeError(fileName, maxSize) { - const fileTooBigMessage = LocalizeService.getString("FileSizeErrorMessage"); - return dispatch => - dispatch(fileUploadError(fileName, fileName + fileTooBigMessage + maxSize)); - }, - invalidExtensionError(fileName) { - const invalidExtensionMessage = LocalizeService.getString("InvalidExtensionMessage"); - return dispatch => - dispatch(fileUploadError(fileName, fileName + invalidExtensionMessage)); - } -/*, - startUpload() { - return dispatch => - dispatch ({ - type: actionTypes.RESET_PANEL - }); - }, - */ -}; - -export default addAssetPanelActions; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/addFolderPanelActions.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/addFolderPanelActions.js deleted file mode 100644 index 0d4a035b766..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/addFolderPanelActions.js +++ /dev/null @@ -1,101 +0,0 @@ -import actionTypes from "../action types/addFolderPanelActionsTypes"; -import folderPanelActionTypes from "../action types/folderPanelActionsTypes"; -import ItemsService from "../services/itemsService"; - -const addFolderPanelActions = { - showPanel() { - return (dispatch) => { - dispatch ({ - type: folderPanelActionTypes.CLOSE_TOP_PANELS - }); - - dispatch ({ - type: actionTypes.SHOW_ADD_FOLDER_PANEL - }); - }; - }, - hidePanel() { - return (dispatch) => { - dispatch ({ - type: actionTypes.HIDE_ADD_FOLDER_PANEL - }); - }; - }, - loadFolderMappings() { - return (dispatch) => { - ItemsService.loadFolderMappings().then((response) => { - dispatch({ - type: actionTypes.FOLDER_MAPPINGS_LOADED, - data: response - }); - }).catch(() => { - dispatch({ - type: actionTypes.LOAD_FOLDER_MAPPINGS_ERROR - }); - }); - }; - }, - changeName(event) - { - return { - type: actionTypes.CHANGE_NAME, - data: event.target.value - }; - }, - changeFolderType(folderType) - { - return { - type: actionTypes.CHANGE_FOLDER_TYPE, - data: folderType - }; - }, - addFolder(data) { - const {formData, folderPanelState} = data; - const { numItems, sorting } = folderPanelState; - const folderId = folderPanelState.folder ? folderPanelState.folder.folderId : folderPanelState.homeFolderId; - - let newFolderData = { - folderName: formData.name, - FolderMappingId: formData.folderType, - ParentFolderId: folderId - }; - - return (dispatch) => { - ItemsService.addFolder(newFolderData) - .then( - 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 - }) - ); - }; - }, - setValidationErrors(validationErrors) { - return { - type: actionTypes.SET_VALIDATION_ERRORS, - data: validationErrors - }; - } -}; - -export default addFolderPanelActions; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/dialogModalActions.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/dialogModalActions.js deleted file mode 100644 index ae3440334d4..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/dialogModalActions.js +++ /dev/null @@ -1,19 +0,0 @@ -import actionTypes from "../action types/dialogModalActionsTypes"; - -const dialogModalActions = { - open(dialogHeader, dialogMessage, yesFunction, noFunction) { - return { - type: actionTypes.OPEN_DIALOG_MODAL, - data: { - dialogHeader, dialogMessage, yesFunction, noFunction - } - }; - }, - close() { - return { - type: actionTypes.CLOSE_DIALOG_MODAL - }; - } -}; - -export default dialogModalActions; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/folderPanelActions.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/folderPanelActions.js deleted file mode 100644 index fac5345c72a..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/folderPanelActions.js +++ /dev/null @@ -1,191 +0,0 @@ -import ItemsService from "../services/itemsService"; -import actionTypes from "../action types/folderPanelActionsTypes"; -import copyToClipboard from "copy-to-clipboard"; - -function loadingWrap(actionFunction) { - return (dispatch) => { - dispatch({ - type: actionTypes.SET_LOADING, - data: true - }); - - actionFunction() - .then(() => - dispatch({ - type: actionTypes.SET_LOADING, - data: false - }) - ); - }; -} - -function getContent(folderPanelState, changeToFolderId=null) { - const { numItems, sorting, currentFolderId, loadedItems } = folderPanelState; - const folderId = changeToFolderId || currentFolderId; - const startIndex = changeToFolderId ? 0 : loadedItems; - - return dispatch => - ItemsService.getContent(folderId, startIndex, numItems, sorting) - .then( - response => dispatch({ - type: startIndex ? actionTypes.MORE_CONTENT_LOADED : actionTypes.CONTENT_LOADED, - data: response - }), - reason => dispatch({ - type: actionTypes.LOAD_CONTENT_ERROR, - data: reason.data ? reason.data.message : null - }) - ); -} - -function syncContent(folderPanelState, recursive) { - const { numItems, sorting, currentFolderId } = folderPanelState; - - return dispatch => - ItemsService.syncContent(currentFolderId, numItems, sorting, recursive) - .then( - response => dispatch({ - type: actionTypes.CONTENT_LOADED, - data: response - }), - reason => dispatch({ - type: actionTypes.LOAD_CONTENT_ERROR, - data: reason.data ? reason.data.message : null - }) - ); -} - -const folderPanelActions = { - syncContent(folderPanelState, changeToFolderId=null) { - return (dispatch) => { - let syncContentLogic = () => dispatch(syncContent(folderPanelState, changeToFolderId)); - dispatch(loadingWrap(syncContentLogic)); - - let currentHistoryFolderId = history.state ? history.state.folderId : null; - - if (changeToFolderId && currentHistoryFolderId !== changeToFolderId && changeToFolderId !== folderPanelState.homeFolderId) { - history.pushState({folderId: changeToFolderId}, null, "?folderId=" + changeToFolderId); - } - else if (changeToFolderId && currentHistoryFolderId !== changeToFolderId) { - let url = window.location.toString(); - if (url.indexOf("?") > 0) { - let clean_url = url.substring(0, url.indexOf("?")); - history.pushState({folderId: changeToFolderId}, null, clean_url); - } - } - }; - }, - loadContent(folderPanelState, changeToFolderId=null) { - return (dispatch) => { - let getContentLogic = () => dispatch(getContent(folderPanelState, changeToFolderId)); - dispatch(loadingWrap(getContentLogic)); - - let currentHistoryFolderId = history.state ? history.state.folderId : null; - - if (changeToFolderId && currentHistoryFolderId !== changeToFolderId && changeToFolderId !== folderPanelState.homeFolderId) { - history.pushState({folderId: changeToFolderId}, null, "?folderId=" + changeToFolderId); - } - else if (changeToFolderId && currentHistoryFolderId !== changeToFolderId) { - let url = window.location.toString(); - if (url.indexOf("?") > 0) { - let clean_url = url.substring(0, url.indexOf("?")); - history.pushState({folderId: changeToFolderId}, null, clean_url); - } - } - }; - }, - deleteFolder(folderToRemoveId, folderPanelState) { - const { currentFolderId } = folderPanelState; - - return (dispatch) => { - let deleteFolder = () => - ItemsService.deleteFolder(folderToRemoveId) - .then( - () => dispatch(getContent(folderPanelState, currentFolderId)), - - reason => dispatch({ - type: actionTypes.DELETE_FOLDER_ERROR, - data: reason.data ? reason.data.message : null - }) - ); - - dispatch(loadingWrap(deleteFolder)); - }; - }, - deleteFile(fileToRemoveId, folderPanelState) { - const { currentFolderId } = folderPanelState; - - return (dispatch) => { - let deleteFile = () => - ItemsService.deleteFile(fileToRemoveId) - .then( - () => dispatch(getContent(folderPanelState, currentFolderId)), - - reason => dispatch({ - type: actionTypes.DELETE_FILE_ERROR, - data: reason.data ? reason.data.message : null - }) - ); - - dispatch(loadingWrap(deleteFile)); - }; - }, - downloadFile(fileId) { - return (dispatch) => { - let downloadUrl = ItemsService.getDownloadUrl(fileId); - window.open(downloadUrl, "_blank"); - dispatch ({ - type: actionTypes.FILE_DOWNLOADED - }); - }; - }, - copyFileUrlToClipboard(item) { - if (!item.path) { - return; - } - - let fullUrl = ItemsService.getItemFullUrl(item.path); - copyToClipboard(fullUrl); - - return { - type: actionTypes.URL_COPIED_TO_CLIPBOARD, - data: fullUrl - }; - }, - changeSearchingValue(searchText) { - return { - type: actionTypes.CHANGE_SEARCH, - data: searchText - }; - }, - searchFiles(folderPanelState, search, searchMore=false) { - const { numItems, sorting, currentFolderId, loadedItems } = folderPanelState; - const folderId = currentFolderId; - const startIndex = searchMore ? Math.ceil(loadedItems/numItems) + 1 : 1; - - return (dispatch) => { - let getContent = () => - ItemsService.searchFiles(folderId, search, startIndex, numItems, sorting, "") - .then( - response => dispatch({ - type: searchMore ? actionTypes.MORE_CONTENT_LOADED : actionTypes.FILES_SEARCHED, - data: response - }), - reason => dispatch({ - type: actionTypes.SEARCH_FILES_ERROR, - data: reason - }) - ); - - dispatch(loadingWrap(getContent)); - }; - }, - changeSorting(sorting) { - return { - type: actionTypes.CHANGE_SORTING, - data: sorting - }; - } -}; - -export default folderPanelActions; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/globalActions.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/globalActions.js deleted file mode 100644 index d87e6afddbc..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/globalActions.js +++ /dev/null @@ -1,13 +0,0 @@ - -import actionTypes from "../action types/globalActionsTypes"; - -const globalActions = { - loadInitialParameters(initialConfig) { - return { - type: actionTypes.MODULE_PARAMETERS_LOADED, - data: initialConfig - }; - } -}; - -export default globalActions; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/infiniteScrollActions.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/infiniteScrollActions.js deleted file mode 100644 index 95aa4e97ede..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/infiniteScrollActions.js +++ /dev/null @@ -1,12 +0,0 @@ -import actionTypes from "../action types/infiniteScrollActionsTypes"; - -const infiniteScrollActions = { - setMaxScrollTop(maxScrollTop) { - return { - type: actionTypes.SET_MAX_SCROLL_TOP, - data: maxScrollTop - }; - } -}; - -export default infiniteScrollActions; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/itemDetailsActions.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/itemDetailsActions.js deleted file mode 100644 index 607d5976b1b..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/itemDetailsActions.js +++ /dev/null @@ -1,136 +0,0 @@ -import actionTypes from "../action types/itemDetailsActionsTypes"; -import itemsService from "../services/itemsService"; -import localizeService from "../services/localizeService"; - -const itemDetailsActions = { - editItem(item) { - const itemData = {isFolder: item.isFolder, iconUrl: item.iconUrl, thumbnailAvailable: item.thumbnailAvailable, thumbnailUrl: item.thumbnailUrl}; - let getItemDetails = () => item.isFolder - ? itemsService.getFolderDetails(item.itemId) - : itemsService.getFileDetails(item.itemId); - return dispatch => { - getItemDetails() - .then( - response => dispatch({ - type: actionTypes.EDIT_ITEM, - data: {...response, ...itemData} - }), - reason => dispatch({ - type: actionTypes.EDIT_ITEM_ERROR, - data: reason.data && reason.data.message ? reason.data.message : localizeService.getString("GenericErrorMessage") - }) - ); - }; - }, - cancelEditItem() { - return { - type: actionTypes.CANCEL_EDIT_ITEM - }; - }, - moveItem(item) { - const itemData = {isFolder: item.isFolder, iconUrl: item.iconUrl, thumbnailAvailable: item.thumbnailAvailable, thumbnailUrl: item.thumbnailUrl}; - let getItemDetails = () => item.isFolder - ? itemsService.getFolderDetails(item.itemId) - : itemsService.getFileDetails(item.itemId); - return dispatch => { - getItemDetails() - .then( - response => dispatch({ - type: actionTypes.MOVE_ITEM, - data: {...response, ...itemData} - }), - reason => dispatch({ - type: actionTypes.SAVE_ITEM_ERROR, - data: reason.data && reason.data.message ? reason.data.message : localizeService.getString("GenericErrorMessage") - }) - ); - }; - }, - moveFolder(sourceFolderId, destinationFolderId) { - return dispatch => { - itemsService.moveFolder(sourceFolderId, destinationFolderId) - .then( - () => { - dispatch({ - type: actionTypes.ITEM_MOVED, - }); - }, - reason => { - reason.data && reason.data.message ? reason.data.message : localizeService.getString("GenericErrorMessage") - } - ) - }; - }, - moveFile(sourceFileId, destinationFolderId) { - return dispatch => { - itemsService.moveFile(sourceFileId, destinationFolderId) - .then( - () => dispatch({ - type: actionTypes.ITEM_MOVED - }), - reason => { - reason.data && reason.data.message ? reason.data.message : localizeService.getString("GenericErrorMessage") - } - ) - } - }, - cancelMoveItem() { - return { - type: actionTypes.CANCEL_MOVE_ITEM - }; - }, - changeName(event) { - return { - type: actionTypes.CHANGE_NAME, - data: event.target.value - }; - }, - changeTitle(event) { - return { - type: actionTypes.CHANGE_TITLE, - data: event.target.value - }; - }, - changeDescription(event) { - return { - type: actionTypes.CHANGE_DESCRIPTION, - data: event.target.value - }; - }, - changePermissions(permissions) { - return { - type: actionTypes.CHANGE_PERMISSIONS, - data: permissions - }; - }, - setValidationErrors(validationErrors) { - return { - type: actionTypes.SET_VALIDATION_ERRORS, - data: validationErrors - }; - }, - saveItem(item) { - let saveFunction = () => item.isFolder - ? itemsService.saveFolderDetails(item) - : itemsService.saveFileDetails(item); - return dispatch => { - saveFunction() - .then( - () => dispatch({ - type: actionTypes.ITEM_SAVED, - data: { - isFolder: item.isFolder, - itemId: item.isFolder ? item.folderId : item.fileId, - itemName: item.isFolder ? item.folderName : item.fileName - } - }), - reason => dispatch({ - type: actionTypes.SAVE_ITEM_ERROR, - data: reason.data && reason.data.message ? reason.data.message : localizeService.getString("GenericErrorMessage") - }) - ); - }; - } -}; - -export default itemDetailsActions; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/manageFolderTypesPanelActions.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/manageFolderTypesPanelActions.js deleted file mode 100644 index 1d246da77eb..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/manageFolderTypesPanelActions.js +++ /dev/null @@ -1,48 +0,0 @@ -import actionTypes from "../action types/manageFolderTypesPanelActionsTypes"; -import folderPanelActionTypes from "../action types/folderPanelActionsTypes"; -import addFolderPanelActions from "../actions/addFolderPanelActions"; -import ItemsService from "../services/itemsService"; - -const manageFolderTypesPanelActions = { - showPanel() { - return dispatch => { - dispatch ({ - type: folderPanelActionTypes.CLOSE_TOP_PANELS - }); - - dispatch ({ - type: actionTypes.SHOW_MANAGE_FOLDER_TYPES_PANEL - }); - } - }, - hidePanel() { - return dispatch => { - dispatch ({ - type: actionTypes.HIDE_MANAGE_FOLDER_TYPES_PANEL - }); - }; - }, - removeFolderType(folderMappingId) { - return (dispatch) => { - ItemsService.removeFolderType(folderMappingId) - .then( - () => { - dispatch(addFolderPanelActions.loadFolderMappings()); - } - ); - } - }, - getAddFolderTypeUrl() { - return dispatch => { - ItemsService.getAddFolderTypeUrl() - .then(data => { - dispatch({ - type: actionTypes.ADD_FOLDER_TYPE_URL_LOADED, - data - }); - }); - } - } -}; - -export default manageFolderTypesPanelActions; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/messageModalActions.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/messageModalActions.js deleted file mode 100644 index 9bb61abe72c..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/messageModalActions.js +++ /dev/null @@ -1,11 +0,0 @@ -import actionTypes from "../action types/messageModalActionsTypes"; - -const messageModalActions = { - close() { - return { - type: actionTypes.CLOSE_MESSAGE_MODAL - }; - } -}; - -export default messageModalActions; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/topBarActions.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/topBarActions.js deleted file mode 100644 index f01d568652e..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/actions/topBarActions.js +++ /dev/null @@ -1,12 +0,0 @@ -import actionTypes from "../action types/topBarActionsTypes"; - -const topBarActions = { - changeSearchField(text) { - return { - type: actionTypes.CHANGE_SEARCH_FIELD, - data: text - }; - } -}; - -export default topBarActions; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/App.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/App.jsx deleted file mode 100644 index 1805cfc13fe..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/App.jsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -import ModuleLayout from "../containers/ModuleLayout"; - -export default class App extends React.Component { - render() { - return ( - - ); - } -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/AssetsHeader.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/AssetsHeader.jsx deleted file mode 100644 index d42673b99b0..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/AssetsHeader.jsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from "react"; -import ButtonsContainer from "../containers/ButtonsContainer"; -import BreadcrumbsContainer from "../containers/BreadcrumbsContainer"; - -const AssetsHeader = () => ( -
- - -
-); - -export default AssetsHeader; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/Breadcrumb.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/Breadcrumb.jsx deleted file mode 100644 index e24694b9d09..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/Breadcrumb.jsx +++ /dev/null @@ -1,15 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; - -const Breadcrumb = ({name, onClick}) => ( -
- { name } -
-); - -Breadcrumb.propTypes = { - name: PropTypes.string.isRequired, - onClick: PropTypes.func -}; - -export default Breadcrumb; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FileDetails.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FileDetails.jsx deleted file mode 100644 index 70a4099f801..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FileDetails.jsx +++ /dev/null @@ -1,63 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import itemService from "../services/itemsService"; -import localizeService from "../services/localizeService"; - -const FileDetails = ({file, handlers, validationErrors}) => ( -
-
-
-
- {localizeService.getString("Created")}: - {file.createdOnDate} -
-
-
- {localizeService.getString("Size")}: - {file.size} -
-
-
- {localizeService.getString("LastModified")}: - {file.lastModifiedOnDate} -
-
-
- {localizeService.getString("URL")}: - {itemService.getItemFullUrl(file.url)} -
-
-
-
-
- - - -
-
- - -
-
- - -
-
-
- - -
-
-); - -FileDetails.propTypes = { - file: PropTypes.object.isRequired, - handlers: PropTypes.object.isRequired, - validationErrors: PropTypes.object.isRequired -}; - -export default FileDetails; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FileProgress.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FileProgress.jsx deleted file mode 100644 index 2d048760d42..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FileProgress.jsx +++ /dev/null @@ -1,34 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import OverwriteContainer from "../containers/ProgressBarOverwriteContainer"; - -const FileProgress = ({fileName, progress, imgSrc, fileUrl, uploading, error, stopped, message, alreadyExists}) => ( -
- - - - -
- {fileName} - {alreadyExists && } - {message && {message}} -
-
-
-
-
-); - -FileProgress.propTypes = { - fileName: PropTypes.string, - progress: PropTypes.number, - imgSrc: PropTypes.string, - fileUrl: PropTypes.string, - uploading: PropTypes.bool, - error: PropTypes.bool, - stopped: PropTypes.bool, - message: PropTypes.string, - alreadyExists: PropTypes.bool -}; - -export default FileProgress; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FileUpload.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FileUpload.jsx deleted file mode 100644 index 46567143ae1..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FileUpload.jsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from "react"; -import DropZone from "../containers/DropZoneContainer"; -import Progress from "../containers/ProgressContainer"; -import localizeService from "../services/localizeService.js"; - -const FileUpload = () => ( -
- - - {localizeService.getString("FileUploadPanelMessage")} - - - -
-); - -export default FileUpload; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderDetails.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderDetails.jsx deleted file mode 100644 index a0993db1157..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderDetails.jsx +++ /dev/null @@ -1,62 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import localizeService from "../services/localizeService"; -import itemsService from "../services/itemsService"; -import Permissions from "./Permissions"; - -const FolderDetails = ({folder, handlers, validationErrors}) => ( -
-
-
-
- {localizeService.getString("Created")}: - {folder.createdOnDate} -
-
-
- {localizeService.getString("LastModified")}: - {folder.lastModifiedOnDate} -
-
-
- {localizeService.getString("FolderType")}: - {folder.type} -
-
-
- {localizeService.getString("URL")}: - {itemsService.getFolderUrl(folder.folderId)} -
-
-
-
- handlers.changePermissions(permissions)} - > -
-
-
-
- - - -
-
- - -
-
-); - -FolderDetails.propTypes = { - folder: PropTypes.object.isRequired, - handlers: PropTypes.object.isRequired, - validationErrors: PropTypes.object.isRequired -}; - -export default FolderDetails; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/FolderPicker.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/FolderPicker.jsx deleted file mode 100644 index 8b20dace839..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/FolderPicker.jsx +++ /dev/null @@ -1,126 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import FolderSelector from "./FolderSelector"; -import internalService from "../../services/internalService"; - -function findKey(thisObject, id) { - /* eslint-disable spellcheck/spell-checker */ - let p, tRet; - for (p in thisObject) { - if (p === "data") { - if (thisObject[p].key === id) { - return thisObject; - } - } else if (thisObject[p] instanceof Object) { - if (thisObject.hasOwnProperty(p)) { - tRet = findKey(thisObject[p], id); - if (tRet) { return tRet; } - } - } - } - return false; - /* eslint-enable spellcheck/spell-checker */ -} - -export default class FolderPicker extends React.Component { - - constructor(props) { - super(props); - - this.state = { - folders: null - }; - } - - componentDidMount() { - this.getFolders(); - } - - componentWillUnmount() { - this.unmounted = true; - } - - getFolders(searchText) { - let folderPromise = searchText ? internalService.searchFolders(searchText) : internalService.getFolders(); - folderPromise.then( - this.setFolders.bind(this) - ); - } - - getChildrenFolders(parentId) { - internalService.getFolderDescendant(parentId) - .then( - this.addChildFolders.bind(this, parentId) - ); - } - - setFolders(result) { - if (this.unmounted) { - return; - } - - const { props } = this; - let homeFolderId = props.homeFolderId; - - let source = result.Tree; - let filtered = this.findNode(source, (n) => {return n !== null && n.data.key === homeFolderId.toString();}); - if (filtered !== null){ - source.children.splice(0, source.children.length, filtered); - } - this.setState({ folders: result.Tree }); - } - - findNode(node, condition) { - if (condition(node)) { - return node; - } - - for (let i = 0; i < node.children.length; i++) { - let found = this.findNode(node.children[i], condition); - if (found !== null) { - return found; - } - } - - return null; - } - - addChildFolders(parentId, result) { - const folders = this.state.folders; - const parent = findKey(folders, parentId); - const children = result.Items.map((item) => { - return { data: item, children: [] }; - }); - parent.children = children; - this.setState({ folders }); - } - - render() { - const {changeFolder} = this.props; - - return ( - - ); - } -} - -/** - * propTypes - * @property {object} selectedFolder selected folder. Should be null or have a key and value properties - * @property {object} onSelectFolder called when change folder. Pass as parameter a selectedFolder object - * @property {object} onRetrieveFolderError callback for error when retrieve data - */ - -FolderPicker.propTypes = { - selectedFolder: PropTypes.object, - changeFolder: PropTypes.func, - onRetrieveFolderError: PropTypes.func, - noFolderSelectedValue: PropTypes.string.isRequired, - searchFolderPlaceHolder: PropTypes.string.isRequired, - homeFolderId: PropTypes.number -}; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/FolderSelector.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/FolderSelector.jsx deleted file mode 100644 index 0832a9ac9df..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/FolderSelector.jsx +++ /dev/null @@ -1,127 +0,0 @@ -import React, { Component } from "react"; -import { PropTypes } from "prop-types"; -import Folders from "./Folders"; -import { Scrollbars } from "react-custom-scrollbars"; -import "./style.less"; - -const searchIconImage = require("!raw-loader!./img/search.svg").default; - -export default class FolderSelector extends Component { - - constructor() { - super(); - this.state = { - showFolderPicker: false, - searchFolderText: "" - }; - this.timeOut = null; - this.handleClick = this.handleClick.bind(this); - this.folderSelector = React.createRef(); - } - - componentDidMount() { - document.addEventListener("click", this.handleClick, false); - this._isMounted = true; - } - - componentWillUnmount() { - document.removeEventListener("click", this.handleClick, false); - this._isMounted = false; - } - - handleClick(e) { - if (!this._isMounted) { return; } - const node = this.folderSelector; - if (node && node.contains(e.target) || e.target.className === "clear-button") { - return; - } - this.hide(); - } - - hide() { - this.setState({ showFolderPicker: false}); - } - - onFolderChange(folder) { - this.hide(); - this.props.onFolderChange(folder); - } - - onChangeSearchFolderText(e) { - const searchFolderText = e.target.value ? e.target.value : ""; - this.setState({ searchFolderText }); - clearTimeout(this.timeOut); - this.timeOut = setTimeout(() => - this.props.searchFolder(searchFolderText.toLowerCase()), - 500); - } - - clearSearch(e) { - e.preventDefault(); - this.setState({ searchFolderText: "" }); - this.props.searchFolder(); - } - - onFoldersClick() { - const {showFolderPicker} = this.state; - this.setState({ showFolderPicker: !showFolderPicker }); - } - - getSearchIcon() { - /* eslint-disable react/no-danger */ - return (
); - /* eslint-enable react/no-danger */ - } - - render() { - const {selectedFolder, folders, onParentExpands, noFolderSelectedValue, searchFolderPlaceHolder} = this.props; - const selectedFolderText = selectedFolder ? selectedFolder.value : "<" + noFolderSelectedValue + ">"; - const searchIcon = this.getSearchIcon(); - - return ( -
this.folderSelector = fs} className="dnn-folder-selector"> -
- {selectedFolderText} -
-
-
-
- this.onChangeSearchFolderText(e) } - placeholder={searchFolderPlaceHolder} - aria-label="Search" /> - {this.state.searchFolderText && -
×
- } - {searchIcon} -
-
- - - -
-
-
-
- ); - } -} - - -FolderSelector.propTypes = { - folders: PropTypes.object, - onFolderChange: PropTypes.func.isRequired, - onParentExpands: PropTypes.func.isRequired, - selectedFolder: PropTypes.object, - searchFolder: PropTypes.func.isRequired, - noFolderSelectedValue: PropTypes.string.isRequired, - searchFolderPlaceHolder: PropTypes.string.isRequired -}; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/Folders.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/Folders.jsx deleted file mode 100644 index 4cc00d55afa..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/Folders.jsx +++ /dev/null @@ -1,103 +0,0 @@ -import React, { Component } from "react"; -import { PropTypes } from "prop-types"; -import "./style.less"; - -const folderIcon = require("!raw-loader!./img/folder.svg").default; - -export default class Folders extends Component { - - constructor() { - super(); - this.state = { - openFolders: [] - }; - } - - componentWillReceiveProps(props) { - if (!props.folders || !props.folders.children || !props.folders.children[0] || - !props.folders.children[0].data || !props.folders.children[0].data.key) { - return; - } - const rootKey = props.folders.children[0].data.key; - const {openFolders} = this.state; - openFolders.push(rootKey); - this.setState({ openFolders }); - } - - - toggleFolder(key) { - let {openFolders} = this.state; - if (openFolders.some(id => id === key)) { - openFolders = openFolders.filter(id => id !== key); - } else { - openFolders.push(key); - } - this.setState({ openFolders }); - } - - onParentClick(item) { - if (!item.data.hasChildren) { - return; - } - this.toggleFolder(item.data.key); - if (item.children && item.children.length) { - return; - } - this.props.onParentExpands(item.data.key); - } - - onFolderNameClick(folder) { - this.props.onFolderChange(folder.data); - } - - getFolderIcon() { - /* eslint-disable react/no-danger */ - return (
); - /* eslint-enable react/no-danger */ - } - - getFolders(folder) { - if (!folder) { - return false; - } - - const folderIcon = this.getFolderIcon(); - const children = folder.children.map((child) => { - const isOpen = this.state.openFolders.some(id => child !== null && id === child.data.key); - const className = isOpen ? "open" : ""; - return child !== null &&
  • - {child.data.hasChildren && -
    -
    - } -
    - {folderIcon} -
    {child.data.value}
    -
    - {child.data.hasChildren && - this.getFolders(child) - } -
  • ; - }); - - return
      {children}
    ; - } - - render() { - const folders = this.getFolders(this.props.folders); - - return ( -
    - {folders} -
    - ); - } -} - -Folders.propTypes = { - folders: PropTypes.object, - onFolderChange: PropTypes.func.isRequired, - onParentExpands: PropTypes.func.isRequired -}; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/img/folder.svg b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/img/folder.svg deleted file mode 100644 index cf83478037a..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/img/folder.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/img/search.svg b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/img/search.svg deleted file mode 100644 index 9622314b685..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/img/search.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/style.less b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/style.less deleted file mode 100644 index a2af1f28a27..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/FolderSelector/style.less +++ /dev/null @@ -1,296 +0,0 @@ -.prefixes(@property, @value) { - -webkit-@{property}: @value; - -khtml-@{property}: @value; - -moz-@{property}: @value; - -ms-@{property}: @value; - @{property}: @value; -} - -@import "~@dnnsoftware/dnn-react-common/styles/index"; -@transition: .2s; - -.dnn-folder-selector { - width: 100%; - float: left; - height: 30px; - border: 1px solid @mountainMist; - position: relative; - border: none; - - &:after { - content: ""; - position: absolute; - right: 20px; - top: 12px; - width: 0; - height: 0; - pointer-events: none; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - border-top: 4px solid @rollingStone; - } - - .selected-item { - float: left; - width: 100%; - height: 100%; - padding: 7px; - box-sizing: border-box; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - padding-right: 20px; - } - - span > strong { - cursor: pointer; - &:hover { - text-decoration: underline; - } - } - - .folder-selector-container { - position: absolute; - top: ~"calc(100% + 1px)"; - left: -1px; - width: 100%; - border: 1px solid @alto; - background: white; - z-index: 1; - transition: @transition; - overflow: hidden; - max-height: 0px; - box-shadow: none; - opacity: 0; - &.show { - max-height: 600px; - opacity: 1; - } - .inner-box { - box-sizing: border-box; - padding: 20px; - float: left; - width: 100%; - height: 100%; - .search { - float: left; - width: 100%; - border: 1px solid @alto; - position: relative; - .clear-button { - position: absolute; - right: 32px; - top: 50%; - height: 26px; - margin-top: -13px; - font-size: 26px; - line-height: 26px; - opacity: .5; - cursor: pointer; - &:hover { - opacity: 1; - } - } - .search-icon { - position: absolute; - right: 0px; - top: 50%; - transform: translate(0, -50%); - height: 24px; - color: @rollingStone; - } - input[type="text"] { - float: left; - border: none; - width: ~"calc(100% - 40px)"; - box-sizing: border-box; - outline: none !important; - padding: 0px !important; - box-shadow: none; - border: none !important; - margin-top: 3px; - margin-left: 5px; - } - } - .items { - float: left; - width: 100%; - border: 1px solid @alto; - height: 200px; - margin-top: 14px; - &, * { - .prefixes(user-select, none); - } - - .scrollArea { - height: 100% !important; - max-height: none !important; - - & > div:first-child{ - box-sizing: content-box; - padding-bottom: 17px; - height: 100%; - } - - .dnn-folders-component{ - div.has-children{ - top: 9px; - } - } - } - } - } - } -} - -.dnn-folders-component { - padding-top: 6px; - ul { - padding-left: 20px; - box-sizing: border-box; - li { - list-style: none; - position: relative; - float: left; - width: 100%; - margin-top: 0px; - & > div { - padding-top: 0px; - cursor: pointer; - float: left; - width: 100%; - padding-top: 4px; - &:hover { - color: @curiousBlue; - } - } - & > ul { - height: 0px; - overflow: hidden; - float: left; - width: 100%; - } - &.open { - & > ul { - height: auto; - } - & > .has-children { - transform: rotate(90Deg); - } - } - .icon { - width: 14px; - float: left; - margin-right: 5px; - height: 13px; - cursor: pointer; - } - .item-name { - cursor: pointer; - float: left; - width: ~"calc(100% - 30px)"; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - &.none-specified { - font-weight: bold; - } - } - .has-children { - position: absolute; - left: -15px; - top: 1px; - width: 10px; - height: 10px; - cursor: pointer; - transition: .18s; - &:after { - content: ""; - position: absolute; - left: 4px; - top: 1px; - width: 0; - height: 0; - border-top: 4px solid transparent; - border-bottom: 4px solid transparent; - border-left: 4px solid @rollingStone; - } - } - } - } - - padding-top: 6px; - ul { - padding-left: 20px; - box-sizing: border-box; - li { - list-style: none; - position: relative; - float: left; - width: 100%; - margin-top: 0px; - & > div { - padding-top: 0px; - cursor: pointer; - float: left; - width: 100%; - padding-top: 4px; - &:hover { - color: @curiousBlue; - } - } - & > ul { - height: 0px; - overflow: hidden; - float: left; - width: 100%; - } - &.open { - & > ul { - height: auto; - } - & > .has-children { - transform: rotate(90Deg); - } - } - .icon { - width: 14px; - float: left; - margin-right: 5px; - height: 13px; - cursor: pointer; - } - .item-name { - cursor: pointer; - float: left; - width: ~"calc(100% - 30px)"; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - &.none-specified { - font-weight: bold; - } - } - .has-children { - position: absolute; - left: -15px; - top: 1px; - width: 10px; - height: 10px; - cursor: pointer; - transition: .18s; - &:after { - content: ""; - position: absolute; - left: 4px; - top: 1px; - width: 0; - height: 0; - border-top: 4px solid transparent; - border-bottom: 4px solid transparent; - border-left: 4px solid @rollingStone; - } - } - } - } -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/Item.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/Item.jsx deleted file mode 100644 index 1bf4faab8b5..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/Item.jsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; - -function truncateString(content, length) { - if (typeof length === "undefined") { - length = 13; - } - - return content.length <= length ? content : content.substr(0, length) + "..."; -} - -const Item = ({item, iconUrl, handlers, isHighlighted, isDetailed}) => ( -
    -
    -
    -
    -

    { truncateString(item.itemName) }

    -
    -
    -
    -
    -
    -
    - -
    - { handlers.onEdit ?
    : "" } - { handlers.onCopyToClipboard ?
    : "" } - { handlers.onDownload ?
    : "" } - { handlers.onMove ?
    : ""} - { handlers.onDelete ?
    : "" } -
    -
    - {isDetailed &&
    } -
    -); - -Item.propTypes = { - item: PropTypes.object.isRequired, - iconUrl: PropTypes.string.isRequired, - handlers: PropTypes.object.isRequired, - isHighlighted: PropTypes.bool, - isDetailed: PropTypes.bool -}; - -export default Item; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/Permissions.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/Permissions.jsx deleted file mode 100644 index 1d34801acb9..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/components/Permissions.jsx +++ /dev/null @@ -1,57 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import { PermissionGrid } from "@dnnsoftware/dnn-react-common"; -import DnnSf from "../globals/dnnSf"; - -class Permissions extends React.Component { - constructor(props) { - super(props); - - this.state = { - permissions: JSON.parse( - JSON.stringify(props.folderBeingEdited.permissions) - ), - }; - } - - onPermissionsChanged(permissions) { - const { state } = this; - - let newPermissions = Object.assign({}, state.permissions, permissions); - this.props.updateFolderBeingEdited(newPermissions); - this.setState({ permissions: newPermissions }); - } - - render() { - const { state } = this; - const dnnSf = new DnnSf(); - const grid = ( - {}} - permissions={state.permissions} - service={dnnSf} - onPermissionsChanged={this.onPermissionsChanged.bind(this)} - /> - ); - return
    {grid}
    ; - } -} - -Permissions.propTypes = { - updateFolderBeingEdited: PropTypes.func, - folderBeingEdited: PropTypes.object, -}; - -function mapStateToProps() { - return {}; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({}, dispatch), - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(Permissions); diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/AddAssetPanelContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/AddAssetPanelContainer.jsx deleted file mode 100644 index 8de7b06f21e..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/AddAssetPanelContainer.jsx +++ /dev/null @@ -1,49 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import FileUpload from "../components/FileUpload"; -import localizeService from "../services/localizeService"; -import addAssetPanelActions from "../actions/addAssetPanelActions"; - -class AddAssetPanelContainer extends React.Component { - render() { - const { expanded, hasPermission, hidePanel } = this.props; - - return hasPermission ? ( - - ) : null; - } -} - -AddAssetPanelContainer.propTypes = { - expanded: PropTypes.bool, - hasPermission: PropTypes.bool, - hidePanel: PropTypes.func -}; - -function mapStateToProps(state) { - const addAssetPanelState = state.addAssetPanel; - const folderPanelState = state.folderPanel; - - return { - expanded: addAssetPanelState.expanded, - hasPermission: folderPanelState.hasAddFilesPermission - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - hidePanel: addAssetPanelActions.hidePanel - }, dispatch) - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(AddAssetPanelContainer); \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/AddFolderPanelContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/AddFolderPanelContainer.jsx deleted file mode 100644 index 83f1bcc04e3..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/AddFolderPanelContainer.jsx +++ /dev/null @@ -1,173 +0,0 @@ -import React from "react"; -import { PropTypes } from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import localizeService from "../services/localizeService"; -import addFolderPanelActions from "../actions/addFolderPanelActions"; -import DropDown from "../../../../../../Dnn.AdminExperience/ClientSide/Dnn.React.Common/src/Dropdown"; - -class AddFolderPanelContainer extends React.Component { - constructor(props) { - super(props); - this.props.loadFolderMappings(); - this.nameInput = React.createRef(); - this.container = React.createRef(); - } - - componentDidUpdate(previousProps) { - if (!previousProps.expanded && this.props.expanded) { - this.nameInput.focus(); - - // Workaround so the dropdown shows properly with more than 3 folder providers - setTimeout(() => { - this.container.style = "overflow: visible;"; - }, 1000); - } - if (previousProps.expanded && !this.props.expanded) { - this.container.style = "overflow: hidden;"; - } - } - - getParentFolderName() { - const {currentFolderId, currentFolderName, homeFolderId} = this.props.folderPanelState; - - if (currentFolderId === homeFolderId) { - return "HOME"; - } - - return currentFolderName; - } - - render() { - const { expanded, hasPermission, hidePanel, folderTypes, formData, validationErrors, folderPanelState, - changeName, changeFolderType, addFolder, setValidationErrors } = this.props; - - let localizedFolderTypes = folderTypes ? folderTypes.map(obj => - { - let label = localizeService.getString(obj.MappingName); - return { label, value: obj.FolderMappingID }; - }) : undefined; - - let nameValidationError = validationErrors ? validationErrors.name : ""; - let typeValidationError = validationErrors ? validationErrors.type : ""; - - function onSelectChange(option) { - changeFolderType.call(this, option.value); - } - - function formSubmit() { - if (!validateForm()) { - return; - } - - let data = { - formData, - folderPanelState - }; - - addFolder(data); - } - - function validateForm() { - let result = true; - let validationErrors = {}; - - if (!formData.name) { - validationErrors.name = localizeService.getString("FolderNameRequiredMessage"); - result = false; - } - - if (!formData.folderType) { - validationErrors.type = localizeService.getString("FolderTypeRequiredMessage"); - result = false; - } - - setValidationErrors(validationErrors); - - return result; - } - - return hasPermission ? ( -
    this.container = e} className={"top-panel add-folder" + (expanded ? " rm-expanded" : "")} > -
    -
    - - { "/" + this.getParentFolderName() } -
    -
    - - { this.nameInput = input; }} /> - - -
    - { - folderPanelState.folder.folderPath === "" && -
    - - - -
    - } -
    - - - - - -
    -
    - ) : null; - } -} - -AddFolderPanelContainer.propTypes = { - expanded: PropTypes.bool, - hasPermission: PropTypes.bool, - hidePanel: PropTypes.func, - loadFolderMappings: PropTypes.func, - folderTypes: PropTypes.array, - validationErrors: PropTypes.object, - formData: PropTypes.object, - folderPanelState: PropTypes.object, - changeName: PropTypes.func, - changeFolderType: PropTypes.func, - addFolder: PropTypes.func, - setValidationErrors: PropTypes.func -}; - -function mapStateToProps(state) { - const folderPanelState = state.folderPanel; - const addFolderPanelState = state.addFolderPanel; - - return { - expanded: addFolderPanelState.expanded, - hasPermission: folderPanelState.hasAddFoldersPermission, - folderTypes: addFolderPanelState.folderMappings, - formData: addFolderPanelState.formData || {}, - validationErrors: addFolderPanelState.validationErrors, - folderPanelState - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - hidePanel: addFolderPanelActions.hidePanel, - loadFolderMappings: addFolderPanelActions.loadFolderMappings, - changeName: addFolderPanelActions.changeName, - changeFolderType: addFolderPanelActions.changeFolderType, - addFolder: addFolderPanelActions.addFolder, - setValidationErrors: addFolderPanelActions.setValidationErrors - }, dispatch) - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(AddFolderPanelContainer); \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/AssetsPanelContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/AssetsPanelContainer.jsx deleted file mode 100644 index a8aa733f025..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/AssetsPanelContainer.jsx +++ /dev/null @@ -1,223 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { connect } from "react-redux"; -import { bindActionCreators } from "redux"; -import AssetsHeader from "../components/AssetsHeader"; -import folderPanelActions from "../actions/folderPanelActions"; -import ManageFolderTypesContainer from "../containers/ManageFolderTypesPanelContainer"; -import AddFolderPanelContainer from "../containers/AddFolderPanelContainer"; -import AddAssetPanelContainer from "../containers/AddAssetPanelContainer"; -import TopBarContainer from "./TopBarContainer"; -import Item from "../containers/ItemContainer"; -import ItemDetailsContainer from "../containers/ItemDetailsContainer"; -import ItemMoveContainer from "../containers/ItemMoveContainer"; -import localizeService from "../services/localizeService.js"; -import TransitionGroup from "react-transition-group/TransitionGroup"; -import CSSTransition from "react-transition-group/CSSTransition"; - -class AssetsPanelContainer extends React.Component { - constructor(props) { - super(props); - this.mainContainer = React.createRef(); - } - componentWillMount() { - window.addEventListener("scroll", this.handleScroll.bind(this)); - } - - getDetailsPosition(i) { - const itemWidth = this.props.itemWidth; - const container = this.mainContainer; - const containerWidth = container.clientWidth; - const itemsPerRow = Math.floor(containerWidth / itemWidth); - let position = Math.floor(i / itemsPerRow) * itemsPerRow + itemsPerRow - 1; - - return position; - } - - getDetailsPanel(showPanel, i) { - return ( - - - {showPanel && } - - - ); - } - - getMovePanel(showPanel, i) { - return ( - - - {showPanel && } - - - ); - } - - handleScroll() { - const { folderPanelState, loadContent, searchFiles } = this.props; - const { totalCount, loadedItems, search, loading } = folderPanelState; - - const bodyHeight = document.body.offsetHeight; - const windowHeight = window.innerHeight; - const totalScrolled = window.pageYOffset; - const scrollMax = bodyHeight - windowHeight; - - if (loadedItems < totalCount && totalScrolled + 100 > scrollMax) { - if (!loading) { - this.setState({ - loadingFlag: true, - }); - - if (search) { - searchFiles(folderPanelState, search, true); - } else { - loadContent(folderPanelState); - } - } - } - } - - render() { - const { - items, - itemEditing, - itemMoving, - search, - itemContainerDisabled, - loading, - } = this.props; - let propsPosition = -1; - - let result = []; - for (let i = 0; i < items.length; i++) { - const item = items[i]; - const { itemId, itemName, isFolder } = item; - result.push(); - - if ( itemEditing && - ( - (isFolder && itemEditing.folderId === itemId) || - (!isFolder && itemEditing.fileId === itemId) - ) - ) { - propsPosition = this.getDetailsPosition(i); - } - - if ( itemMoving && - ( - (isFolder && itemMoving.folderId === itemId) || - (!isFolder && itemMoving.fileId === itemId) - ) - ) { - propsPosition = this.getDetailsPosition(i); - } - - let showPanel = - i === propsPosition || - (propsPosition >= items.length && i === items.length - 1); - if (itemEditing){ - result.push(this.getDetailsPanel(showPanel, i)); - } - - if (itemMoving) { - result.push(this.getMovePanel(showPanel, i)); - } - } - - return ( -
    e.stopPropagation()}> - -
    - -
    (this.mainContainer = c)} - className={"main-container" + (loading ? " loading" : "")} - > - - - -
    - {result} -
    - - {localizeService.getString("AssetsPanelNoSearchResults")} - -
    -
    - - {localizeService.getString("AssetsPanelEmpty_Title")} - - - {localizeService.getString("AssetsPanelEmpty_Subtitle")} - -
    -
    -
    -
    -
    - ); - } -} - -AssetsPanelContainer.propTypes = { - folderPanelState: PropTypes.object, - items: PropTypes.array, - search: PropTypes.string, - itemContainerDisabled: PropTypes.bool, - loading: PropTypes.bool, - itemEditing: PropTypes.object, - itemMoving: PropTypes.object, - itemWidth: PropTypes.number, - loadContent: PropTypes.func, - searchFiles: PropTypes.func, -}; - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators( - { - loadContent: folderPanelActions.loadContent, - searchFiles: folderPanelActions.searchFiles, - }, - dispatch - ), - }; -} - -function mapStateToProps(state) { - const folderPanelState = state.folderPanel; - const addFolderPanelState = state.addFolderPanel; - const addAssetPanelState = state.addAssetPanel; - const itemDetailsState = state.itemDetails; - - return { - folderPanelState, - items: folderPanelState.items || [], - search: folderPanelState.search, - itemContainerDisabled: - addFolderPanelState.expanded || addAssetPanelState.expanded, - loading: folderPanelState.loading, - itemEditing: itemDetailsState.itemEditing, - itemMoving: itemDetailsState.itemMoving, - itemWidth: folderPanelState.itemWidth, - }; -} - -export default connect( - mapStateToProps, - mapDispatchToProps -)(AssetsPanelContainer); diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/BreadcrumbsContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/BreadcrumbsContainer.jsx deleted file mode 100644 index 8c6a6db0ec9..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/BreadcrumbsContainer.jsx +++ /dev/null @@ -1,65 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import Breadcrumb from "../components/Breadcrumb"; -import folderPanelActions from "../actions/folderPanelActions"; -import localizeService from "../services/localizeService"; - -class BreadcrumbsContainer extends React.Component { - render() { - const { breadcrumbs, loadContent, folderPanelState } = this.props; - const search = folderPanelState.search; - - let result = []; - let folderId; - - if (breadcrumbs[0]) { - folderId = breadcrumbs[0].folderId; - } - result.push(); - for (let i = 1; i"); - result.push(); - } - - if (search) { - result.push(">"); - result.push(); - } - - return ( -
    - { result } -
    - ); - } -} - -BreadcrumbsContainer.propTypes = { - breadcrumbs: PropTypes.array, - loadContent: PropTypes.func, - folderPanelState: PropTypes.object -}; - -function mapStateToProps(state) { - const breadcrumbsState = state.breadcrumbs; - const folderPanelState = state.folderPanel; - - return { - breadcrumbs: breadcrumbsState.breadcrumbs || [], - folderPanelState - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - loadContent: folderPanelActions.loadContent - }, dispatch) - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(BreadcrumbsContainer); \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ButtonsContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ButtonsContainer.jsx deleted file mode 100644 index 80258fb3244..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ButtonsContainer.jsx +++ /dev/null @@ -1,55 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import localizeService from "../services/localizeService.js"; -import manageFolderTypesPanelActions from "../actions/manageFolderTypesPanelActions"; -import addFolderPanelActions from "../actions/addFolderPanelActions"; -import addAssetPanelActions from "../actions/addAssetPanelActions"; - -class ButtonsContainer extends React.Component { - render() { - const { hasManageFolderTypesPermission, hasAddFilesPermission, hasAddFoldersPermission, showAddFolderPanel, showAddAssetPanel, showManageFolderTypesPanel } = this.props; - - return ( -
    -
    - { hasManageFolderTypesPermission ? { localizeService.getString("ManageFolderTypes") } : null } - { hasAddFoldersPermission ? { localizeService.getString("AddFolder") } : null } - { hasAddFilesPermission ? { localizeService.getString("AddAsset") } : null } -
    -
    - ); - } -} - -ButtonsContainer.propTypes = { - showManageFolderTypesPanel: PropTypes.func, - showAddFolderPanel: PropTypes.func, - showAddAssetPanel: PropTypes.func, - hasManageFolderTypesPermission: PropTypes.bool, - hasAddFilesPermission: PropTypes.bool, - hasAddFoldersPermission: PropTypes.bool -}; - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - showManageFolderTypesPanel: manageFolderTypesPanelActions.showPanel, - showAddFolderPanel: addFolderPanelActions.showPanel, - showAddAssetPanel: addAssetPanelActions.showPanel - }, dispatch) - }; -} - -function mapStateToProps(state) { - const folderPanelState = state.folderPanel; - const moduleState = state.module; - return { - hasManageFolderTypesPermission: moduleState.isAdmin, - hasAddFilesPermission: folderPanelState.hasAddFilesPermission, - hasAddFoldersPermission: folderPanelState.hasAddFoldersPermission - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(ButtonsContainer); \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/DevTools.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/DevTools.js deleted file mode 100644 index 89ffa86bf64..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/DevTools.js +++ /dev/null @@ -1,11 +0,0 @@ -import React from "react"; -import { createDevTools } from "redux-devtools"; -import LogMonitor from "redux-devtools-log-monitor"; -import DockMonitor from "redux-devtools-dock-monitor"; - -export default createDevTools( - - - -); diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/DialogModalContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/DialogModalContainer.jsx deleted file mode 100644 index 0dfb455f9b6..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/DialogModalContainer.jsx +++ /dev/null @@ -1,76 +0,0 @@ -import React from "react"; -import { PropTypes } from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import dialogModalActions from "../actions/dialogModalActions"; -import Modal from "../../../../../../Dnn.AdminExperience/ClientSide/Dnn.React.Common/src/Modal"; -import Label from "../../../../../../Dnn.AdminExperience/ClientSide/Dnn.React.Common/src/Label"; - -class DialogModalContainer extends React.Component { - render() { - const modalStyles = { - overlay: { - zIndex: "99999", - backgroundColor: "rgba(0,0,0,0.6)" - }, - content: { - borderRadius: "7px", - "background": "white", - WebkitBoxShadow: "0 0 25px 0 rgba(0, 0, 0, 0.75)", - boxShadow: "0 0 25px 0 rgba(0, 0, 0, 0.75)", - textAlign: "center", - "width": "300px", - height: "178px", - margin: "auto", - padding: 0, - border: "none", - boxSizing: "border-box" - } - }; - - const { dialogHeader, dialogMessage, close, yesFunction, noFunction } = this.props; - - function yesHandler() { - close(); - yesFunction(); - } - - return ( - - - ); - } -} - -DialogModalContainer.propTypes = { - dialogHeader: PropTypes.string, - dialogMessage: PropTypes.string, - close: PropTypes.func.isRequired, - yesFunction: PropTypes.func, - noFunction: PropTypes.func -}; - -function mapStateToProps(state) { - const dialogModalState = state.dialogModal; - return { - dialogHeader: dialogModalState.dialogHeader, - dialogMessage: dialogModalState.dialogMessage, - yesFunction: dialogModalState.yesFunction, - noFunction: dialogModalState.noFunction - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - close: dialogModalActions.close - }, dispatch) - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(DialogModalContainer); diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/DropZoneContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/DropZoneContainer.jsx deleted file mode 100644 index 043151329c6..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/DropZoneContainer.jsx +++ /dev/null @@ -1,126 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import DropZone from "react-dropzone"; -import addAssetPanelActions from "../actions/addAssetPanelActions"; -import api from "../globals/api"; - -class DropZoneContainer extends React.Component { - validateFile(file) { - const { - maxUploadSize, - maxFileUploadSizeHumanReadable, - fileSizeError, - invalidExtensionError, - } = this.props; - - if (file.size > maxUploadSize) { - fileSizeError(file.name, maxFileUploadSizeHumanReadable); - return false; - } - - const validExtensions = api - .getWhitelistObject() - .extensionWhitelist.split(","); - const ext = file.name.substr(file.name.lastIndexOf(".") + 1); - let valid = false; - for (let i = 0; i < validExtensions.length; i++) { - const extension = validExtensions[i]; - if (extension !== ext) continue; - valid = true; - break; - } - - if (!valid) { - invalidExtensionError(file.name); - return false; - } - - return true; - } - - uploadFilesHandler(acceptedFiles) { - const { - showPanel, - folderPanelState, - trackProgress, - uploadFiles, - } = this.props; - showPanel(); - const validFiles = acceptedFiles.filter(this.validateFile.bind(this)); - uploadFiles( - validFiles, - this.getFolderPath(), - folderPanelState, - trackProgress - ); - } - - getFolderPath() { - const { folder } = this.props.folderPanelState; - return folder ? folder.folderPath : ""; - } - - render() { - const { hasPermission, style, activeStyle, className } = this.props; - return hasPermission ? ( - - {() => this.props.children} - - ) : ( -
    {this.props.children}
    - ); - } -} - -DropZoneContainer.propTypes = { - children: PropTypes.node, - disableClick: PropTypes.bool, - className: PropTypes.string, - style: PropTypes.any, - activeStyle: PropTypes.any, - folderPanelState: PropTypes.object, - hasPermission: PropTypes.bool, - showPanel: PropTypes.func, - uploadFiles: PropTypes.func, - trackProgress: PropTypes.func, - maxUploadSize: PropTypes.number, - maxFileUploadSizeHumanReadable: PropTypes.string, - fileSizeError: PropTypes.func, - invalidExtensionError: PropTypes.func, -}; - -function mapStateToProps(state) { - const folderPanelState = state.folderPanel; - const moduleState = state.module; - - return { - folderPanelState, - maxUploadSize: moduleState.maxUploadSize, - maxFileUploadSizeHumanReadable: moduleState.maxFileUploadSizeHumanReadable, - hasPermission: folderPanelState.hasAddFilesPermission, - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators( - { - showPanel: addAssetPanelActions.showPanel, - uploadFiles: addAssetPanelActions.uploadFiles, - trackProgress: addAssetPanelActions.trackProgress, - fileSizeError: addAssetPanelActions.fileSizeError, - invalidExtensionError: addAssetPanelActions.invalidExtensionError, - }, - dispatch - ), - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(DropZoneContainer); diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ItemContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ItemContainer.jsx deleted file mode 100644 index 23b4c8a97de..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ItemContainer.jsx +++ /dev/null @@ -1,176 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import folderPanelActions from "../actions/folderPanelActions"; -import itemDetailsActions from "../actions/itemDetailsActions"; -import dialogModalActions from "../actions/dialogModalActions"; -import Item from "../components/Item"; -import itemsService from "../services/itemsService"; -import localizeService from "../services/localizeService"; - -class ItemContainer extends React.Component { - render() { - const { item, itemEditing, loadContent, editItem, moveItem, downloadFile, deleteFolder, - deleteFile, copyFileUrlToClipboard, openDialog, closeDialog, - folderPanelState, uploadedFiles, newFolderId } = this.props; - const isFolder = item.isFolder; - const { hasDeletePermission, hasManagePermission } = folderPanelState; - - function isHighlighted() { - if (isFolder && newFolderId === item.itemId) { - return true; - } - - if (!isFolder) { - for (let i = 0; i < uploadedFiles.length; i++) { - if (uploadedFiles[i].fileId === item.itemId) { - return true; - } - } - } - - return false; - } - - function getIconUrl() { - return itemsService.getIconUrl(item); - } - - function onClickFolder() { - if (!isFolder) { - return; - } - - loadContent(folderPanelState, item.itemId); - } - - function onEditItem(item, event) { - event.stopPropagation(); - editItem(item); - } - - function onDeleteFolder(event) { - event.stopPropagation(); - if (!isFolder) { - return; - } - - const dialogHeader = localizeService.getString("DeleteFolderDialogHeader"); - const dialogMessage = localizeService.getString("DeleteFolderDialogMessage"); - const yesFunction = deleteFolder.bind(this, item.itemId, folderPanelState); - const noFunction = closeDialog; - - openDialog(dialogHeader, dialogMessage, yesFunction, noFunction); - } - - function onMoveFolder(item, event) { - event.stopPropagation(); - if (!isFolder) { - return; - } - - moveItem(item); - } - - function onMoveFile(item, event) { - event.stopPropagation(); - if(isFolder) { - return; - } - - moveItem(item); - } - - function onDeleteFile(event) { - event.stopPropagation(); - if (isFolder) { - return; - } - - const dialogHeader = localizeService.getString("DeleteFileDialogHeader"); - const dialogMessage = localizeService.getString("DeleteFileDialogMessage"); - const yesFunction = deleteFile.bind(this, item.itemId, folderPanelState); - const noFunction = closeDialog; - - openDialog(dialogHeader, dialogMessage, yesFunction, noFunction); - } - - function isDetailed() { - if (!itemEditing) { - return false; - } - - const {isFolder, fileId, folderId} = itemEditing; - - if ((isFolder && folderId === item.itemId) || - (!isFolder && fileId === item.itemId)) { - return true; - } - - return false; - } - - const handlers = { - onClick: isFolder ? onClickFolder : null, - onEdit: hasManagePermission ? onEditItem.bind(this, item) : null, - onCopyToClipboard: isFolder ? null : copyFileUrlToClipboard.bind(this, item), - onDownload: isFolder ? null : downloadFile.bind(this, item.itemId), - onMove: (hasManagePermission && hasDeletePermission) ? isFolder ? onMoveFolder.bind(this, item) : onMoveFile.bind(this, item) : null, - onDelete: hasDeletePermission ? isFolder ? onDeleteFolder : onDeleteFile : null - }; - - return ( - - ); - } -} - -ItemContainer.propTypes = { - item: PropTypes.object, - loadContent: PropTypes.func, - editItem: PropTypes.func, - moveItem: PropTypes.func, - downloadFile: PropTypes.func, - deleteFolder: PropTypes.func, - deleteFile: PropTypes.func, - copyFileUrlToClipboard: PropTypes.func, - openDialog: PropTypes.func, - closeDialog: PropTypes.func, - folderPanelState: PropTypes.object, - uploadedFiles: PropTypes.array, - newFolderId: PropTypes.number, - itemEditing: PropTypes.object -}; - -function mapStateToProps(state) { - const folderPanelState = state.folderPanel; - const addAssetPanelState = state.addAssetPanel; - const addFolderPanelState = state.addFolderPanel; - const itemDetailsState = state.itemDetails; - - return { - folderPanelState, - uploadedFiles: addAssetPanelState.uploadedFiles, - newFolderId: addFolderPanelState.newFolderId, - itemEditing: itemDetailsState.itemEditing - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - loadContent: folderPanelActions.loadContent, - editItem: itemDetailsActions.editItem, - moveItem: itemDetailsActions.moveItem, - downloadFile: folderPanelActions.downloadFile, - deleteFolder: folderPanelActions.deleteFolder, - deleteFile: folderPanelActions.deleteFile, - copyFileUrlToClipboard: folderPanelActions.copyFileUrlToClipboard, - openDialog: dialogModalActions.open, - closeDialog: dialogModalActions.close - }, dispatch) - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(ItemContainer); \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ItemDetailsContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ItemDetailsContainer.jsx deleted file mode 100644 index 6afa215c5c0..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ItemDetailsContainer.jsx +++ /dev/null @@ -1,95 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import itemDetailsActions from "../actions/itemDetailsActions"; -import FolderDetails from "../components/FolderDetails"; -import FileDetails from "../components/FileDetails"; -import itemService from "../services/itemsService"; -import localizeService from "../services/localizeService"; - -class ItemDetailsContainer extends React.Component { - constructor(props) { - super(props); - } - - validateForm() { - const {itemEditing, setValidationErrors} = this.props; - let result = true; - let validationErrors = {}; - - if ((!itemEditing.isFolder && !itemEditing.fileName) || (itemEditing.isFolder && !itemEditing.folderName)) { - validationErrors.fileName = localizeService.getString("ItemNameRequiredMessage"); - result = false; - } - - setValidationErrors(validationErrors); - return result; - } - formSubmit() { - if (!this.validateForm()) { - return; - } - - const {itemEditing, saveItem} = this.props; - saveItem(itemEditing); - } - render() { - const {itemEditing, cancelEditItem, - changeName, changeTitle, changeDescription, changePermissions} = this.props; - const onSave = this.formSubmit.bind(this); - const handlers = {changeName, changeTitle, changeDescription, changePermissions, cancelEditItem, onSave}; - let fileName, folderName, title, description; - fileName = folderName = title = description = ""; - let item = {fileName, folderName, title, description}; - const isFolder = itemEditing ? itemEditing.isFolder : false; - const validationErrors = this.props.validationErrors || {}; - - if (itemEditing) { - let iconStyle = {backgroundImage: "url('" + itemService.getIconUrl(itemEditing) + "')"}; - item = {...itemEditing, iconStyle}; - } - - return ( - isFolder ? - : - - ); - } -} - -ItemDetailsContainer.propTypes = { - itemEditing: PropTypes.object, - cancelEditItem: PropTypes.func, - changeName: PropTypes.func, - changeTitle: PropTypes.func, - changeDescription: PropTypes.func, - changePermissions: PropTypes.func, - saveItem: PropTypes.func, - setValidationErrors: PropTypes.func, - validationErrors: PropTypes.object -}; - -function mapStateToProps(state) { - const itemDetailsState = state.itemDetails; - return { - itemEditing: itemDetailsState.itemEditing, - validationErrors: itemDetailsState.validationErrors - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - cancelEditItem: itemDetailsActions.cancelEditItem, - changeName: itemDetailsActions.changeName, - changeTitle: itemDetailsActions.changeTitle, - changeDescription: itemDetailsActions.changeDescription, - changePermissions: itemDetailsActions.changePermissions, - saveItem: itemDetailsActions.saveItem, - setValidationErrors: itemDetailsActions.setValidationErrors - }, dispatch) - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(ItemDetailsContainer); diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ItemMoveContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ItemMoveContainer.jsx deleted file mode 100644 index fd452473a01..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ItemMoveContainer.jsx +++ /dev/null @@ -1,107 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import itemDetailsActions from "../actions/itemDetailsActions"; -import localizeService from "../services/localizeService"; -import FolderPicker from "../components/FolderSelector/FolderPicker" -import folderPanelActions from "../actions/folderPanelActions"; - -class ItemMoveContainer extends React.Component { - constructor(props) { - super(props); - this.state = { - selectedFolderId: this.props.folderPanelState.currentFolderId, - selectedFolderName: this.props.folderPanelState.currentFolderName, - }; - } - - handleFolderChange(e){ - this.setState({ - ...this.state, - selectedFolderId: e.key, - selectedFolderName: e.value, - }); - } - - handleItemMove(){ - if (this.state.selectedFolderId === this.props.folderPanelState.currentFolderId){ - this.props.cancelMoveItem(); - return; - } - - if (this.props.itemMoving.isFolder){ - this.props.moveFolder(this.props.itemMoving.folderId, this.state.selectedFolderId); - } - else { - this.props.moveFile(this.props.itemMoving.fileId, this.state.selectedFolderId); - } - } - - componentWillUnmount(){ - this.props.loadContent(this.props.folderPanelState, this.state.selectedFolderId); - } - - render() { - const { cancelMoveItem, homeFolderId } = this.props; - return ( -
    -

    {localizeService.getString("MoveItem")}

    - -
    - - this.handleFolderChange(e)} - homeFolderId={homeFolderId} - noFolderSelectedValue={localizeService.getString("NoFolderSelected")} - searchFolderPlaceHolder={localizeService.getString("SearchFolder")} - /> -
    - -
    - - -
    -
    - ); - } -} - -ItemMoveContainer.propTypes = { - itemMoving: PropTypes.object, - cancelMoveItem: PropTypes.func, - moveItem: PropTypes.func, - moveFolder: PropTypes.func, - moveFile: PropTypes.func, - loadContent: PropTypes.func, - folderPanelState: PropTypes.object, - homeFolderId: PropTypes.number, -}; - -function mapStateToProps(state) { - const itemDetailsState = state.itemDetails; - return { - folderPanelState: state.folderPanel, - itemMoving: itemDetailsState.itemMoving, - homeFolderId: state.module.homeFolderId, - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - cancelMoveItem: itemDetailsActions.cancelMoveItem, - moveItem: itemDetailsActions.moveItem, - moveFolder: itemDetailsActions.moveFolder, - moveFile: itemDetailsActions.moveFile, - loadContent: folderPanelActions.loadContent, - }, dispatch) - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(ItemMoveContainer); diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ManageFolderTypesPanelContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ManageFolderTypesPanelContainer.jsx deleted file mode 100644 index 4c69a4f981a..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ManageFolderTypesPanelContainer.jsx +++ /dev/null @@ -1,143 +0,0 @@ -import React from "react"; -import { PropTypes } from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import localizeService from "../services/localizeService"; -import manageFolderTypesPanelActions from "../actions/manageFolderTypesPanelActions"; -import { SvgIcons } from "@dnnsoftware/dnn-react-common"; -import addFolderPanelActions from "../actions/addFolderPanelActions"; -import dialogModalActions from "../actions/dialogModalActions"; - -class ManageFolderTypesPanelContainer extends React.Component { - constructor(props) { - super(props); - this.props.loadFolderMappings(); - if (props.isAdmin){ - this.props.getAddFolderTypeUrl(); - } - } - - handleConfirmRemoveFolderType(e, folderTypeMappingId) { - e.preventDefault(); - let dialogHeader = localizeService.getString("RemoveFolderTypeDialogHeader"); - let dialogBody = localizeService.getString("RemoveFolderTypeDialogBody"); - this.props.openDialog(dialogHeader, dialogBody, () => this.handleRemoveFolderType(folderTypeMappingId), this.props.closeDialog); - } - - handleRemoveFolderType(folderTypeMappingId) { - this.props.removeFolderType(folderTypeMappingId); - this.props.loadFolderMappings(); - } - - render() { - const { - expanded, - hidePanel, - folderTypes, - isAdmin, - addFolderTypeUrl, - } = this.props; - - return isAdmin && expanded ? ( -
    -

    {localizeService.getString("FolderTypeDefinitions")}

    - - - - - - - - - - - {folderTypes && folderTypes.map(folderType => { - return ( - - - - - - - ); - })} - -
     {localizeService.getString("Name")}{localizeService.getString("FolderProvider")} 
    - {!folderType.IsDefault && - - } - {folderType.MappingName}{folderType.FolderProviderType} - {!folderType.IsDefault && -
    - - - - - -
    -
    - ) : null; - } -} - -ManageFolderTypesPanelContainer.propTypes = { - expanded: PropTypes.bool, - hidePanel: PropTypes.func, - folderTypes: PropTypes.array, - isAdmin: PropTypes.bool, - loadFolderMappings: PropTypes.func, - removeFolderType: PropTypes.func, - openDialog: PropTypes.func, - closeDialog: PropTypes.func, - getAddFolderTypeUrl: PropTypes.func, - addFolderTypeUrl: PropTypes.string, -}; - -function mapStateToProps(state) { - const folderPanelState = state.folderPanel; - const manageFolderTypesPanelState = state.manageFolderTypesPanel; - const addFolderPanelState = state.addFolderPanel; - const module = state.module; - - return { - expanded: manageFolderTypesPanelState.expanded, - isAdmin: module.isAdmin, - folderTypes: addFolderPanelState.folderMappings, - addFolderTypeUrl: manageFolderTypesPanelState.addFolderTypeUrl, - folderPanelState - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - hidePanel: manageFolderTypesPanelActions.hidePanel, - loadFolderMappings: addFolderPanelActions.loadFolderMappings, - removeFolderType: manageFolderTypesPanelActions.removeFolderType, - openDialog: dialogModalActions.open, - closeDialog: dialogModalActions.close, - getAddFolderTypeUrl: manageFolderTypesPanelActions.getAddFolderTypeUrl, - }, dispatch) - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(ManageFolderTypesPanelContainer); \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/MessageModalContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/MessageModalContainer.jsx deleted file mode 100644 index 55c5052ba9e..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/MessageModalContainer.jsx +++ /dev/null @@ -1,78 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import messageModalActions from "../actions/messageModalActions"; -import Modal from "../../../../../../Dnn.AdminExperience/ClientSide/Dnn.React.Common/src/Modal"; - - -class MessageModalContainer extends React.Component { - render() { - const modalStyles = { - overlay: { - zIndex: "99999", - "background": "none" - }, - content: { - borderRadius: "3px", - color: "white", - textAlign: "center", - background: "#002e47", - opacity: ".9", - WebkitBoxShadow: "0 0 25px 0 rgba(0, 0, 0, 0.75)", - width: "10%", - minWidth: "250px", - minHeight: "80px", - maxHeight: "120px", - margin: "auto", - padding: 0, - border: "none", - boxSizing: "border-box" - } - }; - - const { infoMessage, errorMessage, close } = this.props; - const messageToShow = infoMessage || errorMessage; - - function setTimeOutToClose() { - setTimeout(function () { - close(); - }, 3000); - } - - if (messageToShow) - { - setTimeOutToClose(); - } - - return ( - -

    {messageToShow}

    -
    - ); - } -} - -MessageModalContainer.propTypes = { - infoMessage: PropTypes.string, - errorMessage: PropTypes.string, - close: PropTypes.func.isRequired -}; - -function mapStateToProps(state) { - const messageModalState = state.messageModal; - return { - infoMessage: messageModalState.infoMessage, - errorMessage: messageModalState.errorMessage - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - close: messageModalActions.close - }, dispatch) - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(MessageModalContainer); diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ModuleLayout.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ModuleLayout.jsx deleted file mode 100644 index 6ee59723c19..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ModuleLayout.jsx +++ /dev/null @@ -1,62 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import folderPanelActions from "../actions/folderPanelActions"; -import AssetsPanelContainer from "./AssetsPanelContainer"; -import DialogModalContainer from "./DialogModalContainer"; -import MessageModalContainer from "./MessageModalContainer"; -import DropZone from "../containers/DropZoneContainer"; - -class ModuleLayout extends React.Component { - componentDidMount() { - const { folderPanelState, loadContent } = this.props; - this.props.loadContent(folderPanelState); - - window.addEventListener("popstate", - event => { - const state = event.state; - if (state && state.folderId) { - loadContent(folderPanelState, state.folderId); - } - else { - loadContent(folderPanelState, folderPanelState.homeFolderId); - } - } - ); - } - - render() { - return ( -
    - - - - - -
    - ); - } -} - -ModuleLayout.propTypes = { - loadContent: PropTypes.func, - folderPanelState: PropTypes.object -}; - -function mapStateToProps(state) { - const folderPanelState = state.folderPanel; - return { - folderPanelState - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - loadContent: folderPanelActions.loadContent - }, dispatch) - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(ModuleLayout); diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ProgressBarOverwriteContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ProgressBarOverwriteContainer.jsx deleted file mode 100644 index c0f766954b7..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ProgressBarOverwriteContainer.jsx +++ /dev/null @@ -1,71 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import addAssetPanelActions from "../actions/addAssetPanelActions"; -import localizeService from "../services/localizeService.js"; - -class ProgressBarOverwriteContainer extends React.Component { - render() { - const {fileName, folderPanelState, overwriteFile, stopUpload, trackProgress, breadcrumbs} = this.props; - - function getFolderPath() { - let path = ""; - for (let i = 1; i < breadcrumbs.length; i++) { - path += breadcrumbs[i].folderName + "/"; - } - - return path; - } - - function overwriteClickHandler() { - overwriteFile(fileName, getFolderPath(), folderPanelState, trackProgress, true); - } - - function abortClickHandler() { - stopUpload(fileName); - } - - return ( - - - {localizeService.getString("Replace")} - {localizeService.getString("Keep")} - - ); - } -} - -ProgressBarOverwriteContainer.propTypes = { - fileName: PropTypes.string, - breadcrumbs: PropTypes.array, - file: PropTypes.object, - folderPanelState: PropTypes.object, - overwriteFile: PropTypes.func, - stopUpload: PropTypes.func, - trackProgress: PropTypes.func, - progress: PropTypes.object -}; - -function mapStateToProps(state) { - const folderPanelState = state.folderPanel; - const breadcrumbsState = state.breadcrumbs; - - return { - folderPanelState, - breadcrumbs: breadcrumbsState.breadcrumbs - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - overwriteFile: addAssetPanelActions.overwriteFile.bind(addAssetPanelActions), - stopUpload: addAssetPanelActions.stopUpload, - trackProgress: addAssetPanelActions.trackProgress - }, dispatch) - }; -} - - -export default connect(mapStateToProps, mapDispatchToProps)(ProgressBarOverwriteContainer); \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ProgressContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ProgressContainer.jsx deleted file mode 100644 index 765ec90c4a1..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/ProgressContainer.jsx +++ /dev/null @@ -1,93 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { connect } from "react-redux"; -import FileProgress from "../components/FileProgress"; -import localizeService from "../services/localizeService"; - -function isImage(url) { - if (!url) { - return false; - } - - const imageExtensions = ["JPG", "JPE", "BMP", "GIF", "PNG", "JPEG", "ICO"]; - let urlNoParameters = url.split("?")[0]; - let ext = urlNoParameters.split(".").reverse()[0].toUpperCase(); - for (let i = 0; i < imageExtensions.length; i++) { - if (imageExtensions[i] === ext) return true; - } - return false; -} - -class ProgressContainer extends React.Component { - isUploading(fileProgress) { - const {completed, alreadyExists, stopped, error} = fileProgress; - return !completed && !alreadyExists && !stopped && !error; - } - getImageUrl(fileProgress) { - const uploading = this.isUploading(fileProgress); - - if (uploading) { - return ""; - } - - if (isImage(fileProgress.path)) { - return fileProgress.path; - } - - return fileProgress.fileIconUrl; - } - - getMessage(fileProgress) { - const {error, stopped, completed} = fileProgress; - - if (error) { - return fileProgress.error; - } - - if (stopped) { - return localizeService.getString("FileUploadStoppedMessage"); - } - - if (completed) { - return localizeService.getString("FileUploadedMessage"); - } - - return null; - } - - render() { - const { progress } = this.props; - let output = []; - for (let fileName in progress) { - const fileProgress = progress[fileName]; - const {error, stopped, path, alreadyExists} = fileProgress; - const uploading = this.isUploading(fileProgress); - const imageUrl = this.getImageUrl(fileProgress); - const message = this.getMessage(fileProgress); - - output.push(); - } - - return ( -
    - { output } -
    - ); - } -} - -ProgressContainer.propTypes = { - progress: PropTypes.object, - uploaded: PropTypes.object -}; - -function mapStateToProps(state) { - const addAssetPanelState = state.addAssetPanel; - - return { - progress: addAssetPanelState.progress, - uploaded: addAssetPanelState.uploaded - }; -} - -export default connect(mapStateToProps)(ProgressContainer); \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/TopBarContainer.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/TopBarContainer.jsx deleted file mode 100644 index d549799de9d..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/containers/TopBarContainer.jsx +++ /dev/null @@ -1,164 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { bindActionCreators } from "redux"; -import { connect } from "react-redux"; -import folderPanelActions from "../actions/folderPanelActions"; -import topBarActions from "../actions/topBarActions"; -import localizeService from "../services/localizeService"; -import DropDown from "../../../../../../Dnn.AdminExperience/ClientSide/Dnn.React.Common/src/Dropdown"; -import FolderPicker from "../components/FolderSelector/FolderPicker"; -import debounce from "lodash/debounce"; - -const refreshSyncIcon = require("!raw-loader!../../../Images/redeploy.svg").default; - -class TopBarContainer extends React.Component { - componentWillMount() { - this.debouncedSearch = debounce(this.searchHandler.bind(this, true), 500); - } - - onChangeFolder(folder) { - const {folderPanelState, loadContent} = this.props; - const folderId = parseInt(folder.key); - loadContent(folderPanelState, folderId); - } - - searchHandler(checkLength) { - const {folderPanelState, changeSearchingValue, searchFiles, loadContent} = this.props; - const {currentFolderId} = folderPanelState; - const oldSearch = folderPanelState.search; - let search = this.props.search; - - search = checkLength && search.length < 3 ? "" : search; - - if (!oldSearch && !search) { - return; - } - - changeSearchingValue(search); - if (!search) { - loadContent(folderPanelState, currentFolderId); - } - else { - searchFiles(folderPanelState, search); - } - } - - onSearchChanged(event) { - this.props.changeSearchField(event.target.value); - this.debouncedSearch(); - } - - onSortingChange(option) { - const {changeSorting, loadContent, folderPanelState} = this.props; - const {currentFolderId} = folderPanelState; - const newFolderPanelState = { ...folderPanelState, sorting: option.value }; - - changeSorting(option.value); - loadContent(newFolderPanelState, currentFolderId); - } - - onRefreshSyncChange(folderPanelState, currentFolderId, option) { - switch (option.value) { - case "Refresh": - this.props.loadContent(folderPanelState, currentFolderId); - break; - - case "SyncThisFolder": - this.props.syncContent(folderPanelState, false); - break; - - case "SyncThisFolderAndSubfolders": - this.props.syncContent(folderPanelState, true); - break; - - default: - break; - } - } - - render() { - const {folderPanelState, search, userLogged, homeFolderId} = this.props; - const {currentFolderId, currentFolderName, sortOptions, sorting} = folderPanelState; - - return ( -
    -
    - {userLogged ? -
    - this.onRefreshSyncChange(folderPanelState, currentFolderId, option)} - withBorder={false} - label="" - prependWith={} - withIcon={false} /> - -
    - : {localizeService.getString("DisabledForAnonymousUsersMessage")} - } -
    -
    - -
    -
    - - - -
    -
    - ); - } -} - -TopBarContainer.propTypes = { - folderPanelState: PropTypes.object, - loadContent: PropTypes.func, - syncContent: PropTypes.func, - changeSearchingValue: PropTypes.func, - searchFiles: PropTypes.func, - changeSorting: PropTypes.func, - changeSearchField: PropTypes.func, - search: PropTypes.string, - userLogged: PropTypes.bool, - homeFolderId: PropTypes.number -}; - -function mapStateToProps(state) { - const moduleState = state.module; - const folderPanelState = state.folderPanel; - const topBarState = state.topBar; - - return { - folderPanelState, - search: topBarState.search || "", - userLogged: moduleState.userLogged, - homeFolderId: moduleState.homeFolderId - }; -} - -function mapDispatchToProps(dispatch) { - return { - ...bindActionCreators({ - loadContent: folderPanelActions.loadContent, - syncContent: folderPanelActions.syncContent, - searchFiles: folderPanelActions.searchFiles, - changeSearchingValue: folderPanelActions.changeSearchingValue, - changeSorting: folderPanelActions.changeSorting, - changeSearchField: topBarActions.changeSearchField - }, dispatch) - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(TopBarContainer); \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/globals/api.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/globals/api.js deleted file mode 100644 index 29d53933aa6..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/globals/api.js +++ /dev/null @@ -1,263 +0,0 @@ -let tabId = -1; -let moduleId = -1; -let groupId = -1; -let moduleName = ""; -let extensionWhitelist = ""; -let validationCode = ""; - -const ANTIFORGERY_TOKEN_KEY = "__RequestVerificationToken"; - -function getAntiForgeryToken() { - let inputNodes = document.getElementsByTagName("input"); - inputNodes = Array.prototype.slice.call(inputNodes); - const antiforgeryTokenNodes = inputNodes.filter(function (inputNode) { - return inputNode.getAttribute("name") === ANTIFORGERY_TOKEN_KEY; - }); - - if (antiforgeryTokenNodes.length > 0) { - return antiforgeryTokenNodes[0].value; - } - - return ""; -} - -/** function to perform raw http request */ -function httpRequest(url, options) { - const headersObject = { - "ModuleId": moduleId, - "TabId": tabId, - "GroupId": groupId - }; - - if (options.headers) { - Object.assign(headersObject, options.headers); - } - - const antiforgeryToken = getAntiForgeryToken(); - if (antiforgeryToken) { - headersObject.RequestVerificationToken = antiforgeryToken; - } - - const headers = new Headers(headersObject); - options = Object.assign(options, { - credentials: "same-origin", - headers: headers - }); - - - return fetch(url, options).then(handleHttpResponse); -} - -function SAHttpRequest(url, options) { - // eslint-disable-next-line - const request = require("superagent"); - const { method, body, progressTracker } = options; - - const headersObject = { - "ModuleId": moduleId, - "TabId": tabId, - "GroupId": groupId - }; - - if (options.headers) { - Object.assign(headersObject, options.headers); - } - - const antiforgeryToken = getAntiForgeryToken(); - if (antiforgeryToken) { - headersObject.RequestVerificationToken = antiforgeryToken; - } - - return request(method, url).set(headersObject).send(body).on("progress", progressTracker) - .then(response => JSON.parse(response.text), handleSAHttpRequestFailure); -} - -function handleSAHttpRequestFailure(response) { - const error = new Error(response.status + " - An expected error has been received from the server."); - error.code = response.status; - throw error; -} - -/** function to handle http response */ -function handleHttpResponse(response) { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } - - return response.json() - .then(function processErrorJson(json) { - const error = new Error(); - error.code = response.status; - error.data = json; - throw error; - } - , () => { - const error = new Error(response.status + " - An expected error has been received from the server."); - error.code = response.status; - throw error; - }); -} - -/** function to serialize query string object */ -function serializeQueryStringParameters(obj) { - let s = []; - for (let p in obj) { - if (obj.hasOwnProperty(p)) { - s.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); - } - } - return s.join("&"); -} - -/** - * @module api - */ -const api = { - /** initialize the api module. This call must be done before use any other method of the module - * @param {object} options - moduleId, tabId and moduleName are required - * */ - init(options) { - if (!options) { - throw new Error("The init method requires an options parameter with tabId, moduleId and moduleName"); - } - - if (typeof(options.moduleId) !== "number" || options.moduleId <= 0 ) { - throw new Error("The moduleId must be a number greater than 0."); - } - - if (typeof(options.moduleName) !== "string" || !options.moduleName ) { - throw new Error("The moduleName must be a string and it can't be empty. "); - } - - if (typeof(options.tabId) !== "number" || options.tabId <= 0 ) { - throw new Error("The tabId must be a number greater than 0"); - } - - moduleId = options.moduleId; - moduleName = options.moduleName; - tabId = options.tabId; - groupId = options.groupId; - extensionWhitelist = options.extensionWhitelist; - validationCode = options.validationCode; - }, - - getAntiForgeryToken() { - return getAntiForgeryToken(); - }, - - getServiceRoot(ignoreCurrentModuleApi) { - // eslint-disable-next-line no-undef - let serviceRoot = dnn.getVar("sf_siteRoot", "/"); - serviceRoot += "DesktopModules/"; - if (!ignoreCurrentModuleApi) { - serviceRoot += moduleName + "/API/"; - } - return serviceRoot; - }, - - getModuleRoot() { - // eslint-disable-next-line no-undef - let moduleRoot = dnn.getVar("sf_siteRoot", "/"); - moduleRoot += "DesktopModules/" + moduleName; - - return moduleRoot; - }, - - /** this function performs a get http request - * @param {string} url - * @param {object} query string object - * */ - get(url, queryString = null) { - - if (queryString) { - url += (url.indexOf("?") > 0 ? "&" : "?") + serializeQueryStringParameters(queryString); - } - - return httpRequest(url, { - method: "GET" - }); - }, - /** this function performs a post http request - * @param {string} url - * @param {object} body - * */ - post(url, body, headers) { - let data = null; - if (headers && headers["Content-Type"] === "multipart/form-data") { - let formData = new FormData(); - for (const name in body) { - formData.append(name, body[name]); - } - data = formData; - - delete headers["Content-Type"]; - } - - return httpRequest(url, { - method: "POST", - body: data || JSON.stringify(body), - headers: headers - }); - }, - /** Posta a primitive value (integer, string, etc.) - * @param {string} url - * @param {any} value - */ - postPrimitive(url, value) { - var urlencoded = new URLSearchParams(); - urlencoded.append("", value.toString()); - return httpRequest(url, { - method: "POST", - body: urlencoded, - headers: [{"Content-Type": "application/x-www-form-urlencoded"}], - }); - }, - /** this function performs a post http request - * @param {string} url - * @param {object} body - * */ - postFile(url, formData, progressTracker) { - return SAHttpRequest(url, { - method: "POST", - body: formData, - progressTracker - }); - - }, - /** this function performs a put http request - * @param {string} url - * @param {object} body - * */ - put(url, body) { - return httpRequest(url, { - method: "PUT", - body: JSON.stringify(body) - }); - }, - /** this function performs a delete http request - * @param {string} url - * @param {object} body - * */ - delete(url, body) { - return httpRequest(url, { - method: "DELETE", - body: JSON.stringify(body) - }); - }, - getHeadersObject() { - const headersObject = { - moduleId, - tabId, - groupId - }; - return headersObject; - }, - getWhitelistObject() { - const whitelistObject = { - extensionWhitelist, - validationCode - }; - return whitelistObject; - } -}; -export default api; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/globals/dnnSf.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/globals/dnnSf.js deleted file mode 100644 index 5ef8f918664..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/globals/dnnSf.js +++ /dev/null @@ -1,101 +0,0 @@ -export default class DnnSf { - moduleRoot = ""; - controller = ""; - siteRoot = ""; - tabId = -1; - antiForgeryToken = ""; - - constructor() { - this.siteRoot = window.top.dnn.getVar("sf_siteRoot", "/"); - this.tabId = parseInt(window.top.dnn.getVar("sf_tabId", "-1")); - this.antiForgeryToken = window.top.document.querySelector("input[name=__RequestVerificationToken]").value; - } - - get = (method, params, success, failure, loading, beforeSend) => { - return this.call("GET", method, params, success, failure, loading, beforeSend, false, false); - } - - call = (httpMethod, method, params, success, failure, loading, beforeSend, sync, silence, postFile) => { - let url = this.getServiceRoot() + this.controller + "/" + method; - this.moduleRoot = "personaBar"; - this.controller = ""; - - return this.rawCall(httpMethod, url, params, success, failure, loading, beforeSend, sync, silence, postFile); - } - - getServiceRoot = () => { - return this.siteRoot + "API/" + this.moduleRoot + "/"; - } - - rawCall = (httpMethod, url, params, success, failure, loading, beforeSend, sync, silence, postFile) => { - let beforeCallback; - if (typeof beforeSend === "function") { - beforeCallback = (xhr) => { - this.setHeaders(xhr); - return beforeSend(xhr); - }; - } - else { - beforeCallback = this.setHeaders; - } - - let options = { - url: url, - beforeSend: beforeCallback, - type: httpMethod, - async: sync === false, - success: function (d) { - if (typeof loading === "function") { - loading(false); - } - - if (typeof success === "function") { - success(d || {}); - } - }, - error: function (xhr, status, err) { - if (typeof loading === "function") { - loading(false); - } - - if (typeof failure === "function") { - if (xhr) { - failure(xhr, err); - } - else { - failure(null, "Unknown error"); - } - } - } - }; - - if (httpMethod === "GET") { - options.data = params; - } else if (postFile) { - options.processData = false; - options.contentType = false; - options.data = params; - } - else { - options.contentType = "application/json; charset=UTF-8"; - options.data = JSON.stringify(params); - options.dataType = "json"; - } - - if (typeof loading === "function") { - loading(true); - } - - return window.$.ajax(options); - } - - setHeaders = (xhr) => { - if (this.tabId) { - xhr.setRequestHeader("TabId", this.tabId); - } - - if (this.antiForgeryToken.length > 0) { - xhr.setRequestHeader("RequestVerificaitonToken", this.antiForgeryToken); - } - } -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/globals/resourceManager.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/globals/resourceManager.js deleted file mode 100644 index 97f7d10ca08..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/globals/resourceManager.js +++ /dev/null @@ -1,35 +0,0 @@ -import api from "./api"; -import globalActions from "../actions/globalActions"; -import localizeService from "../services/localizeService.js"; - -const resourceManager = { - init(options) { - api.init(options); - localizeService.init(options.resx); - require("../less/styles.less"); - - resourceManager.dispatch(globalActions.loadInitialParameters(options)); - const container = document.getElementById(options.containerId); - - this.render(container); - }, - - dispatch() { - throw new Error("dispatch method needs to be overwritten from the Redux store"); - }, - - render() { - throw new Error("render method needs to be overwritten from the Redux store"); - } - -}; - -if (typeof window.dnn === "undefined" || window.dnn === null) { - window.dnn = {}; -} -if (typeof window.dnn.ResourceManager === "undefined") { - window.dnn.ResourceManager = {}; -} -window.dnn.ResourceManager.instance = resourceManager; - -export default resourceManager; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/Assets.less b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/Assets.less deleted file mode 100644 index e63ab4a8939..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/Assets.less +++ /dev/null @@ -1,1099 +0,0 @@ -#Assets-panel { - @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { - div#folder-picker div.selected-item { - margin-left: -20px; - } - } - #assets-header.socialpanelheader { - padding-bottom: 0; - padding: 0; - min-height: 103px; - max-height: 103px; - -webkit-box-sizing: border-box !important; - -moz-box-sizing: border-box !important; - box-sizing: border-box !important; - box-shadow: 0 1px 2px -1px rgba(0,0,0,.2); - position: relative; - } - #assets-header.socialpanelheader > h3 { - float: left; - margin: 14px 0 0 0; - } - #assets-header.socialpanelheader:after { - border: 0; - } - #assets-header.socialpanelheader > div.right-container > div { - float: right; - &:first-child { - margin-left: 12px; - } - } - #assets-header.socialpanelheader a.add-folder { - background-image: url('/DesktopModules/ResourceManager/Images/icon-add-folder.png'); - background-repeat: no-repeat; - background-position: center; - display: inline-block; - height: 32px; - padding: 0; - width: 32px; - } - #assets-header.socialpanelheader a.add-folder:hover { - background-color: #d9ecfa; - } - #assets-header.socialpanelheader .right-container { - position: absolute; - right: 0; - top: 50%; - transform: translate(0, -50%); - } - .rm-button.primary { - display: inline-block; - background-color: #1E88C3; - border: none; - border-radius: 3px; - padding: 0 16px; - height: 42px; - line-height: 42px; - text-align: center; - color: #FFFFFF; - box-sizing: border-box; - vertical-align: top; - min-width: 106px; - cursor: pointer; - } - .rm-button.secondary { - display: inline-block; - border: 1px solid #1E88C3; - border-radius: 3px; - padding: 0 16px; - height: 42px; - line-height: 42px; - text-align: center; - color: #1E88C3; - vertical-align: top; - box-sizing: border-box; - cursor: pointer; - min-width: 106px; - margin-right: 10px; - } - .rm-button.primary.normal, .rm-button.secondary.normal { - height: 35px; - line-height: 35px; - min-width: 92px; - } - #assets-header.socialpanelheader a { - cursor: pointer; - } - #assets-header.socialpanelheader div.folder-picker-container { - display: inline-block; - vertical-align: top; - } - .assets-body { - margin-top: 0; - position: relative; - } - .assets-body .header-container { - padding: 10px 0px; - height: 51px; - border-bottom: 1px solid #C8C8C8; - box-sizing: border-box; - } - .assets-body .header-container .assets-input { - margin-left: 5px; - box-shadow: none; - } - /*Reduce input placeholder font size*/ - .assets-body .header-container .assets-input::-webkit-input-placeholder { - font-size: 12px; - } - .assets-body .header-container .assets-input:-moz-placeholder { - font-size: 12px; - } - .assets-body .header-container .assets-input::-moz-placeholder { - font-size: 12px; - } - .assets-body .header-container input.assets-input:-ms-input-placeholder { - font-size: 12px; - min-width: 123px; - min-height: 16px; - } - .assets-body .header-container .assets-input, input, select, textarea { - border: 1px solid #ddd; - padding: 8px 16px; - border-radius: 3px; - background-color: #fff; - } - .assets-body .header-container input[type='search'].assets-input { - -webkit-appearance: none; - font-weight: bold; - padding-right: 29px; - margin: 0; - width: ~"calc(100% - 24px)"; - border: none; - background: none; - outline: none; - } - .assets-body .header-container .dnnDropDownList .selected-item { - border: 1px solid #ddd; - box-shadow: none; - background: #fff; - } - .assets-body .header-container .assets-input[type=search]::-webkit-search-cancel-button { - display: none; - } - .assets-body .header-container .assets-input[type=search]::-ms-clear { - display: none; - width: 0; - height: 0; - } - .assets-body .header-container a.search-button { - background-image: url('/DesktopModules/ResourceManager/Images/search.svg'); - background-repeat: no-repeat; - background-position: center; - display: inline-block; - width: 22px; - height: 20px; - right: 15px; - position: absolute; - top: 8px; - cursor: pointer; - } - - .assets-body .header-container a.sync-button { - background-image: url(/DesktopModules/ResourceManager/Images/redeploy.svg); - background-repeat: no-repeat; - background-position: center; - display: inline-block; - width: 22px; - height: 20px; - top: 7px; - position: absolute; - right: 0px; - cursor: pointer; - } - - .assets-body .header-container { - color: #46292b; - - .folder-picker-container, .sort-container { - height: 31px; - border-right: 1px solid #C8C8C8; - } - .folder-picker-container { - span { - display: block; - margin-top: 7px; - } - - .dnn-folder-selector { - border: none; - .selected-item { - padding: 7px 15px; - } - } - } - .sort-container { - .dnn-dropdown { - width: 100%; - background: none; - } - } - .refresh-sync-container { - display: flex; - justify-content: right; - .dnn-dropdown { - width: 33%; - background: none; - } - } - } - .assets-body .dnnDropDownList.rm-folder { - width: 100%; - vertical-align: top; - } - .assets-body .dnnDropDownList.rm-folder * { - box-sizing: border-box; - } - .assets-body .dnnDropDownList.rm-folder .selected-item { - border: none; - box-shadow: none; - background: none; - } - .assets-body .dnnDropDownList.rm-folder .selected-item a { - font-weight: bold; - padding: 7px 0; - border-left: none; - background: none; - position: relative; - color: #4B4E4F; - height: 32px; - } - .assets-body .dnnDropDownList.rm-folder .selected-item a:after { - content: ""; - display: block; - width: 0; - height: 0; - position: absolute; - right: 0; - top: 14px; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - border-top: 4px solid #4B4E4F; - } - .assets-body .dnnDropDownList.rm-folder .selected-item a.opened { - color: #1E88C3; - background: none; - } - .assets-body .dnnDropDownList.rm-folder .selected-item a.opened:after { - border-top-color: #1E88C3; - } - .assets-body .dt-container { - width: 267px; - background: #fff; - border: 1px solid #C8C8C8; - border-radius: 3px; - box-shadow: 0 0 20px 0 gba(0, 0, 0, .2); - top: 42px; - height: 330px; - .dt-header { - margin: 20px 20px 13px 20px; - background: none; - border: none; - box-shadow: none; - padding: 0; - } - .dt-header .sort-button { - display: none; - } - .dt-header .search-container { - margin: 0; - position: relative; - .search-input-container { - border: 1px solid #C8C8C8; - border-radius: 0; - padding: 0 32px 0 0; - input { - background-color: transparent; - border-radius: 0; - border: none; - } - } - .clear-button { - right: 32px; - border: none; - } - .search-button { - position: absolute; - right: 1px; - top: 1px; - width: 32px; - height: 32px; - background-image: url(/DesktopModules/ResourceManager/Images/search.png); - background-repeat: no-repeat; - background-position: center; - } - } - .dt-content { - margin: 65px 20px 0 20px; - border: 1px solid #C8C8C8; - height: 224px; - width: auto; - position: relative; - overflow: hidden; - } - ul.tv-nodes { - &.tv-root { - margin: 4px 4px 0 -10px; - } - li.tv-node { - list-style: none; - padding: 0 0 0 16px; - } - a.text { - background: url(/DesktopModules/ResourceManager/Images/folder.png) no-repeat 2px 0px; - border: 1px solid transparent; - color: #6F7273; - padding: 0 8px 0 24px; - text-decoration: none; - &.selected { - font-weight: bold; - } - } - a.text:hover { - text-decoration: none; - background-image: url(/DesktopModules/ResourceManager/Images/folder-hover.png); - color: #1E88C3; - border: 1px solid transparent; - } - a.icon { - text-decoration: none; - display: inline-block; - padding: 0; - height: 16px; - width: 16px; - border: 1px solid transparent; - outline: none; - vertical-align: middle; - cursor: pointer; - &.rm-expanded { - background: url(/DesktopModules/ResourceManager/Images/tree-sprite.png) no-repeat 0 -18px; - } - &.collapsed { - background: url(/DesktopModules/ResourceManager/Images/tree-sprite.png) no-repeat 0 -2px; - } - } - } - .dt-footer { - background: none; - margin: 10px 20px 20px 20px; - border: none; - } - .dt-footer .result { - margin: 10px 0 0 0; - } - .dt-footer .resizer { - display: none; - } - } - .select-destination-folder { - width: 500px; - margin: 30px auto 30px auto; - .dt-container { - width: 100%; - box-shadow: none; - border: none; - .dt-content { - margin-top: 20px; - } - } - } - .assets-body .header-container { - .search-box-container, .sort-container { - position: relative; - display: block; - float: left; - } - .folder-picker-container { - width: 40%; - } - .sort-container { - width: 20%; - } - .search-box-container { - width: 40%; - } - .rm-folder-picker-refresh-sync-container { - display: flex; - .rm-refresh-sync-dropdown { - border-right: 1px solid #C8C8C8; - .collapsible-label { - height: 30px; - span { - margin: 0; - } - svg { - fill: #777; - width: 22px; - height: auto; - } - } - } - } - } - .breadcrumbs-container { - position: absolute; - width: 100%; - font-size: 0; - line-height: 0; - text-transform: uppercase; - font-weight: bold; - left: 0; - bottom: 0; - - > div { - height: 20px; - line-height: 20px; - background: 0; - color: #1e88c3; - font-weight: bold; - text-transform: uppercase; - cursor: pointer; - - &:first-child:not(:last-child) { - padding-right: 16px; - position: relative; - display: inline-block; - } - - &:first-child:last-child { - width: 150px; - margin-left: 0; - } - - &:not(:first-child):not(:last-child) { - padding-right: 10px; - position: relative; - margin-left: 25px; - box-sizing: border-box; - } - - &:not(:last-child)::after { - content: ''; - position: absolute; - right: -15px; - top: 0; - width: 20px; - height: 32px; - background-image: url(/DesktopModules/ResourceManager/Images/arrow_forward.svg); - background-repeat: no-repeat; - background-position: center; - } - - &:last-child { - color: #1e88c3; - font-family: proxima_nova,Arial; - text-decoration: none; - font-size: 14px; - padding-right: 10px; - position: relative; - margin-left: 25px; - cursor: default; - } - } - - div { - display: inline-block; - height: 32px; - line-height: 32px; - font-family: proxima_nova,Arial; - text-decoration: none; - font-size: 14px; - max-width: 20%; - color: #4b4e4f; - - > span { - display: block; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - } - } - div.rm-field { - position: relative; - display: inline-block; - margin: 32px 0 0 0; - min-width: 325px; - vertical-align: top; - } - div.rm-field.long { - margin-right: 340px; - } - div.rm-field.right { - min-width: 325px; - } - div.rm-field.hide { - visibility: hidden; - margin: 32px 0 0 0; - } - div.versioning { - margin: 20px 20px 0 0; - } - div.versioning > input { - vertical-align: middle; - margin-right: 5px; - } - div.rm-field > label { - display: block; - margin-bottom: 5px; - } - div.rm-field > input[type="text"], div.rm-field > select, div.rm-field > textarea { - width: 100%; - box-sizing: border-box; - min-height: 34px; - border: 1px solid #7F7F7F; - border-radius: 0; - } - div.rm-field > textarea#description { - min-height: 135px; - } - div.file-upload-panel { - margin: 1px 1px 30px 1px; - - .dnn-file-upload { - width: 100%; - box-sizing: border-box; - float:none; - margin:auto; - - span { - float: none; - } - } - } - .container-main .toolbar-main { - height: 70px; - width: 860px; - background-color: #e6e6e6; - } - .container-main .filter-results { - height: 50px; - width: 860px; - padding-bottom: 0px; - } - .page-title { - font-family: Arial, Helvetica, sans-serif; - font-size: 24px; - } - div.main-container { - margin-top: 16px; - position: relative; - overflow: auto; - } - div.item-container { - width: 100%; - overflow-y: auto; - overflow-x: visible; - } - div.item-container.empty { - .rm_infinite-scroll-container { - display: none; - } - } - div.item-container.empty:not(.loading) { - background-image: url(/DesktopModules/ResourceManager/Images/folder-empty-state-asset-manager.png); - background-repeat: no-repeat; - background-position: center 120px; - min-height: 465px; - } - div.item-container.empty.rm_search:not(.loading) { - background-image: url(/DesktopModules/ResourceManager/Images/search-glass-no-results.png); - } - div.item-container > div.empty-label { - display: none; - color: #aaa; - max-width: 250px; - text-align: center; - top: 240px; - position: relative; - margin-left: auto; - margin-right: auto; - } - div.item-container.empty:not(.rm_search):not(.loading) > div.empty-label.rm-folder { - display: block; - } - div.item-container.empty.rm_search:not(.loading) > div.empty-label.rm_search { - display: block; - top: 180px; - } - div.item-container > div.empty-label > span.empty-title { - font-size: 22px; - font-weight: bold; - display: block; - margin: 10px 0; - } - div.item-container > div.empty-label > span.empty-subtitle { - font-size: 15px; - } - div.item-container.drop-target { - border: 10px #0087c6 dashed; - padding: 0 0 5px 5px; - overflow: hidden; - } - .item-container .rm-card { - position: relative; - height: 212px; - width: 100%; - padding: 20px; - bottom: 0px; - font-family: "Proxima Nova-light", HelveticaNeue-Light, Arial-light, Helvetica, sans-serif; - -webkit-box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.30); - -moz-box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.30); - box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.30); - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - background-color: #79bdd8; - color: #FFF; - font-size: 17px; - margin: 15px 0 5px 0; - float: left; - overflow: hidden; - transition: 0.2s; - box-sizing: border-box; - - &.rm-folder { - cursor: pointer; - } - } - div.item-container:not(.disabled) .rm-card:hover, div.item-container:not(.disabled) .rm-card.selected { - background-color: rgba(48, 137, 198, 1); - transition: 0.2s; - } - .item.highlight { - -webkit-animation: card-highlight 1.5s 1; - -moz-animation: card-highlight 1.5s 1; - animation: card-highlight 1.5s 1; - } - @-webkit-keyframes card-highlight { - 0% { - box-shadow: 0 0 0 0 rgba(0, 220, 0, 0); - } - 25% { - box-shadow: 0 0 5px 8px rgba(125, 226, 166, 1); - } - 50% { - box-shadow: 0 0 0 0 rgba(0, 220, 0, 0); - } - 75% { - box-shadow: 0 0 5px 8px rgba(125, 226, 166, 1); - } - 100% { - box-shadow: 0 0 0 0 rgba(0, 220, 0, 0); - } - } - @-moz-keyframes card-highlight { - 0% { - box-shadow: 0 0 0 0 rgba(0, 220, 0, 0); - } - 25% { - box-shadow: 0 0 5px 8px rgba(125, 226, 166, 1); - } - 50% { - box-shadow: 0 0 0 0 rgba(0, 220, 0, 0); - } - 75% { - box-shadow: 0 0 5px 8px rgba(125, 226, 166, 1); - } - 100% { - box-shadow: 0 0 0 0 rgba(0, 220, 0, 0); - } - } - @keyframes card-highlight { - 0% { - box-shadow: 0 0 0 0 rgba(0, 220, 0, 0); - } - 25% { - box-shadow: 0 0 5px 8px rgba(125, 226, 166, 1); - } - 50% { - box-shadow: 0 0 0 0 rgba(0, 220, 0, 0); - } - 75% { - box-shadow: 0 0 5px 8px rgba(125, 226, 166, 1); - } - 100% { - box-shadow: 0 0 0 0 rgba(0, 220, 0, 0); - } - } - .rm-card-container { - float: left; - width: 22%; - margin-right: 4%; - } - .rm-card-container:nth-of-type(4n){ - margin-right: 0; - } - .item.rm-card { - float: none; - } - .item.rm-card .card-icons { - height: 58px; - width: 53px; - position: absolute; - left: 0px; - top: 0px; - } - .item.rm-card .text-card { - position: absolute; - bottom: 22px; - width: 149px; - overflow: hidden; - word-wrap: break-word; - height: 30px; - line-height: 15px; - - p { - margin: 0; - } - } - .item.rm-card .text-card:before { - content: ""; - float: left; - width: 5px; - height: 30px; - } - .item.rm-card .text-card > *:first-child { - float: right; - width: 100%; - margin-left: -5px; - } - .item.rm-card .text-card:after { - content: "\02026"; - box-sizing: content-box; - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - float: right; - position: relative; - top: -15px; - left: 100%; - width: 1em; - margin-left: -1em; - padding-right: 5px; - text-align: right; - background-color: rgba(121, 189, 216, 1); - transition: 0.2s; - } - div.item-container:not(.disabled) .rm-card:hover .text-card:after, div.item-container:not(.disabled) .rm-card.selected .text-card:after { - background-color: rgba(48, 137, 198, 1); - transition: 0.2s; - } - .item.rm-card .text-card font.highlight { - background-color: #CCCCCC; - } - .rm-circular { - width: 100%; - height: 100%; - border-radius: 50%; - -webkit-border-radius: 50%; - -moz-border-radius: 50%; - border: 12px solid #79bdd8; - margin-right: auto; - margin-left: auto; - background-position: center center; - background-repeat: no-repeat; - background-color: #eeeeee; - box-sizing: border-box; - } - .rm-circular.rm-folder { - background-color: #9EDCEF; - } - .rm-card .image-center { - margin-right: auto; - margin-left: auto; - height: 110px; - width: 110px; - border: 2px white solid; - border-radius: 50%; - position: relative; - } - .rm-card .overlay-disabled { - height: 213px; - width: 190px; - position: absolute; - left: 0px; - top: 0px; - background-color: black; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - opacity: 0; - visibility: hidden; - -webkit-transition: visibility 0.2s linear, opacity 0.2s linear; - -moz-transition: visibility 0.2s linear, opacity 0.2s linear; - -o-transition: visibility 0.2s linear, opacity 0.2s linear; - } - div.item-container.disabled .rm-card { - cursor: auto; - } - div.item-container.disabled .rm-card .overlay-disabled { - opacity: 0.5; - visibility: visible; - } - .rm-card > div.rm-actions { - position: absolute; - right: -32px; - width: 32px; - background-color: #236F99; - top: 0; - bottom: 0; - transition: 0.2s; - - > div { - cursor: pointer; - } - } - .rm-card.selected > div.rm-actions, .rm-card:hover > div.rm-actions { - right: 0; - transition: 0.2s; - transition-delay: 0.4s; - } - .rm-card > div.unpublished { - position: absolute; - width: 32px; - height: 32px; - top: 6px; - left: 6px; - background-image: url(/DesktopModules/ResourceManager/Images/unpublished.svg); - } - .rm-card > div.rm-actions > div { - height: 32px; - background-position: center; - background-repeat: no-repeat; - position: absolute; - width: 100%; - background-size: 80%; - &.rm-edit { - top: 0; - background-image: url(/DesktopModules/ResourceManager/Images/edit.svg); - } - &.rm-link { - top: 32px; - background-image: url(/DesktopModules/ResourceManager/Images/clipboard.svg); - } - &.rm-download { - top: 96px; - background-image: url(/DesktopModules/ResourceManager/Images/download.svg); - } - &.rm-move { - top: 64px; - background-image: url(/DesktopModules/ResourceManager/Images/move.svg); - } - &.rm-delete { - background-image: url(/DesktopModules/ResourceManager/Images/delete.svg); - background-color: #195774; - bottom: 0; - } - } - .top-panel { - &.add-folder, &.manage-folder-types { - .animateHeight(970px, 0.5s); - .rm-button { - margin-bottom: 30px; - } - } - &.manage-folder-types { - h3{ - text-align: center; - } - table.folder-types{ - margin: 1em auto; - border: 1px solid gray; - th{ - text-transform: uppercase; - } - th, td { - padding: 1em 2em; - border-bottom: 1px solid gray; - button, a{ - border: none; - margin: 0; - padding: 0; - background-color: transparent; - svg{ - width: 1.5em; - height: auto; - } - } - } - } - } - } - - .folder-adding { - .folder-parent-label { - margin-right: 10px; - } - } - - .top-panel.add-folder > .folder-adding { - margin: 30px; - margin-bottom: 45px; - } - - .top-panel.add-asset { - .animateHeight(970px, 0.5s); - - .close { - float: none; - margin-bottom: 30px; - } - } - .details-panel { - border: none; - border-radius: 0; - padding: 30px; - } - div.item-details { - float: left; - margin: 0; - border-top: 2px solid #1E88C3; - border-bottom: 2px solid #1E88C3; - width: 100%; - padding: 25px 10px; - box-sizing: border-box; - overflow: hidden; - &.item-move{ - overflow: visible; - .dnn-folder-selector{ - border: 1px solid gray; - } - } - } - ul.tabControl { - background-color: #FFF; - border-radius: 0; - border: none; - border-bottom: 1px solid #ddd; - &> li { - text-transform: uppercase; - font-weight: bold; - padding: 10px 0; - margin: 0 20px; - &.selected { - border-bottom: 3px solid #1E88C3; - } - } - } - div.details-icon { - display: inline-block; - width: 50px; - height: 50px; - border-radius: 50%; - box-shadow: 0px 0px 0px 1px #79bdd8; - border: 5px solid #FFF; - background-position: center center; - background-repeat: no-repeat; - float: left; - margin: 0 15px 25px 0; - background-color: #eee; - } - div.details-icon.folder { - background-color: #9EDCEF; - background-size: 50%; - } - div.details-info { - padding-top: 12px; - position: relative; - } - div.details-field { - display: inline-block; - margin-bottom: 8px; - max-width: 200px; - overflow: hidden; - text-overflow: ellipsis; - vertical-align: top; - &:first-child { - margin-right: 16px; - padding-right: 16px; - border-right: 1px solid #c8c8c8; - } - &.rm-url { - max-width: none; - } - } - div.details-field a { - color: #0087c6; - text-decoration: none; - } - div.details-field a:hover { - color: #2fa6eb; - } - div.details-field + div.vertical-separator { - margin: 0 16px; - border-left: 1px solid #e2e2e2; - display: inline; - height: 16px; - } - div.details-field + div.line-break { - clear: right; - } - div.details-field.right { - position: absolute; - right: 0; - top: 12px; - } - span.details-label { - font-weight: bold; - margin-right: 10px; - } - span.details-label.checkbox { - vertical-align: top; - line-height: 22px; - margin-right: 27px; - color: #46292b; - } - div.file-panel { - padding: 25px; - background-color: #fff; - } - div.separator { - clear: both; - border-bottom: 1px solid #C8C8C8; - margin-bottom: 8px; - } - label { - font-weight: bold; - } - label.formRequired::after { - content: "*"; - display: inline-block; - margin: 0 0 0 5px; - color: Red; - font-size: 16px; - line-height: 1em; - font-family: proxima_nova_semibold; - } - div.cancel { - width: 50%; - float: left; - margin: 10px 0 0 0; - position: relative; - } - div.cancel > a { - display: block; - float: right; - margin-right: 5px; - } - div.close { - width: 100%; - float: left; - text-align: center; - } - div.close > a { - margin-right: auto; - margin-left: auto; - } - div.save { - width: 50%; - float: left; - margin: 10px 0 0 0; - position: relative; - } - div.details-selector { - position: relative; - &> div { - margin: auto; - content: ''; - width: 0; - height: 0; - border-style: solid; - border-width: 8px 8px 0 8px; - border-color: #3089C6 transparent transparent transparent; - position: relative; - - } - } - - .rm-clear { - clear: both - } -} - -.dnn-slide-in-out-enter { - max-height: 0; -} - -.dnn-slide-in-out-enter.dnn-slide-in-out-enter-active { - max-height: 970px; - transition: max-height 500ms ease-in; -} - -.dnn-slide-in-out-exit { - max-height: 970px; -} - -.dnn-slide-in-out-exit.dnn-slide-in-out-exit-active { - max-height: 0; - transition: max-height 300ms ease-in; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/button.less b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/button.less deleted file mode 100644 index 97193fe185a..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/button.less +++ /dev/null @@ -1,52 +0,0 @@ -@import "~@dnnsoftware/dnn-react-common/styles/index"; - -button.rm-common-button { - border: 1px solid @curiousBlue; - height: 34px; - min-width: 100px; - padding: 0 22px; - font-size: 10pt; - color: @curiousBlue; - background: @white; - border-radius: 3px; - cursor: pointer; - font-family: Helvetica, Arial, sans-serif; - &:hover { - color: @cerulean; - border-color: @cerulean; - } - &:focus{ - outline: none; - } - &:active { - color: @matisse; - border-color: @matisse; - } - &:disabled { - color: @alto; - border-color: @alto; - cursor: not-allowed; - } - - &.large{ - height: 44px; - } - - &[role=primary] { - background: @curiousBlue; - border: none; - color: @white; - - &:hover { - background: @cerulean; - } - &:active { - background: @matisse; - } - &:disabled { - color: @mountainMist; - background: @mercury; - cursor: not-allowed; - } - } -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/components.less b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/components.less deleted file mode 100644 index 522067ab022..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/components.less +++ /dev/null @@ -1,183 +0,0 @@ -.loading::after { - content: ""; - display: block; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: rgba(255,255,255,0.7) url(/DesktopModules/ResourceManager/Images/loading.gif) no-repeat center center; - z-index: 99999; -} - -.three-columns { - display: block; - width: 33%; - float: left; -} - -.dnn-dropdown { - height: 31px; - background-color: white; - - .collapsible-content { - margin: 0; - box-shadow: none; - width: 250px; - } - - ul, li { - margin: 0px; - list-style: none; - box-sizing: border-box; - } -} - -.rm-field .dnn-dropdown { - width: 100% -} - -label.rm-error { - color: red -} - -.file-upload-container { - .file-upload-panel { - position: relative; - border: 1px solid rgb(102, 102, 102); - padding: 10px; - margin-bottom: 30px; - min-height: 163px; - color: #959695; - transition: 200ms linear; - cursor: pointer; - - &:hover { - color: #FFF; - background-color: rgba(30,136,195,0.6); - } - - span { - overflow: hidden !important; - width: 140px !important; - display: block !important; - position: relative; - text-transform: none; - font-size: 14px; - padding-top: 95px; - text-align: center; - margin: 0 auto; - } - } - - .upload-file { - background-image: url(/DesktopModules/ResourceManager/Images/upload.svg); - height: 40px; - width: 40px; - display: block; - margin: 0 auto; - } - - span { - display: block; - text-align: center; - } -} - -.progresses-container { - margin: 20px 0; - max-height: 240px; - overflow-y: auto; -} - -.uploading-container { - overflow: hidden; - border-bottom: 1px solid #c8c8c8; - padding: 6px 0; - color: #0a85c3; - font-weight: bold; - font-family: proxima_nova,Arial; - font-size: 13px; - - .file-upload-thumbnail { - background: 0; - border-radius: 0; - border: 2px solid #0a85c3; - padding: 2px; - float: left; - position: relative; - height: 76px; - width: 76px; - line-height: 76px; - text-align: center; - - img { - max-height: 100%; - max-width: 100%; - } - } - .file-name-container, .progress-bar-container { - width: ~"calc(100% - 100px)"; - float: right; - } - .file-name-container { - span { - display: block; - width: 100%; - } - } - .progress-bar-container { - margin-top: 18px; - height: 5px; - background-color: #c7c7c7; - - .progress-bar { - background-color: #0a85c3; - height: 100%; - transition: 0.5s; - } - } - - &.rm-error { - color: red; - - .file-upload-thumbnail { - border: 2px solid #c8c8c8; - background-image: url(/DesktopModules/ResourceManager/Images/loader_failed.svg); - } - - .progress-bar { - background-color: red; - } - } - - &.rm-uploading { - .file-upload-thumbnail { - border: 2px solid #c8c8c8; - background: url(/DesktopModules/ResourceManager/Images/dnnanim.gif) no-repeat center; - } - } - - &.rm-stopped { - color: #777; - - .file-upload-thumbnail { - border: 2px solid #c8c8c8; - } - } -} - -.rm-error label { - color: red -} - -.dnn-switch-container { - display: inline-block; - float: none; - padding: 0; -} - -.dnn-dropdown .collapsible-label { - padding: 7px 15px; - box-sizing: border-box; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/mixins.less b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/mixins.less deleted file mode 100644 index 074cc2b804f..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/mixins.less +++ /dev/null @@ -1,25 +0,0 @@ -.border-box(){ - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -.transition(@transition){ - -moz-transition: @transition; - -webkit-transition: @transition; - transition: @transition; -} - -.animateHeight(@max-Height, @duration){ - & { - max-height: 0; - overflow: hidden; - height: 100%; - .transition(max-height @duration ease); - } - - &.rm-expanded{ - max-height: @max-Height; - } - -} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/modal.less b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/modal.less deleted file mode 100644 index e48020bd392..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/modal.less +++ /dev/null @@ -1,29 +0,0 @@ -.ReactModalPortal { - .modal-header { - background-color: #092836; - border: none; - - h3 { - color: white; - margin: 0; - } - } - - .rm-dialog-modal-label { - float: none; - width: 100%; - text-align: center; - label { - margin: 0; - } - } - - .rm-form-buttons-container { - text-align: center; - margin-top: 20px; - - .rm-common-button { - margin-left: 10px; - } - } -} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/styles.less b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/styles.less deleted file mode 100644 index b813c111dc5..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/styles.less +++ /dev/null @@ -1,9 +0,0 @@ -@import "mixins.less"; - -.rm-container { - @import "Assets.less"; - @import "components.less"; -} - -@import "modal.less"; -@import "button.less"; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/main.jsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/main.jsx deleted file mode 100644 index 24fd667c86c..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/main.jsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from "react"; -import { render } from "react-dom"; -import { Provider } from "react-redux"; -import configureStore from "./store/configureStore"; -import resourceManager from "./globals/resourceManager"; -import App from "./components/App"; - -import "fetch-ie8"; -import "es6-shim"; - -const store = configureStore(); -resourceManager.dispatch = store.dispatch; -resourceManager.render = function (appContainer) { - render( - - - , - appContainer - ); -}; - diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/AddFolderPanel.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/AddFolderPanel.js deleted file mode 100644 index 26c199c1867..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/AddFolderPanel.js +++ /dev/null @@ -1,44 +0,0 @@ -import addFolderPanelActionsTypes from "../action types/addFolderPanelActionsTypes"; -import folderPanelActionsTypes from "../action types/folderPanelActionsTypes"; - -const initialState = { - expanded: false -}; - -export default function addFolderPanelReducer(state = initialState, action) { - const data = action.data; - switch (action.type) { - case addFolderPanelActionsTypes.SHOW_ADD_FOLDER_PANEL: - return { ...state, expanded: true }; - case addFolderPanelActionsTypes.FOLDER_CREATED: - return { ...state, newFolderId: data.FolderID, expanded: false }; - case folderPanelActionsTypes.CLOSE_TOP_PANELS: - case addFolderPanelActionsTypes.HIDE_ADD_FOLDER_PANEL: { - let formData = { - name: "", - folderType: state.defaultFolderType - }; - let res = { ...state, formData, expanded: false, newFolderId: null }; - delete res.validationErrors; - - return res; - } - case addFolderPanelActionsTypes.FOLDER_MAPPINGS_LOADED: { - let defaultFolderType = data && data[0] ? data[0].FolderMappingID : null; - let formData = { ...state.formData, folderType: defaultFolderType }; - return { ...state, formData, folderMappings: data, defaultFolderType }; - } - case addFolderPanelActionsTypes.CHANGE_NAME: { - let formData = { ...state.formData, name: data }; - return { ...state, formData }; - } - case addFolderPanelActionsTypes.CHANGE_FOLDER_TYPE: { - let formData = { ...state.formData, folderType: data }; - return { ...state, formData }; - } - case addFolderPanelActionsTypes.SET_VALIDATION_ERRORS: - return { ...state, validationErrors: data }; - } - - return state; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/addAssetPanel.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/addAssetPanel.js deleted file mode 100644 index a515cfcb4d2..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/addAssetPanel.js +++ /dev/null @@ -1,47 +0,0 @@ -import addAssetPanelActionsTypes from "../action types/addAssetPanelActionsTypes"; -import folderPanelActionsTypes from "../action types/folderPanelActionsTypes"; - -const initialState = { - expanded: false, - progress: {}, - uploadedFiles: [] -}; - -function mutateFileProgress(progress, fileProgress) { - return { ...progress, [fileProgress.fileName]: fileProgress }; -} - -export default function addFolderPanelReducer(state = initialState, action) { - const data = action.data; - switch (action.type) { - case addAssetPanelActionsTypes.SHOW_ADD_ASSET_PANEL: - return { ...state, expanded: true }; - case folderPanelActionsTypes.CLOSE_TOP_PANELS: - case addAssetPanelActionsTypes.HIDE_ADD_ASSET_PANEL: { - return { ...state, expanded: false }; - } - case addAssetPanelActionsTypes.RESET_PANEL: - return { ...state, error: null, progress: {}, uploadedFiles: [] }; - case addAssetPanelActionsTypes.ASSET_ADDED: { - let uploadedFiles = [ ...state.uploadedFiles, data ]; - let fileProgress = { ...state.progress[data.fileName], completed: true, path: data.path, fileIconUrl: data.fileIconUrl }; - return { ...state, uploadedFiles, progress: mutateFileProgress(state.progress, fileProgress) }; - } - case addAssetPanelActionsTypes.ASSET_ADDED_ERROR: { - const fileProgress = { ...state.progress[data.fileName], fileName: data.fileName, error: data.message}; - return { ...state, progress: mutateFileProgress(state.progress, fileProgress) }; - } - case addAssetPanelActionsTypes.UPDATE_PROGRESS: - return { ...state, progress: mutateFileProgress(state.progress, data) }; - case addAssetPanelActionsTypes.FILE_ALREADY_EXIST: { - const fileProgress = { ...state.progress[data.fileName], path: data.path, fileIconUrl: data.fileIconUrl, percent: 0, alreadyExists: true }; - return { ...state, progress: mutateFileProgress(state.progress, fileProgress) }; - } - case addAssetPanelActionsTypes.STOP_UPLOAD: { - const fileProgress = { ...state.progress[data], alreadyExists:false, stopped: true }; - return { ...state, progress: mutateFileProgress(state.progress, fileProgress) }; - } - } - - return state; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/breadcrumbs.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/breadcrumbs.js deleted file mode 100644 index a78ef40d5d7..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/breadcrumbs.js +++ /dev/null @@ -1,50 +0,0 @@ -import globalActionsTypes from "../action types/globalActionsTypes"; -import folderPanelActionsTypes from "../action types/folderPanelActionsTypes"; - -const initialState = { - breadcrumbs: [] -}; - -export default function breadcrumbsReducer(state = initialState, action) { - const data = action.data; - switch (action.type) { - case globalActionsTypes.MODULE_PARAMETERS_LOADED : { - const {openFolderId} = data; - let breadcrumbs = initialState.breadcrumbs; - if (openFolderId) { - breadcrumbs = [{folderId: data.homeFolderId}]; - } - - return { ...state, breadcrumbs }; - } - case folderPanelActionsTypes.CONTENT_LOADED : { - let found = false; - const { folderId, folderName, folderPath, folderParentId } = data.folder; - let folderLoaded = { folderId, folderName: !folderName && !folderPath ? "Site Root" : folderName }; - let breadcrumbs = state.breadcrumbs.slice(); - - for (let i = 0; i < breadcrumbs.length; i++) { - let breadcrumb = breadcrumbs[i]; - if (breadcrumb.folderId === folderId) { - breadcrumbs = breadcrumbs.slice(0, i); - found = true; - break; - } - else if (breadcrumb.folderId === folderParentId) { - breadcrumbs = breadcrumbs.slice(0, i+1); - found = true; - break; - } - } - - if (!found) { - breadcrumbs = breadcrumbs.slice(0, 1); - } - - breadcrumbs.push(folderLoaded); - return { ...state, breadcrumbs }; - } - } - - return state; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/dialogModal.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/dialogModal.js deleted file mode 100644 index 7b2b4a81c73..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/dialogModal.js +++ /dev/null @@ -1,23 +0,0 @@ -import dialogModalActionsTypes from "../action types/dialogModalActionsTypes"; -import folderPanelActionsTypes from "../action types/folderPanelActionsTypes"; - -export default function dialogModalReducer(state = {}, action) { - const data = action.data; - - switch (action.type) { - case dialogModalActionsTypes.OPEN_DIALOG_MODAL : { - return Object.assign({}, state, data); - } - case dialogModalActionsTypes.CLOSE_DIALOG_MODAL : - case folderPanelActionsTypes.FOLDER_DELETED : - case folderPanelActionsTypes.DELETE_FOLDER_ERROR : { - let res = { ...state }; - delete res.dialogMessage; - delete res.yesFunction; - delete res.noFunction; - return res; - } - } - - return state; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/folderPanel.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/folderPanel.js deleted file mode 100644 index e42b98f475a..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/folderPanel.js +++ /dev/null @@ -1,58 +0,0 @@ -import globalActionsTypes from "../action types/globalActionsTypes"; -import folderPanelActionsTypes from "../action types/folderPanelActionsTypes"; -import itemDetailsActionsTypes from "../action types/itemDetailsActionsTypes"; - -const initialState = { - loadedItems: 0, - numItems: 0, - sorting: "", - hasAddPermission: false -}; - -export default function folderPanelReducer(state = initialState, action) { - const data = action.data; - switch (action.type) { - case globalActionsTypes.MODULE_PARAMETERS_LOADED : { - return { ...state, homeFolderId: data.homeFolderId, currentFolderId: data.openFolderId || data.homeFolderId, - numItems: data.numItems, itemWidth: data.itemWidth, sortOptions: data.sortingOptions, sorting: data.sorting }; - } - case folderPanelActionsTypes.SET_LOADING : { - return { ...state, loading: data}; - } - case folderPanelActionsTypes.FILES_SEARCHED : { - let res = Object.assign({}, state, data); - delete res.newItem; - return { ...res, loadedItems: data.items.length }; - } - case folderPanelActionsTypes.CONTENT_LOADED : { - let res = Object.assign({}, state, data); - delete res.newItem; - delete res.search; - const {folder, items, hasAddPermission} = data; - const currentFolderName = !folder.folderName && !folder.folderPath ? "Root" : folder.folderName; - return { ...res, currentFolderId: folder.folderId, currentFolderName, loadedItems: items.length, hasAddPermission }; - } - case folderPanelActionsTypes.MORE_CONTENT_LOADED: { - let items = state.items.slice(); - items = items.concat(data.items); - return { ...state, items, loadedItems: items.length, hasAddPermission: data.hasAddPermission }; - } - case folderPanelActionsTypes.CHANGE_SEARCH: { - return { ...state, search: data }; - } - case itemDetailsActionsTypes.ITEM_SAVED : { - let itemUpdated = data; - let items = state.items.slice(); - let updatedItemIndex = items.findIndex(x => x.isFolder === itemUpdated.isFolder && x.itemId === itemUpdated.itemId); - - items[updatedItemIndex] = { ...items[updatedItemIndex], itemName: itemUpdated.itemName }; - - return { ...state, items }; - } - case folderPanelActionsTypes.CHANGE_SORTING : { - return { ...state, sorting: data }; - } - } - - return state; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/infiniteScroll.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/infiniteScroll.js deleted file mode 100644 index 0261e045f83..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/infiniteScroll.js +++ /dev/null @@ -1,22 +0,0 @@ -import infiniteScrollActionsTypes from "../action types/infiniteScrollActionsTypes"; -import folderPanelActionsTypes from "../action types/folderPanelActionsTypes"; - -const initialState = { - maxScrollTop: 0 -}; - -export default function dialogModalReducer(state = initialState, action) { - const data = action.data; - - switch (action.type) { - case infiniteScrollActionsTypes.SET_MAX_SCROLL_TOP : { - return { ...state, maxScrollTop: data}; - } - case folderPanelActionsTypes.CONTENT_LOADED : - case folderPanelActionsTypes.FILES_SEARCHED : { - return { ...state, maxScrollTop: 0 }; - } - } - - return state; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/itemDetails.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/itemDetails.js deleted file mode 100644 index f9be76284df..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/itemDetails.js +++ /dev/null @@ -1,51 +0,0 @@ -import itemDetailsActionsTypes from "../action types/itemDetailsActionsTypes"; - -const initialState = { - maxScrollTop: 0 -}; - -export default function itemDetailsReducer(state = initialState, action) { - const data = action.data; - - switch (action.type) { - case itemDetailsActionsTypes.EDIT_ITEM: { - return { ...state, itemEditing: data }; - } - case itemDetailsActionsTypes.MOVE_ITEM: { - return { ...state, itemMoving: data }; - } - case itemDetailsActionsTypes.CHANGE_NAME: { - let itemEditing = { ...state.itemEditing, fileName: data, folderName: data}; - return { ...state, itemEditing }; - } - case itemDetailsActionsTypes.CHANGE_TITLE: { - let itemEditing = { ...state.itemEditing, title: data }; - return { ...state, itemEditing }; - } - case itemDetailsActionsTypes.CHANGE_DESCRIPTION: { - let itemEditing = { ...state.itemEditing, description: data }; - return { ...state, itemEditing }; - } - case itemDetailsActionsTypes.CHANGE_PERMISSIONS: { - let itemEditing = { ...state.itemEditing, permissions: data }; - return { ...state, itemEditing }; - } - case itemDetailsActionsTypes.SET_VALIDATION_ERRORS: { - return { ...state, validationErrors: data }; - } - case itemDetailsActionsTypes.ITEM_SAVED : - case itemDetailsActionsTypes.CANCEL_EDIT_ITEM: { - let res = { ...state }; - delete res.itemEditing; - return res; - } - case itemDetailsActionsTypes.ITEM_MOVED : - case itemDetailsActionsTypes.CANCEL_MOVE_ITEM : { - let res = { ...state }; - delete res.itemMoving; - return res; - } - } - - return state; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/manageFolderTypesPanel.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/manageFolderTypesPanel.js deleted file mode 100644 index 3e90e5c347d..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/manageFolderTypesPanel.js +++ /dev/null @@ -1,20 +0,0 @@ -import manageFolderTypesPanelActionTypes from "../action types/manageFolderTypesPanelActionsTypes"; -import folderPanelActionTypes from "../action types/folderPanelActionsTypes"; - -const initialState = { - expanded: false -}; - -export default function manageFolderTypesPanelReducer(state = initialState, action) { - switch (action.type) { - case manageFolderTypesPanelActionTypes.SHOW_MANAGE_FOLDER_TYPES_PANEL: - return { ...state, expanded: true }; - case folderPanelActionTypes.CLOSE_TOP_PANELS: - case manageFolderTypesPanelActionTypes.HIDE_MANAGE_FOLDER_TYPES_PANEL: - return { ...state, expanded: false }; - case manageFolderTypesPanelActionTypes.ADD_FOLDER_TYPE_URL_LOADED: - return { ...state, addFolderTypeUrl: action.data }; - } - - return state; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/messageModal.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/messageModal.js deleted file mode 100644 index 6f0fb9296a4..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/messageModal.js +++ /dev/null @@ -1,34 +0,0 @@ -import messageModalActionsTypes from "../action types/messageModalActionsTypes"; -import folderPanelActionsTypes from "../action types/folderPanelActionsTypes"; -import itemDetailsActionsTypes from "../action types/itemDetailsActionsTypes"; -import addFolderPanelActionsTypes from "../action types/addFolderPanelActionsTypes"; -import localizeService from "../services/localizeService"; - -export default function messageModalReducer(state = {}, action) { - const data = action.data; - - switch (action.type) { - case messageModalActionsTypes.CLOSE_MESSAGE_MODAL : { - let res = { ...state }; - delete res.infoMessage; - delete res.errorMessage; - return res; - } - case itemDetailsActionsTypes.EDIT_ITEM_ERROR : - case itemDetailsActionsTypes.SAVE_ITEM_ERROR : - case folderPanelActionsTypes.DELETE_FILE_ERROR: - case folderPanelActionsTypes.DELETE_FOLDER_ERROR: - case folderPanelActionsTypes.LOAD_CONTENT_ERROR : - case addFolderPanelActionsTypes.ADD_FOLDER_ERROR: { - return { ...state, infoMessage: data}; - } - case itemDetailsActionsTypes.ITEM_SAVED : { - return { ...state, infoMessage: localizeService.getString("ItemSavedMessage") }; - } - case folderPanelActionsTypes.URL_COPIED_TO_CLIPBOARD : { - return { ...state, infoMessage: localizeService.getString("UrlCopiedMessage") }; - } - } - - return state; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/module.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/module.js deleted file mode 100644 index 078b81b3f8a..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/module.js +++ /dev/null @@ -1,20 +0,0 @@ -import globalActionsTypes from "../action types/globalActionsTypes"; - -const initialState = { - isEditMode: false, - moduleId: -1, - moduleName: "", - tabId: -1, - portalId: -1, - isAdmin: false -}; - -export default function moduleReducer(state = initialState, action) { - const data = action.data; - - switch (action.type) { - case globalActionsTypes.MODULE_PARAMETERS_LOADED: - return Object.assign({}, state, data); - } - return state; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/rootReducer.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/rootReducer.js deleted file mode 100644 index 34e49f3c7b8..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/rootReducer.js +++ /dev/null @@ -1,28 +0,0 @@ -import { combineReducers } from "redux"; -import module from "./module"; -import folderPanel from "./folderPanel"; -import breadcrumbs from "./breadcrumbs"; -import addFolderPanel from "./addFolderPanel"; -import addAssetPanel from "./addAssetPanel"; -import dialogModal from "./dialogModal"; -import infiniteScroll from "./infiniteScroll"; -import messageModal from "./messageModal"; -import itemDetails from "./itemDetails"; -import topBar from "./topBar"; -import manageFolderTypesPanel from "./manageFolderTypesPanel"; - -const rootReducer = combineReducers({ - module, - folderPanel, - breadcrumbs, - addFolderPanel, - addAssetPanel, - dialogModal, - infiniteScroll, - messageModal, - itemDetails, - topBar, - manageFolderTypesPanel, -}); - -export default rootReducer; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/topBar.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/topBar.js deleted file mode 100644 index 8ba386dcec3..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/reducers/topBar.js +++ /dev/null @@ -1,17 +0,0 @@ -import topBarActionsTypes from "../action types/topBarActionsTypes"; -import folderPanelActionsTypes from "../action types/folderPanelActionsTypes"; - -export default function topBarReducer(state = {}, action) { - const data = action.data; - - switch (action.type) { - case topBarActionsTypes.CHANGE_SEARCH_FIELD: { - return { ...state, search: data }; - } - case folderPanelActionsTypes.CONTENT_LOADED: { - return { ...state, search: undefined }; - } - } - - return state; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/services/internalService.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/services/internalService.js deleted file mode 100644 index f08c1094e3b..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/services/internalService.js +++ /dev/null @@ -1,28 +0,0 @@ -import api from "../globals/api"; - -const API_PATH = "InternalServices/API/"; -const GET_FOLDERS_ENDPOINT = API_PATH + "ItemListService/GetFolders"; -const SEARCH_FOLDERS_ENDPOINT = API_PATH + "ItemListService/SearchFolders"; -const GET_FOLDER_DESCENDANT_ENDPOINT = API_PATH + "ItemListService/GetFolderDescendants"; - -function getUrl(endpoint) { - return api.getServiceRoot(true) + endpoint; -} - -function getFolders() { - return api.get(getUrl(GET_FOLDERS_ENDPOINT)); -} - -function searchFolders(searchText) { - return api.get(getUrl(SEARCH_FOLDERS_ENDPOINT), {searchText}); -} - -function getFolderDescendant(parentId) { - return api.get(getUrl(GET_FOLDER_DESCENDANT_ENDPOINT), {parentId}); -} - -export default { - getFolders, - searchFolders, - getFolderDescendant -}; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/services/itemsService.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/services/itemsService.js deleted file mode 100644 index 97389ae4268..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/services/itemsService.js +++ /dev/null @@ -1,159 +0,0 @@ -import api from "../globals/api"; - -const GET_CONTENT_ENDPOINT = "Items/GetFolderContent"; -const SYNC_CONTENT_ENDPOINT = "Items/SyncFolderContent"; -const DOWNLOAD_FILE_ENDPOINT = "Items/Download"; -const FILE_DETAILS_ENDPOINT = "Items/GetFileDetails"; -const FOLDER_DETAILS_ENDPOINT = "Items/GetFolderDetails"; -const LOAD_FOLDER_MAPPINGS_ENDPOINT = "Items/GetFolderMappings"; -const ADD_FOLDER_ENDPOINT = "Items/CreateNewFolder"; -const DELETE_FOLDER_ENDPOINT = "Items/DeleteFolder"; -const DELETE_FILE_ENDPOINT = "Items/DeleteFile"; -const API_PATH = "InternalServices/API/"; -const FILE_UPLOAD = API_PATH + "FileUpload/UploadFromLocal"; -const SEARCH_FILES_ENDPOINT = "Items/Search"; -const SAVE_FILE_DETAILS_ENDPOINT = "Items/SaveFileDetails"; -const SAVE_FOLDER_DETAILS_ENDPOINT = "Items/SaveFolderDetails"; -const REMOVE_FOLDER_TYPE_ENDPOINT = "Items/RemoveFolderType"; -const ADD_FOLDER_TYPE_URL_ENDPOINT = "Items/GetAddFolderTypeUrl"; -const MOVE_FOLDER_URL_ENDPOINT = "Items/MoveFolder"; -const MOVE_FILE_URL_ENDPOINT = "Items/MoveFile"; - -function getUrl(endpoint, ignoreCurrentModuleAPI=false) { - return api.getServiceRoot(ignoreCurrentModuleAPI) + endpoint; -} - -function getContent(folderId, startIndex, numItems, sorting) { - return api.get(getUrl(GET_CONTENT_ENDPOINT), {folderId, startIndex, numItems, sorting}) - .then(response => { - return response; - }); -} - -function syncContent(folderId, numItems, sorting, recursive) { - return api.get(getUrl(SYNC_CONTENT_ENDPOINT), {folderId, numItems, sorting, recursive}) - .then(response => { - return response; - }); -} - -function getDownloadUrl(fileId) { - let {moduleId, tabId} = api.getHeadersObject(); - return getUrl(DOWNLOAD_FILE_ENDPOINT) + "?forceDownload=true&fileId=" + fileId + "&moduleId=" + moduleId + "&tabId=" + tabId; -} - -function loadFolderMappings() { - return (api.get(getUrl(LOAD_FOLDER_MAPPINGS_ENDPOINT))) - .then(response => { - return response; - }); -} - -function addFolder(data) { - return api.post(getUrl(ADD_FOLDER_ENDPOINT), data, { "Content-Type":"application/json" }); -} - -function deleteFolder(folderId) { - return api.post(getUrl(DELETE_FOLDER_ENDPOINT), {folderId}, { "Content-Type":"application/json" }); -} - -function deleteFile(fileId) { - return api.post(getUrl(DELETE_FILE_ENDPOINT), {fileId}, { "Content-Type":"application/json" }); -} - -function moveFolder(sourceFolderId, destinationFolderId) { - const data = { sourceFolderId, destinationFolderId } - return api.post(getUrl(MOVE_FOLDER_URL_ENDPOINT), data, { "Content-Type": "application/json" }); -} - -function moveFile(sourceFileId, destinationFolderId) { - const data = {sourceFileId, destinationFolderId}; - return api.post(getUrl(MOVE_FILE_URL_ENDPOINT), data, {"Content-Type": "application/json"}); -} - -function getFileDetails(fileId) { - return api.get(getUrl(FILE_DETAILS_ENDPOINT), {fileId}); -} - -function getFolderDetails(folderId) { - return api.get(getUrl(FOLDER_DETAILS_ENDPOINT), {folderId}); -} - -function uploadFile(file, folderPath, overwrite, trackProgress) { - const formData = new FormData(); - formData.append("postfile", file); - if (folderPath && typeof folderPath === "string") { - formData.append("folder", folderPath); - } - if (overwrite && typeof overwrite === "boolean") { - formData.append("overwrite", overwrite); - } - let {extensionWhitelist, validationCode} = api.getWhitelistObject(); - formData.append("filter", extensionWhitelist); - formData.append("validationCode", validationCode); - const url = getUrl(FILE_UPLOAD, true); - - return api.postFile(url, formData, trackProgress); -} - -function searchFiles(folderId, search, pageIndex, pageSize, sorting, culture) { - return api.get(getUrl(SEARCH_FILES_ENDPOINT), {folderId, search, pageIndex, pageSize, sorting, culture}) - .then(response => { - return response; - }); -} - -function getItemFullUrl(relativeUrl) { - return location.protocol + "//" + location.hostname + (location.port ? ":" + location.port : "") + relativeUrl; -} - -function getFolderUrl(folderId) { - return location.protocol + "//" + location.host + location.pathname + "?folderId=" + folderId; -} - -function getIconUrl(item) { - if (item.isFolder) { - return item.iconUrl; - } else { - return !item.thumbnailAvailable ? item.iconUrl : item.thumbnailUrl; - } -} - -function saveFileDetails(item) { - return api.post(getUrl(SAVE_FILE_DETAILS_ENDPOINT), item, { "Content-Type":"application/json" }); -} - -function saveFolderDetails(item) { - return api.post(getUrl(SAVE_FOLDER_DETAILS_ENDPOINT), item, { "Content-Type":"application/json" }); -} - -function removeFolderType(folderMappingId) { - return api.postPrimitive(getUrl(REMOVE_FOLDER_TYPE_ENDPOINT), folderMappingId.toString()); -} - -function getAddFolderTypeUrl() { - return api.get(getUrl(ADD_FOLDER_TYPE_URL_ENDPOINT)) -} - -export default { - getContent, - syncContent, - getDownloadUrl, - loadFolderMappings, - addFolder, - deleteFolder, - deleteFile, - getFileDetails, - getFolderDetails, - uploadFile, - searchFiles, - getItemFullUrl, - getFolderUrl, - getIconUrl, - saveFileDetails, - saveFolderDetails, - removeFolderType, - getAddFolderTypeUrl, - moveFolder, - moveFile, -}; \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/services/localizeService.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/services/localizeService.js deleted file mode 100644 index a2a3db54389..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/services/localizeService.js +++ /dev/null @@ -1,19 +0,0 @@ -let localization = {}; -let initialized = false; - -function init(localizedResources) { - localization = localizedResources; - initialized = true; -} - -function getString(key) { - if (!initialized) { - throw new Error("please call init method before use this method"); - } - return localization[key] || "[" + key + "]"; -} - -export default { - init, - getString -}; diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/store/configureStore.js b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/store/configureStore.js deleted file mode 100644 index e4c7fbe3a20..00000000000 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/store/configureStore.js +++ /dev/null @@ -1,21 +0,0 @@ -import { createStore, applyMiddleware, compose } from "redux"; -import thunkMiddleware from "redux-thunk"; -import reduxImmutableStateInvariant from "redux-immutable-state-invariant"; -import rootReducer from "../reducers/rootReducer"; -import DevTools from "../containers/DevTools"; - -/* eslint-disable no-undef */ -const IS_PRODUCTION = process.env.NODE_ENV === "production"; - -export default function configureStore(initialState) { - const store = createStore( - rootReducer, - initialState, - compose( - IS_PRODUCTION ? - applyMiddleware(thunkMiddleware) : - applyMiddleware(thunkMiddleware, reduxImmutableStateInvariant()), DevTools.instrument() - ) - ); - return store; -} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/package.json b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/package.json index d3f464bc16d..caadc8c19c4 100644 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/package.json +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/package.json @@ -1,72 +1,37 @@ { - "name": "resource-library", - "version": "9.11.0", - "description": "Resource Library", + "name": "dnn-resource-manager", + "version": "9.10.2", + "description": "Resource Manager", "private": true, + "main": "dist/index.cjs.js", + "module": "dist/index.js", + "es2015": "dist/esm/index.mjs", + "es2017": "dist/esm/index.mjs", + "types": "dist/types/components.d.ts", + "collection": "dist/collection/collection-manifest.json", + "collection:main": "dist/collection/index.js", + "unpkg": "dist/dnn-resource-manager/dnn-resource-manager.esm.js", + "repository": { + "type": "git", + "url": "https://github.com/dnnsoftware/Dnn.Platform.git" + }, + "files": [ + "dist/", + "loader/" + ], "scripts": { - "build": "set NODE_ENV=production&&webpack -p", - "debug": "set NODE_ENV=debug&&webpack -p", - "webpack": "webpack-dev-server -d --port 8080 --hot --inline --content-base dist/ --history-api-fallback", - "watch": "set NODE_ENV=debug & webpack --mode=development --progress --colors --watch", - "analyze": "set NODE_ENV=production&&webpack -p --json | webpack-bundle-size-analyzer", - "lint": "eslint --fix" + "build": "stencil build --docs", + "watch": "stencil build --config stencil.dnn.config.ts --watch", + "start": "stencil build --dev --watch --serve", + "generate": "stencil generate" + }, + "dependencies": { + "@stencil/core": "^2.15.1" }, - "author": "", "license": "MIT", "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/plugin-proposal-class-properties": "^7.10.4", - "@babel/plugin-transform-arrow-functions": "^7.10.4", - "@babel/preset-env": "^7.2.0", - "@babel/preset-react": "^7.0.0", - "@dnnsoftware/dnn-react-common": "9.11.0", - "babel-eslint": "^10.1.0", - "babel-loader": "8.0.6", - "babel-plugin-transform-object-assign": "6.22.0", - "babel-plugin-transform-object-rest-spread": "6.26.0", - "babel-plugin-transform-react-remove-prop-types": "0.4.24", - "babel-polyfill": "6.26.0", - "css-loader": "2.1.1", - "eslint": "5.8.0", - "eslint-loader": "2.1.1", - "eslint-plugin-babel": "5.3.0", - "eslint-plugin-filenames": "1.3.2", - "eslint-plugin-import": "^2.24.0", - "eslint-plugin-react": "7.11.1", - "eslint-plugin-spellcheck": "0.0.11", - "prop-types": "^15.7.2", - "webpack": "4.43.0", - "webpack-bundle-size-analyzer": "3.1.0", - "webpack-cli": "3.3.11", - "webpack-dev-server": "3.11.0" - }, - "dependencies": { - "copy-to-clipboard": "^3.0.5", - "es6-shim": "0.35.6", - "fetch-ie8": "1.4.2", - "file-loader": "3.0.1", - "less": "4.1.2", - "less-loader": "5.0.0", - "lodash": "^4.17.4", - "raw-loader": "2.0.0", - "react": "^16.6.3", - "react-dom": "^16.6.3", - "react-dropzone": "6.2.4", - "react-height": "^3.0.1", - "react-hot-loader": "4.8.5", - "react-modal": "^3.5.1", - "react-motion": "^0.5.2", - "react-redux": "^5.1.1", - "react-tooltip": "^4.2.6", - "react-transition-group": "^2.4.0", - "redux": "^4.0.1", - "redux-devtools": "^3.5.0", - "redux-devtools-dock-monitor": "^1.1.3", - "redux-devtools-log-monitor": "^2.1.0", - "redux-immutable-state-invariant": "^2.1.0", - "redux-thunk": "^2.3.0", - "style-loader": "0.23.1", - "superagent": "^7.1.6", - "url-loader": "1.1.2" + "@dnncommunity/dnn-elements": "^0.15.0", + "@stencil/sass": "^1.5.2", + "@stencil/store": "^1.5.0" } } diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/readme.md new file mode 100644 index 00000000000..a9fe3b0039d --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/readme.md @@ -0,0 +1,13 @@ +![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d&style=flat-square) + +# dnn-resource-manager Web Component + +This component is made to interact with a DNN backend. + +# Stencil + +Stencil is a compiler for building fast web apps using Web Components. + +Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec. + +Stencil components are just Web Components, so they work in any major framework or with no framework at all. \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components.d.ts b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components.d.ts new file mode 100644 index 00000000000..a25c45fcc7e --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components.d.ts @@ -0,0 +1,705 @@ +/* eslint-disable */ +/* tslint:disable */ +/** + * This is an autogenerated file created by the Stencil compiler. + * It contains typing information for all components that exist in this project. + */ +import { HTMLStencilElement, JSXBase } from "@stencil/core/internal"; +import { GetFolderContentResponse, Item } from "./services/ItemsClient"; +import { FolderTreeItem } from "./services/InternalServicesClient"; +export namespace Components { + interface DnnActionCopyUrl { + "items": Item[]; + } + interface DnnActionCreateFolder { + "parentFolderId": number; + } + interface DnnActionDeleteItems { + "items": Item[]; + } + interface DnnActionDownloadItem { + "item": Item; + } + interface DnnActionEditItem { + "item": Item; + } + interface DnnActionMoveItems { + "items": Item[]; + } + interface DnnActionUnlinkItems { + "items": Item[]; + } + interface DnnActionUploadFile { + "parentFolderId": number; + } + interface DnnResourceManager { + /** + * The ID of the module. + */ + "moduleId": number; + } + interface DnnRmActionsBar { + } + interface DnnRmCreateFolder { + } + interface DnnRmDeleteItems { + /** + * The list of items to delete. + */ + "items": Item[]; + } + interface DnnRmEditFile { + /** + * The ID of the folder to edit. + */ + "fileId": number; + } + interface DnnRmEditFolder { + /** + * The ID of the folder to edit. + */ + "folderId": number; + } + interface DnnRmFileContextMenu { + /** + * The item that triggered this menu. + */ + "item": Item; + } + interface DnnRmFilesPane { + /** + * Defines how much more pixels to load under the fold. + */ + "preloadOffset": number; + } + interface DnnRmFolderContextMenu { + /** + * The item that triggered this menu. + */ + "item": Item; + } + interface DnnRmFolderList { + } + interface DnnRmFolderListItem { + /** + * If true, this node will be expanded on load. + */ + "expanded": boolean; + /** + * The basic information about the folder + */ + "folder": FolderTreeItem; + /** + * The ID of the parent folder. + */ + "parentFolderId": number; + /** + * Indicates if this item is the currently selected one. + */ + "selectedFolder": FolderTreeItem; + } + interface DnnRmFolderMappings { + } + interface DnnRmItemsCardview { + /** + * The list of current items. + */ + "currentItems": GetFolderContentResponse; + } + interface DnnRmItemsListview { + /** + * The list of current items. + */ + "currentItems": GetFolderContentResponse; + } + interface DnnRmLeftPane { + } + interface DnnRmMoveItems { + /** + * The list of items to delete. + */ + "items": Item[]; + } + interface DnnRmProgressBar { + /** + * Defines the max progress value. + */ + "max": number; + /** + * Defines the current progress value. + */ + "value": number; + } + interface DnnRmQueuedFile { + /** + * Whether to extract uploaded zip files. + */ + "extract": boolean; + /** + * The file to upload. + */ + "file": File; + /** + * Optionally limit the file types that can be uploaded. + */ + "filter": string; + /** + * The maximal allowed file upload size + */ + "maxUploadFileSize": number; + /** + * The validation code to use for uploads. + */ + "validationCode": string; + } + interface DnnRmRightPane { + } + interface DnnRmStatusBar { + } + interface DnnRmTopBar { + } + interface DnnRmUnlinkItems { + /** + * The list of items to delete. + */ + "items": Item[]; + } + interface DnnRmUploadFile { + } +} +export interface DnnActionUploadFileCustomEvent extends CustomEvent { + detail: T; + target: HTMLDnnActionUploadFileElement; +} +export interface DnnRmCreateFolderCustomEvent extends CustomEvent { + detail: T; + target: HTMLDnnRmCreateFolderElement; +} +export interface DnnRmDeleteItemsCustomEvent extends CustomEvent { + detail: T; + target: HTMLDnnRmDeleteItemsElement; +} +export interface DnnRmEditFileCustomEvent extends CustomEvent { + detail: T; + target: HTMLDnnRmEditFileElement; +} +export interface DnnRmEditFolderCustomEvent extends CustomEvent { + detail: T; + target: HTMLDnnRmEditFolderElement; +} +export interface DnnRmFolderListCustomEvent extends CustomEvent { + detail: T; + target: HTMLDnnRmFolderListElement; +} +export interface DnnRmFolderListItemCustomEvent extends CustomEvent { + detail: T; + target: HTMLDnnRmFolderListItemElement; +} +export interface DnnRmMoveItemsCustomEvent extends CustomEvent { + detail: T; + target: HTMLDnnRmMoveItemsElement; +} +export interface DnnRmUnlinkItemsCustomEvent extends CustomEvent { + detail: T; + target: HTMLDnnRmUnlinkItemsElement; +} +export interface DnnRmUploadFileCustomEvent extends CustomEvent { + detail: T; + target: HTMLDnnRmUploadFileElement; +} +declare global { + interface HTMLDnnActionCopyUrlElement extends Components.DnnActionCopyUrl, HTMLStencilElement { + } + var HTMLDnnActionCopyUrlElement: { + prototype: HTMLDnnActionCopyUrlElement; + new (): HTMLDnnActionCopyUrlElement; + }; + interface HTMLDnnActionCreateFolderElement extends Components.DnnActionCreateFolder, HTMLStencilElement { + } + var HTMLDnnActionCreateFolderElement: { + prototype: HTMLDnnActionCreateFolderElement; + new (): HTMLDnnActionCreateFolderElement; + }; + interface HTMLDnnActionDeleteItemsElement extends Components.DnnActionDeleteItems, HTMLStencilElement { + } + var HTMLDnnActionDeleteItemsElement: { + prototype: HTMLDnnActionDeleteItemsElement; + new (): HTMLDnnActionDeleteItemsElement; + }; + interface HTMLDnnActionDownloadItemElement extends Components.DnnActionDownloadItem, HTMLStencilElement { + } + var HTMLDnnActionDownloadItemElement: { + prototype: HTMLDnnActionDownloadItemElement; + new (): HTMLDnnActionDownloadItemElement; + }; + interface HTMLDnnActionEditItemElement extends Components.DnnActionEditItem, HTMLStencilElement { + } + var HTMLDnnActionEditItemElement: { + prototype: HTMLDnnActionEditItemElement; + new (): HTMLDnnActionEditItemElement; + }; + interface HTMLDnnActionMoveItemsElement extends Components.DnnActionMoveItems, HTMLStencilElement { + } + var HTMLDnnActionMoveItemsElement: { + prototype: HTMLDnnActionMoveItemsElement; + new (): HTMLDnnActionMoveItemsElement; + }; + interface HTMLDnnActionUnlinkItemsElement extends Components.DnnActionUnlinkItems, HTMLStencilElement { + } + var HTMLDnnActionUnlinkItemsElement: { + prototype: HTMLDnnActionUnlinkItemsElement; + new (): HTMLDnnActionUnlinkItemsElement; + }; + interface HTMLDnnActionUploadFileElement extends Components.DnnActionUploadFile, HTMLStencilElement { + } + var HTMLDnnActionUploadFileElement: { + prototype: HTMLDnnActionUploadFileElement; + new (): HTMLDnnActionUploadFileElement; + }; + interface HTMLDnnResourceManagerElement extends Components.DnnResourceManager, HTMLStencilElement { + } + var HTMLDnnResourceManagerElement: { + prototype: HTMLDnnResourceManagerElement; + new (): HTMLDnnResourceManagerElement; + }; + interface HTMLDnnRmActionsBarElement extends Components.DnnRmActionsBar, HTMLStencilElement { + } + var HTMLDnnRmActionsBarElement: { + prototype: HTMLDnnRmActionsBarElement; + new (): HTMLDnnRmActionsBarElement; + }; + interface HTMLDnnRmCreateFolderElement extends Components.DnnRmCreateFolder, HTMLStencilElement { + } + var HTMLDnnRmCreateFolderElement: { + prototype: HTMLDnnRmCreateFolderElement; + new (): HTMLDnnRmCreateFolderElement; + }; + interface HTMLDnnRmDeleteItemsElement extends Components.DnnRmDeleteItems, HTMLStencilElement { + } + var HTMLDnnRmDeleteItemsElement: { + prototype: HTMLDnnRmDeleteItemsElement; + new (): HTMLDnnRmDeleteItemsElement; + }; + interface HTMLDnnRmEditFileElement extends Components.DnnRmEditFile, HTMLStencilElement { + } + var HTMLDnnRmEditFileElement: { + prototype: HTMLDnnRmEditFileElement; + new (): HTMLDnnRmEditFileElement; + }; + interface HTMLDnnRmEditFolderElement extends Components.DnnRmEditFolder, HTMLStencilElement { + } + var HTMLDnnRmEditFolderElement: { + prototype: HTMLDnnRmEditFolderElement; + new (): HTMLDnnRmEditFolderElement; + }; + interface HTMLDnnRmFileContextMenuElement extends Components.DnnRmFileContextMenu, HTMLStencilElement { + } + var HTMLDnnRmFileContextMenuElement: { + prototype: HTMLDnnRmFileContextMenuElement; + new (): HTMLDnnRmFileContextMenuElement; + }; + interface HTMLDnnRmFilesPaneElement extends Components.DnnRmFilesPane, HTMLStencilElement { + } + var HTMLDnnRmFilesPaneElement: { + prototype: HTMLDnnRmFilesPaneElement; + new (): HTMLDnnRmFilesPaneElement; + }; + interface HTMLDnnRmFolderContextMenuElement extends Components.DnnRmFolderContextMenu, HTMLStencilElement { + } + var HTMLDnnRmFolderContextMenuElement: { + prototype: HTMLDnnRmFolderContextMenuElement; + new (): HTMLDnnRmFolderContextMenuElement; + }; + interface HTMLDnnRmFolderListElement extends Components.DnnRmFolderList, HTMLStencilElement { + } + var HTMLDnnRmFolderListElement: { + prototype: HTMLDnnRmFolderListElement; + new (): HTMLDnnRmFolderListElement; + }; + interface HTMLDnnRmFolderListItemElement extends Components.DnnRmFolderListItem, HTMLStencilElement { + } + var HTMLDnnRmFolderListItemElement: { + prototype: HTMLDnnRmFolderListItemElement; + new (): HTMLDnnRmFolderListItemElement; + }; + interface HTMLDnnRmFolderMappingsElement extends Components.DnnRmFolderMappings, HTMLStencilElement { + } + var HTMLDnnRmFolderMappingsElement: { + prototype: HTMLDnnRmFolderMappingsElement; + new (): HTMLDnnRmFolderMappingsElement; + }; + interface HTMLDnnRmItemsCardviewElement extends Components.DnnRmItemsCardview, HTMLStencilElement { + } + var HTMLDnnRmItemsCardviewElement: { + prototype: HTMLDnnRmItemsCardviewElement; + new (): HTMLDnnRmItemsCardviewElement; + }; + interface HTMLDnnRmItemsListviewElement extends Components.DnnRmItemsListview, HTMLStencilElement { + } + var HTMLDnnRmItemsListviewElement: { + prototype: HTMLDnnRmItemsListviewElement; + new (): HTMLDnnRmItemsListviewElement; + }; + interface HTMLDnnRmLeftPaneElement extends Components.DnnRmLeftPane, HTMLStencilElement { + } + var HTMLDnnRmLeftPaneElement: { + prototype: HTMLDnnRmLeftPaneElement; + new (): HTMLDnnRmLeftPaneElement; + }; + interface HTMLDnnRmMoveItemsElement extends Components.DnnRmMoveItems, HTMLStencilElement { + } + var HTMLDnnRmMoveItemsElement: { + prototype: HTMLDnnRmMoveItemsElement; + new (): HTMLDnnRmMoveItemsElement; + }; + interface HTMLDnnRmProgressBarElement extends Components.DnnRmProgressBar, HTMLStencilElement { + } + var HTMLDnnRmProgressBarElement: { + prototype: HTMLDnnRmProgressBarElement; + new (): HTMLDnnRmProgressBarElement; + }; + interface HTMLDnnRmQueuedFileElement extends Components.DnnRmQueuedFile, HTMLStencilElement { + } + var HTMLDnnRmQueuedFileElement: { + prototype: HTMLDnnRmQueuedFileElement; + new (): HTMLDnnRmQueuedFileElement; + }; + interface HTMLDnnRmRightPaneElement extends Components.DnnRmRightPane, HTMLStencilElement { + } + var HTMLDnnRmRightPaneElement: { + prototype: HTMLDnnRmRightPaneElement; + new (): HTMLDnnRmRightPaneElement; + }; + interface HTMLDnnRmStatusBarElement extends Components.DnnRmStatusBar, HTMLStencilElement { + } + var HTMLDnnRmStatusBarElement: { + prototype: HTMLDnnRmStatusBarElement; + new (): HTMLDnnRmStatusBarElement; + }; + interface HTMLDnnRmTopBarElement extends Components.DnnRmTopBar, HTMLStencilElement { + } + var HTMLDnnRmTopBarElement: { + prototype: HTMLDnnRmTopBarElement; + new (): HTMLDnnRmTopBarElement; + }; + interface HTMLDnnRmUnlinkItemsElement extends Components.DnnRmUnlinkItems, HTMLStencilElement { + } + var HTMLDnnRmUnlinkItemsElement: { + prototype: HTMLDnnRmUnlinkItemsElement; + new (): HTMLDnnRmUnlinkItemsElement; + }; + interface HTMLDnnRmUploadFileElement extends Components.DnnRmUploadFile, HTMLStencilElement { + } + var HTMLDnnRmUploadFileElement: { + prototype: HTMLDnnRmUploadFileElement; + new (): HTMLDnnRmUploadFileElement; + }; + interface HTMLElementTagNameMap { + "dnn-action-copy-url": HTMLDnnActionCopyUrlElement; + "dnn-action-create-folder": HTMLDnnActionCreateFolderElement; + "dnn-action-delete-items": HTMLDnnActionDeleteItemsElement; + "dnn-action-download-item": HTMLDnnActionDownloadItemElement; + "dnn-action-edit-item": HTMLDnnActionEditItemElement; + "dnn-action-move-items": HTMLDnnActionMoveItemsElement; + "dnn-action-unlink-items": HTMLDnnActionUnlinkItemsElement; + "dnn-action-upload-file": HTMLDnnActionUploadFileElement; + "dnn-resource-manager": HTMLDnnResourceManagerElement; + "dnn-rm-actions-bar": HTMLDnnRmActionsBarElement; + "dnn-rm-create-folder": HTMLDnnRmCreateFolderElement; + "dnn-rm-delete-items": HTMLDnnRmDeleteItemsElement; + "dnn-rm-edit-file": HTMLDnnRmEditFileElement; + "dnn-rm-edit-folder": HTMLDnnRmEditFolderElement; + "dnn-rm-file-context-menu": HTMLDnnRmFileContextMenuElement; + "dnn-rm-files-pane": HTMLDnnRmFilesPaneElement; + "dnn-rm-folder-context-menu": HTMLDnnRmFolderContextMenuElement; + "dnn-rm-folder-list": HTMLDnnRmFolderListElement; + "dnn-rm-folder-list-item": HTMLDnnRmFolderListItemElement; + "dnn-rm-folder-mappings": HTMLDnnRmFolderMappingsElement; + "dnn-rm-items-cardview": HTMLDnnRmItemsCardviewElement; + "dnn-rm-items-listview": HTMLDnnRmItemsListviewElement; + "dnn-rm-left-pane": HTMLDnnRmLeftPaneElement; + "dnn-rm-move-items": HTMLDnnRmMoveItemsElement; + "dnn-rm-progress-bar": HTMLDnnRmProgressBarElement; + "dnn-rm-queued-file": HTMLDnnRmQueuedFileElement; + "dnn-rm-right-pane": HTMLDnnRmRightPaneElement; + "dnn-rm-status-bar": HTMLDnnRmStatusBarElement; + "dnn-rm-top-bar": HTMLDnnRmTopBarElement; + "dnn-rm-unlink-items": HTMLDnnRmUnlinkItemsElement; + "dnn-rm-upload-file": HTMLDnnRmUploadFileElement; + } +} +declare namespace LocalJSX { + interface DnnActionCopyUrl { + "items": Item[]; + } + interface DnnActionCreateFolder { + "parentFolderId"?: number; + } + interface DnnActionDeleteItems { + "items": Item[]; + } + interface DnnActionDownloadItem { + "item": Item; + } + interface DnnActionEditItem { + "item": Item; + } + interface DnnActionMoveItems { + "items": Item[]; + } + interface DnnActionUnlinkItems { + "items": Item[]; + } + interface DnnActionUploadFile { + /** + * Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh. + */ + "onDnnRmFoldersChanged"?: (event: DnnActionUploadFileCustomEvent) => void; + "parentFolderId"?: number; + } + interface DnnResourceManager { + /** + * The ID of the module. + */ + "moduleId": number; + } + interface DnnRmActionsBar { + } + interface DnnRmCreateFolder { + /** + * Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh. + */ + "onDnnRmFoldersChanged"?: (event: DnnRmCreateFolderCustomEvent) => void; + } + interface DnnRmDeleteItems { + /** + * The list of items to delete. + */ + "items": Item[]; + /** + * Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh. + */ + "onDnnRmFoldersChanged"?: (event: DnnRmDeleteItemsCustomEvent) => void; + } + interface DnnRmEditFile { + /** + * The ID of the folder to edit. + */ + "fileId": number; + /** + * Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh. + */ + "onDnnRmFoldersChanged"?: (event: DnnRmEditFileCustomEvent) => void; + } + interface DnnRmEditFolder { + /** + * The ID of the folder to edit. + */ + "folderId": number; + /** + * Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh. + */ + "onDnnRmFoldersChanged"?: (event: DnnRmEditFolderCustomEvent) => void; + } + interface DnnRmFileContextMenu { + /** + * The item that triggered this menu. + */ + "item": Item; + } + interface DnnRmFilesPane { + /** + * Defines how much more pixels to load under the fold. + */ + "preloadOffset"?: number; + } + interface DnnRmFolderContextMenu { + /** + * The item that triggered this menu. + */ + "item": Item; + } + interface DnnRmFolderList { + /** + * Fires when a folder is picked. + */ + "onDnnRmFolderListFolderPicked"?: (event: DnnRmFolderListCustomEvent) => void; + } + interface DnnRmFolderListItem { + /** + * If true, this node will be expanded on load. + */ + "expanded"?: boolean; + /** + * The basic information about the folder + */ + "folder": FolderTreeItem; + /** + * Fires when a folder is clicked. + */ + "onDnnRmFolderListItemClicked"?: (event: DnnRmFolderListItemCustomEvent) => void; + /** + * Fires when a context menu is opened for this item. Emits the folder ID. + */ + "onDnnRmcontextMenuOpened"?: (event: DnnRmFolderListItemCustomEvent) => void; + /** + * The ID of the parent folder. + */ + "parentFolderId": number; + /** + * Indicates if this item is the currently selected one. + */ + "selectedFolder"?: FolderTreeItem; + } + interface DnnRmFolderMappings { + } + interface DnnRmItemsCardview { + /** + * The list of current items. + */ + "currentItems": GetFolderContentResponse; + } + interface DnnRmItemsListview { + /** + * The list of current items. + */ + "currentItems": GetFolderContentResponse; + } + interface DnnRmLeftPane { + } + interface DnnRmMoveItems { + /** + * The list of items to delete. + */ + "items": Item[]; + /** + * Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh. + */ + "onDnnRmFoldersChanged"?: (event: DnnRmMoveItemsCustomEvent) => void; + } + interface DnnRmProgressBar { + /** + * Defines the max progress value. + */ + "max"?: number; + /** + * Defines the current progress value. + */ + "value"?: number; + } + interface DnnRmQueuedFile { + /** + * Whether to extract uploaded zip files. + */ + "extract"?: boolean; + /** + * The file to upload. + */ + "file": File; + /** + * Optionally limit the file types that can be uploaded. + */ + "filter": string; + /** + * The maximal allowed file upload size + */ + "maxUploadFileSize": number; + /** + * The validation code to use for uploads. + */ + "validationCode": string; + } + interface DnnRmRightPane { + } + interface DnnRmStatusBar { + } + interface DnnRmTopBar { + } + interface DnnRmUnlinkItems { + /** + * The list of items to delete. + */ + "items": Item[]; + /** + * Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh. + */ + "onDnnRmFoldersChanged"?: (event: DnnRmUnlinkItemsCustomEvent) => void; + } + interface DnnRmUploadFile { + /** + * Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh. + */ + "onDnnRmFoldersChanged"?: (event: DnnRmUploadFileCustomEvent) => void; + } + interface IntrinsicElements { + "dnn-action-copy-url": DnnActionCopyUrl; + "dnn-action-create-folder": DnnActionCreateFolder; + "dnn-action-delete-items": DnnActionDeleteItems; + "dnn-action-download-item": DnnActionDownloadItem; + "dnn-action-edit-item": DnnActionEditItem; + "dnn-action-move-items": DnnActionMoveItems; + "dnn-action-unlink-items": DnnActionUnlinkItems; + "dnn-action-upload-file": DnnActionUploadFile; + "dnn-resource-manager": DnnResourceManager; + "dnn-rm-actions-bar": DnnRmActionsBar; + "dnn-rm-create-folder": DnnRmCreateFolder; + "dnn-rm-delete-items": DnnRmDeleteItems; + "dnn-rm-edit-file": DnnRmEditFile; + "dnn-rm-edit-folder": DnnRmEditFolder; + "dnn-rm-file-context-menu": DnnRmFileContextMenu; + "dnn-rm-files-pane": DnnRmFilesPane; + "dnn-rm-folder-context-menu": DnnRmFolderContextMenu; + "dnn-rm-folder-list": DnnRmFolderList; + "dnn-rm-folder-list-item": DnnRmFolderListItem; + "dnn-rm-folder-mappings": DnnRmFolderMappings; + "dnn-rm-items-cardview": DnnRmItemsCardview; + "dnn-rm-items-listview": DnnRmItemsListview; + "dnn-rm-left-pane": DnnRmLeftPane; + "dnn-rm-move-items": DnnRmMoveItems; + "dnn-rm-progress-bar": DnnRmProgressBar; + "dnn-rm-queued-file": DnnRmQueuedFile; + "dnn-rm-right-pane": DnnRmRightPane; + "dnn-rm-status-bar": DnnRmStatusBar; + "dnn-rm-top-bar": DnnRmTopBar; + "dnn-rm-unlink-items": DnnRmUnlinkItems; + "dnn-rm-upload-file": DnnRmUploadFile; + } +} +export { LocalJSX as JSX }; +declare module "@stencil/core" { + export namespace JSX { + interface IntrinsicElements { + "dnn-action-copy-url": LocalJSX.DnnActionCopyUrl & JSXBase.HTMLAttributes; + "dnn-action-create-folder": LocalJSX.DnnActionCreateFolder & JSXBase.HTMLAttributes; + "dnn-action-delete-items": LocalJSX.DnnActionDeleteItems & JSXBase.HTMLAttributes; + "dnn-action-download-item": LocalJSX.DnnActionDownloadItem & JSXBase.HTMLAttributes; + "dnn-action-edit-item": LocalJSX.DnnActionEditItem & JSXBase.HTMLAttributes; + "dnn-action-move-items": LocalJSX.DnnActionMoveItems & JSXBase.HTMLAttributes; + "dnn-action-unlink-items": LocalJSX.DnnActionUnlinkItems & JSXBase.HTMLAttributes; + "dnn-action-upload-file": LocalJSX.DnnActionUploadFile & JSXBase.HTMLAttributes; + "dnn-resource-manager": LocalJSX.DnnResourceManager & JSXBase.HTMLAttributes; + "dnn-rm-actions-bar": LocalJSX.DnnRmActionsBar & JSXBase.HTMLAttributes; + "dnn-rm-create-folder": LocalJSX.DnnRmCreateFolder & JSXBase.HTMLAttributes; + "dnn-rm-delete-items": LocalJSX.DnnRmDeleteItems & JSXBase.HTMLAttributes; + "dnn-rm-edit-file": LocalJSX.DnnRmEditFile & JSXBase.HTMLAttributes; + "dnn-rm-edit-folder": LocalJSX.DnnRmEditFolder & JSXBase.HTMLAttributes; + "dnn-rm-file-context-menu": LocalJSX.DnnRmFileContextMenu & JSXBase.HTMLAttributes; + "dnn-rm-files-pane": LocalJSX.DnnRmFilesPane & JSXBase.HTMLAttributes; + "dnn-rm-folder-context-menu": LocalJSX.DnnRmFolderContextMenu & JSXBase.HTMLAttributes; + "dnn-rm-folder-list": LocalJSX.DnnRmFolderList & JSXBase.HTMLAttributes; + "dnn-rm-folder-list-item": LocalJSX.DnnRmFolderListItem & JSXBase.HTMLAttributes; + "dnn-rm-folder-mappings": LocalJSX.DnnRmFolderMappings & JSXBase.HTMLAttributes; + "dnn-rm-items-cardview": LocalJSX.DnnRmItemsCardview & JSXBase.HTMLAttributes; + "dnn-rm-items-listview": LocalJSX.DnnRmItemsListview & JSXBase.HTMLAttributes; + "dnn-rm-left-pane": LocalJSX.DnnRmLeftPane & JSXBase.HTMLAttributes; + "dnn-rm-move-items": LocalJSX.DnnRmMoveItems & JSXBase.HTMLAttributes; + "dnn-rm-progress-bar": LocalJSX.DnnRmProgressBar & JSXBase.HTMLAttributes; + "dnn-rm-queued-file": LocalJSX.DnnRmQueuedFile & JSXBase.HTMLAttributes; + "dnn-rm-right-pane": LocalJSX.DnnRmRightPane & JSXBase.HTMLAttributes; + "dnn-rm-status-bar": LocalJSX.DnnRmStatusBar & JSXBase.HTMLAttributes; + "dnn-rm-top-bar": LocalJSX.DnnRmTopBar & JSXBase.HTMLAttributes; + "dnn-rm-unlink-items": LocalJSX.DnnRmUnlinkItems & JSXBase.HTMLAttributes; + "dnn-rm-upload-file": LocalJSX.DnnRmUploadFile & JSXBase.HTMLAttributes; + } + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-copy-url/dnn-action-copy-url.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-copy-url/dnn-action-copy-url.tsx new file mode 100644 index 00000000000..b9cec6e4bb8 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-copy-url/dnn-action-copy-url.tsx @@ -0,0 +1,29 @@ +import { Component, Host, h, Prop } from '@stencil/core'; +import { Item } from '../../../services/ItemsClient'; +import state from "../../../store/store"; + +@Component({ + tag: 'dnn-action-copy-url', + styleUrl: '../dnn-action.scss', + shadow: true, +}) +export class DnnActionCopyUrl { + + @Prop() items!: Item[]; + + private handleClick(): void { + const url = `${window.location.protocol}//${window.location.host}${this.items[0].path}`; + navigator.clipboard.writeText(url); + } + + render() { + return ( + + + + ); + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-copy-url/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-copy-url/readme.md new file mode 100644 index 00000000000..f6ccc55e243 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-copy-url/readme.md @@ -0,0 +1,32 @@ +# dnn-action-move-items + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| -------------------- | --------- | ----------- | -------- | ----------- | +| `items` _(required)_ | -- | | `Item[]` | `undefined` | + + +## Dependencies + +### Used by + + - [dnn-rm-actions-bar](../../dnn-rm-actions-bar) + - [dnn-rm-file-context-menu](../../context-menus/dnn-rm-file-context-menu) + +### Graph +```mermaid +graph TD; + dnn-rm-actions-bar --> dnn-action-copy-url + dnn-rm-file-context-menu --> dnn-action-copy-url + style dnn-action-copy-url fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-create-folder/dnn-action-create-folder.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-create-folder/dnn-action-create-folder.tsx new file mode 100644 index 00000000000..956cae8d6bd --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-create-folder/dnn-action-create-folder.tsx @@ -0,0 +1,54 @@ +import { Component, Host, h, Prop } from '@stencil/core'; +import { ItemsClient } from '../../../services/ItemsClient'; +import state from "../../../store/store"; + +@Component({ + tag: 'dnn-action-create-folder', + styleUrl: '../dnn-action.scss', + shadow: true, +}) +export class DnnActionCreateFolder { + + @Prop() parentFolderId: number; + + private readonly itemsClient: ItemsClient; + + constructor(){ + this.itemsClient = new ItemsClient(state.moduleId); + } + + private handleClick(): void { + if (this.parentFolderId){ + this.itemsClient.getFolderContent(this.parentFolderId, 0, 0) + .then(data => { + state.currentItems = data; + this.showModal(); + }) + .catch(error => alert(error)); + return; + } + + this.showModal(); + } + + private showModal(){ + const modal = document.createElement("dnn-modal"); + modal.backdropDismiss = false; + modal.showCloseButton = false; + const editor = document.createElement("dnn-rm-create-folder"); + modal.appendChild(editor); + document.body.appendChild(modal); + modal.show(); + } + + render() { + return ( + + + + ); + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-create-folder/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-create-folder/readme.md new file mode 100644 index 00000000000..46970721d7f --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-create-folder/readme.md @@ -0,0 +1,42 @@ +# dnn-action-create-folder + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ---------------- | ------------------ | ----------- | -------- | ----------- | +| `parentFolderId` | `parent-folder-id` | | `number` | `undefined` | + + +## Dependencies + +### Used by + + - [dnn-rm-actions-bar](../../dnn-rm-actions-bar) + - [dnn-rm-folder-context-menu](../../context-menus/dnn-rm-folder-context-menu) + +### Depends on + +- dnn-modal +- [dnn-rm-create-folder](../../dnn-rm-create-folder) + +### Graph +```mermaid +graph TD; + dnn-action-create-folder --> dnn-modal + dnn-action-create-folder --> dnn-rm-create-folder + dnn-rm-create-folder --> dnn-button + dnn-button --> dnn-modal + dnn-button --> dnn-button + dnn-rm-actions-bar --> dnn-action-create-folder + dnn-rm-folder-context-menu --> dnn-action-create-folder + style dnn-action-create-folder fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-delete-items/dnn-action-delete-items.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-delete-items/dnn-action-delete-items.tsx new file mode 100644 index 00000000000..a9ea5e89451 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-delete-items/dnn-action-delete-items.tsx @@ -0,0 +1,39 @@ +import { Component, Host, h, Prop } from '@stencil/core'; +import { Item } from '../../../services/ItemsClient'; +import state from "../../../store/store"; + +@Component({ + tag: 'dnn-action-delete-items', + styleUrl: '../dnn-action.scss', + shadow: true, +}) +export class DnnActionDeleteItems { + + @Prop() items!: Item[]; + + private handleClick(): void { + this.showModal(); + } + + private showModal(){ + const modal = document.createElement("dnn-modal"); + modal.backdropDismiss = false; + modal.showCloseButton = false; + const editor = document.createElement("dnn-rm-delete-items") as HTMLDnnRmDeleteItemsElement; + editor.items = this.items; + modal.appendChild(editor); + document.body.appendChild(modal); + modal.show(); + } + + render() { + return ( + + + + ); + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-delete-items/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-delete-items/readme.md new file mode 100644 index 00000000000..477699e37ca --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-delete-items/readme.md @@ -0,0 +1,45 @@ +# dnn-action-move-items + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| -------------------- | --------- | ----------- | -------- | ----------- | +| `items` _(required)_ | -- | | `Item[]` | `undefined` | + + +## Dependencies + +### Used by + + - [dnn-rm-actions-bar](../../dnn-rm-actions-bar) + - [dnn-rm-file-context-menu](../../context-menus/dnn-rm-file-context-menu) + - [dnn-rm-folder-context-menu](../../context-menus/dnn-rm-folder-context-menu) + +### Depends on + +- dnn-modal +- [dnn-rm-delete-items](../../dnn-rm-delete-items) + +### Graph +```mermaid +graph TD; + dnn-action-delete-items --> dnn-modal + dnn-action-delete-items --> dnn-rm-delete-items + dnn-rm-delete-items --> dnn-rm-progress-bar + dnn-rm-delete-items --> dnn-button + dnn-button --> dnn-modal + dnn-button --> dnn-button + dnn-rm-actions-bar --> dnn-action-delete-items + dnn-rm-file-context-menu --> dnn-action-delete-items + dnn-rm-folder-context-menu --> dnn-action-delete-items + style dnn-action-delete-items fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-download-item/dnn-action-download-item.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-download-item/dnn-action-download-item.tsx new file mode 100644 index 00000000000..e77ebe2b38d --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-download-item/dnn-action-download-item.tsx @@ -0,0 +1,34 @@ +import { Component, Host, h, Prop } from '@stencil/core'; +import { Item, ItemsClient } from '../../../services/ItemsClient'; +import state from "../../../store/store"; + +@Component({ + tag: 'dnn-action-download-item', + styleUrl: '../dnn-action.scss', + shadow: true, +}) +export class DnnActionDownloadItem { + + @Prop() item!: Item; + + private itemsClient: ItemsClient; + + constructor(){ + this.itemsClient = new ItemsClient(state.moduleId); + } + + private handleClick(): void { + this.itemsClient.download(this.item.itemId, true); + } + + render() { + return ( + + + + ); + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-download-item/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-download-item/readme.md new file mode 100644 index 00000000000..963fdd64a81 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-download-item/readme.md @@ -0,0 +1,32 @@ +# dnn-action-move-items + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------------- | --------- | ----------- | ------ | ----------- | +| `item` _(required)_ | -- | | `Item` | `undefined` | + + +## Dependencies + +### Used by + + - [dnn-rm-actions-bar](../../dnn-rm-actions-bar) + - [dnn-rm-file-context-menu](../../context-menus/dnn-rm-file-context-menu) + +### Graph +```mermaid +graph TD; + dnn-rm-actions-bar --> dnn-action-download-item + dnn-rm-file-context-menu --> dnn-action-download-item + style dnn-action-download-item fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-edit-item/dnn-action-edit-item.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-edit-item/dnn-action-edit-item.tsx new file mode 100644 index 00000000000..43e22d45782 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-edit-item/dnn-action-edit-item.tsx @@ -0,0 +1,47 @@ +import { Component, Host, h, Prop } from '@stencil/core'; +import { Item } from '../../../services/ItemsClient'; +import state from "../../../store/store"; + +@Component({ + tag: 'dnn-action-edit-item', + styleUrl: '../dnn-action.scss', + shadow: true, +}) +export class DnnActionEditItem { + + @Prop() item!: Item; + + private handleClick(): void { + this.showModal(); + } + + private showModal(){ + const modal = document.createElement("dnn-modal"); + modal.backdropDismiss = false; + modal.showCloseButton = false; + // We also need to show a different model depending if we have a file or folder + if (this.item.isFolder){ + const editor = document.createElement("dnn-rm-edit-folder") as HTMLDnnRmEditFolderElement; + editor.folderId = this.item.itemId; + modal.appendChild(editor); + } + else { + const editor = document.createElement("dnn-rm-edit-file") as HTMLDnnRmEditFileElement; + editor.fileId = this.item.itemId; + modal.appendChild(editor); + } + document.body.appendChild(modal); + modal.show(); + } + + render() { + return ( + + + + ); + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-edit-item/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-edit-item/readme.md new file mode 100644 index 00000000000..4fa824cd2d7 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-edit-item/readme.md @@ -0,0 +1,56 @@ +# dnn-action-edit-item + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------------- | --------- | ----------- | ------ | ----------- | +| `item` _(required)_ | -- | | `Item` | `undefined` | + + +## Dependencies + +### Used by + + - [dnn-rm-actions-bar](../../dnn-rm-actions-bar) + - [dnn-rm-file-context-menu](../../context-menus/dnn-rm-file-context-menu) + - [dnn-rm-folder-context-menu](../../context-menus/dnn-rm-folder-context-menu) + +### Depends on + +- dnn-modal +- [dnn-rm-edit-folder](../../dnn-rm-edit-folder) +- [dnn-rm-edit-file](../../dnn-rm-edit-file) + +### Graph +```mermaid +graph TD; + dnn-action-edit-item --> dnn-modal + dnn-action-edit-item --> dnn-rm-edit-folder + dnn-action-edit-item --> dnn-rm-edit-file + dnn-rm-edit-folder --> dnn-tabs + dnn-rm-edit-folder --> dnn-tab + dnn-rm-edit-folder --> dnn-permissions-grid + dnn-rm-edit-folder --> dnn-button + dnn-permissions-grid --> dnn-checkbox + dnn-permissions-grid --> dnn-button + dnn-permissions-grid --> dnn-searchbox + dnn-permissions-grid --> dnn-collapsible + dnn-button --> dnn-modal + dnn-button --> dnn-button + dnn-rm-edit-file --> dnn-tabs + dnn-rm-edit-file --> dnn-tab + dnn-rm-edit-file --> dnn-button + dnn-rm-actions-bar --> dnn-action-edit-item + dnn-rm-file-context-menu --> dnn-action-edit-item + dnn-rm-folder-context-menu --> dnn-action-edit-item + style dnn-action-edit-item fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-move-items/dnn-action-move-items.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-move-items/dnn-action-move-items.tsx new file mode 100644 index 00000000000..f50394ab3d7 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-move-items/dnn-action-move-items.tsx @@ -0,0 +1,39 @@ +import { Component, Host, h, Prop } from '@stencil/core'; +import { Item } from '../../../services/ItemsClient'; +import state from "../../../store/store"; + +@Component({ + tag: 'dnn-action-move-items', + styleUrl: '../dnn-action.scss', + shadow: true, +}) +export class DnnActionMoveItems { + + @Prop() items!: Item[]; + + private handleClick(): void { + this.showModal(); + } + + private showModal(){ + const modal = document.createElement("dnn-modal"); + modal.backdropDismiss = false; + modal.showCloseButton = false; + const editor = document.createElement("dnn-rm-move-items") as HTMLDnnRmMoveItemsElement; + editor.items = this.items; + modal.appendChild(editor); + document.body.appendChild(modal); + modal.show(); + } + + render() { + return ( + + + + ); + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-move-items/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-move-items/readme.md new file mode 100644 index 00000000000..1e6edb0a218 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-move-items/readme.md @@ -0,0 +1,77 @@ +# dnn-action-move-items + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| -------------------- | --------- | ----------- | -------- | ----------- | +| `items` _(required)_ | -- | | `Item[]` | `undefined` | + + +## Dependencies + +### Used by + + - [dnn-rm-actions-bar](../../dnn-rm-actions-bar) + - [dnn-rm-file-context-menu](../../context-menus/dnn-rm-file-context-menu) + - [dnn-rm-folder-context-menu](../../context-menus/dnn-rm-folder-context-menu) + +### Depends on + +- dnn-modal +- [dnn-rm-move-items](../../dnn-rm-move-items) + +### Graph +```mermaid +graph TD; + dnn-action-move-items --> dnn-modal + dnn-action-move-items --> dnn-rm-move-items + dnn-rm-move-items --> dnn-rm-folder-list + dnn-rm-move-items --> dnn-rm-progress-bar + dnn-rm-move-items --> dnn-button + dnn-rm-folder-list --> dnn-rm-folder-list-item + dnn-rm-folder-list-item --> dnn-collapsible + dnn-rm-folder-list-item --> dnn-rm-folder-context-menu + dnn-rm-folder-list-item --> dnn-treeview-item + dnn-rm-folder-list-item --> dnn-rm-folder-list-item + dnn-rm-folder-context-menu --> dnn-action-move-items + dnn-action-create-folder --> dnn-modal + dnn-action-create-folder --> dnn-rm-create-folder + dnn-rm-create-folder --> dnn-button + dnn-button --> dnn-modal + dnn-button --> dnn-button + dnn-action-edit-item --> dnn-modal + dnn-action-edit-item --> dnn-rm-edit-folder + dnn-action-edit-item --> dnn-rm-edit-file + dnn-rm-edit-folder --> dnn-tabs + dnn-rm-edit-folder --> dnn-tab + dnn-rm-edit-folder --> dnn-permissions-grid + dnn-rm-edit-folder --> dnn-button + dnn-permissions-grid --> dnn-checkbox + dnn-permissions-grid --> dnn-button + dnn-permissions-grid --> dnn-searchbox + dnn-permissions-grid --> dnn-collapsible + dnn-rm-edit-file --> dnn-tabs + dnn-rm-edit-file --> dnn-tab + dnn-rm-edit-file --> dnn-button + dnn-action-delete-items --> dnn-modal + dnn-action-delete-items --> dnn-rm-delete-items + dnn-rm-delete-items --> dnn-rm-progress-bar + dnn-rm-delete-items --> dnn-button + dnn-action-unlink-items --> dnn-modal + dnn-action-unlink-items --> dnn-rm-unlink-items + dnn-rm-unlink-items --> dnn-rm-progress-bar + dnn-rm-unlink-items --> dnn-button + dnn-treeview-item --> dnn-collapsible + dnn-rm-actions-bar --> dnn-action-move-items + dnn-rm-file-context-menu --> dnn-action-move-items + style dnn-action-move-items fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-unlink-items/dnn-action-unlink-items.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-unlink-items/dnn-action-unlink-items.tsx new file mode 100644 index 00000000000..31b74111e1c --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-unlink-items/dnn-action-unlink-items.tsx @@ -0,0 +1,39 @@ +import { Component, Host, h, Prop } from '@stencil/core'; +import { Item } from '../../../services/ItemsClient'; +import state from "../../../store/store"; + +@Component({ + tag: 'dnn-action-unlink-items', + styleUrl: '../dnn-action.scss', + shadow: true, +}) +export class DnnActionUnlinkItems { + + @Prop() items!: Item[]; + + private handleClick(): void { + this.showModal(); + } + + private showModal(){ + const modal = document.createElement("dnn-modal"); + modal.backdropDismiss = false; + modal.showCloseButton = false; + const editor = document.createElement("dnn-rm-unlink-items") as HTMLDnnRmUnlinkItemsElement; + editor.items = this.items; + modal.appendChild(editor); + document.body.appendChild(modal); + modal.show(); + } + + render() { + return ( + + + + ); + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-unlink-items/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-unlink-items/readme.md new file mode 100644 index 00000000000..07d7551661d --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-unlink-items/readme.md @@ -0,0 +1,43 @@ +# dnn-action-move-items + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| -------------------- | --------- | ----------- | -------- | ----------- | +| `items` _(required)_ | -- | | `Item[]` | `undefined` | + + +## Dependencies + +### Used by + + - [dnn-rm-actions-bar](../../dnn-rm-actions-bar) + - [dnn-rm-folder-context-menu](../../context-menus/dnn-rm-folder-context-menu) + +### Depends on + +- dnn-modal +- [dnn-rm-unlink-items](../../dnn-rm-unlink-items) + +### Graph +```mermaid +graph TD; + dnn-action-unlink-items --> dnn-modal + dnn-action-unlink-items --> dnn-rm-unlink-items + dnn-rm-unlink-items --> dnn-rm-progress-bar + dnn-rm-unlink-items --> dnn-button + dnn-button --> dnn-modal + dnn-button --> dnn-button + dnn-rm-actions-bar --> dnn-action-unlink-items + dnn-rm-folder-context-menu --> dnn-action-unlink-items + style dnn-action-unlink-items fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-upload-file/dnn-action-upload-file.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-upload-file/dnn-action-upload-file.tsx new file mode 100644 index 00000000000..f61e7a77347 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-upload-file/dnn-action-upload-file.tsx @@ -0,0 +1,50 @@ +import { Component, Host, h, Event, EventEmitter, Prop } from '@stencil/core'; +import state from "../../../store/store"; + +@Component({ + tag: 'dnn-action-upload-file', + styleUrl: '../dnn-action.scss', + shadow: true, +}) +export class DnnActionUploadFile { + + @Prop() parentFolderId: number; + + /** + * Fires when there is a possibility that some folders have changed. + * Can be used to force parts of the UI to refresh. + */ + @Event() dnnRmFoldersChanged: EventEmitter; + + private handleClick(): void { + this.showModal(); + } + + private showModal(){ + const modal = document.createElement("dnn-modal"); + modal.backdropDismiss = true; + modal.showCloseButton = true; + const container = document.createElement("div"); + container.style.overflowY = "auto"; + container.style.maxHeight = "70vh"; + const editor = document.createElement("dnn-rm-upload-file"); + container.appendChild(editor); + modal.appendChild(container); + document.body.appendChild(modal); + modal.show(); + modal.addEventListener('dismissed', () => { + this.dnnRmFoldersChanged.emit(); + }); + } + + render() { + return ( + + + + ); + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-upload-file/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-upload-file/readme.md new file mode 100644 index 00000000000..28afa5c70d0 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-upload-file/readme.md @@ -0,0 +1,50 @@ +# dnn-action-upload-file + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ---------------- | ------------------ | ----------- | -------- | ----------- | +| `parentFolderId` | `parent-folder-id` | | `number` | `undefined` | + + +## Events + +| Event | Description | Type | +| --------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------- | +| `dnnRmFoldersChanged` | Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh. | `CustomEvent` | + + +## Dependencies + +### Used by + + - [dnn-rm-actions-bar](../../dnn-rm-actions-bar) + +### Depends on + +- dnn-modal +- [dnn-rm-upload-file](../../dnn-rm-upload-file) + +### Graph +```mermaid +graph TD; + dnn-action-upload-file --> dnn-modal + dnn-action-upload-file --> dnn-rm-upload-file + dnn-rm-upload-file --> dnn-checkbox + dnn-rm-upload-file --> dnn-dropzone + dnn-rm-upload-file --> dnn-rm-queued-file + dnn-rm-queued-file --> dnn-button + dnn-button --> dnn-modal + dnn-button --> dnn-button + dnn-rm-actions-bar --> dnn-action-upload-file + style dnn-action-upload-file fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action.scss b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action.scss new file mode 100644 index 00000000000..a7550b139a0 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action.scss @@ -0,0 +1,16 @@ +:host{ + display: inline-flex; +} + +button{ + cursor: pointer; + border: none; + background-color: transparent; + margin: 0; + padding: 0; + display: flex; + align-items: center; + svg{ + fill: var(--dnn-color-primary); + } +} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/context-menu.scss b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/context-menu.scss new file mode 100644 index 00000000000..2605ed33515 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/context-menu.scss @@ -0,0 +1,12 @@ +:host{ + display: flex; + flex-direction: column; +} +:host(*){ + background-color: transparent; + border: none; + padding: 0.5em 1em; + margin: 0; + border-bottom: 1px solid lightgray; + white-space: nowrap; +} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/dnn-rm-file-context-menu/dnn-rm-file-context-menu.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/dnn-rm-file-context-menu/dnn-rm-file-context-menu.tsx new file mode 100644 index 00000000000..80276d1075a --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/dnn-rm-file-context-menu/dnn-rm-file-context-menu.tsx @@ -0,0 +1,37 @@ +import { Component, Host, h, Prop } from '@stencil/core'; +import { Item } from '../../../services/ItemsClient'; +import state from '../../../store/store'; + +@Component({ + tag: 'dnn-rm-file-context-menu', + styleUrl: '../context-menu.scss', + shadow: true, +}) +export class DnnRmFileContextMenu { + + /** The item that triggered this menu. */ + @Prop() item!: Item; + + render() { + return ( + + {state.currentItems?.hasAddFilesPermission && state.currentItems.hasDeletePermission && + + } + {state.currentItems?.hasDeletePermission && + [ + + , + + , + + ] + } + {location.protocol == "https:" && + + } + + ); + } + +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/dnn-rm-file-context-menu/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/dnn-rm-file-context-menu/readme.md new file mode 100644 index 00000000000..160ad924bb3 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/dnn-rm-file-context-menu/readme.md @@ -0,0 +1,88 @@ +# dnn-rm-file-context-menu + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------------- | --------- | ---------------------------------- | ------ | ----------- | +| `item` _(required)_ | -- | The item that triggered this menu. | `Item` | `undefined` | + + +## Dependencies + +### Used by + + - [dnn-rm-items-cardview](../../dnn-rm-items-cardview) + - [dnn-rm-items-listview](../../dnn-rm-items-listview) + +### Depends on + +- [dnn-action-edit-item](../../actions/dnn-action-edit-item) +- [dnn-action-move-items](../../actions/dnn-action-move-items) +- [dnn-action-delete-items](../../actions/dnn-action-delete-items) +- [dnn-action-download-item](../../actions/dnn-action-download-item) +- [dnn-action-copy-url](../../actions/dnn-action-copy-url) + +### Graph +```mermaid +graph TD; + dnn-rm-file-context-menu --> dnn-action-edit-item + dnn-rm-file-context-menu --> dnn-action-move-items + dnn-rm-file-context-menu --> dnn-action-delete-items + dnn-rm-file-context-menu --> dnn-action-download-item + dnn-rm-file-context-menu --> dnn-action-copy-url + dnn-action-edit-item --> dnn-modal + dnn-action-edit-item --> dnn-rm-edit-folder + dnn-action-edit-item --> dnn-rm-edit-file + dnn-rm-edit-folder --> dnn-tabs + dnn-rm-edit-folder --> dnn-tab + dnn-rm-edit-folder --> dnn-permissions-grid + dnn-rm-edit-folder --> dnn-button + dnn-permissions-grid --> dnn-checkbox + dnn-permissions-grid --> dnn-button + dnn-permissions-grid --> dnn-searchbox + dnn-permissions-grid --> dnn-collapsible + dnn-button --> dnn-modal + dnn-button --> dnn-button + dnn-rm-edit-file --> dnn-tabs + dnn-rm-edit-file --> dnn-tab + dnn-rm-edit-file --> dnn-button + dnn-action-move-items --> dnn-modal + dnn-action-move-items --> dnn-rm-move-items + dnn-rm-move-items --> dnn-rm-folder-list + dnn-rm-move-items --> dnn-rm-progress-bar + dnn-rm-move-items --> dnn-button + dnn-rm-folder-list --> dnn-rm-folder-list-item + dnn-rm-folder-list-item --> dnn-collapsible + dnn-rm-folder-list-item --> dnn-rm-folder-context-menu + dnn-rm-folder-list-item --> dnn-treeview-item + dnn-rm-folder-list-item --> dnn-rm-folder-list-item + dnn-rm-folder-context-menu --> dnn-action-create-folder + dnn-rm-folder-context-menu --> dnn-action-edit-item + dnn-rm-folder-context-menu --> dnn-action-move-items + dnn-rm-folder-context-menu --> dnn-action-delete-items + dnn-rm-folder-context-menu --> dnn-action-unlink-items + dnn-action-create-folder --> dnn-modal + dnn-action-create-folder --> dnn-rm-create-folder + dnn-rm-create-folder --> dnn-button + dnn-action-delete-items --> dnn-modal + dnn-action-delete-items --> dnn-rm-delete-items + dnn-rm-delete-items --> dnn-rm-progress-bar + dnn-rm-delete-items --> dnn-button + dnn-action-unlink-items --> dnn-modal + dnn-action-unlink-items --> dnn-rm-unlink-items + dnn-rm-unlink-items --> dnn-rm-progress-bar + dnn-rm-unlink-items --> dnn-button + dnn-treeview-item --> dnn-collapsible + dnn-rm-items-cardview --> dnn-rm-file-context-menu + dnn-rm-items-listview --> dnn-rm-file-context-menu + style dnn-rm-file-context-menu fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/dnn-rm-folder-context-menu/dnn-rm-folder-context-menu.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/dnn-rm-folder-context-menu/dnn-rm-folder-context-menu.tsx new file mode 100644 index 00000000000..b7bd1b669c2 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/dnn-rm-folder-context-menu/dnn-rm-folder-context-menu.tsx @@ -0,0 +1,38 @@ +import { Component, Host, h, Prop } from '@stencil/core'; +import { Item } from '../../../services/ItemsClient'; +import state from '../../../store/store'; + +@Component({ + tag: 'dnn-rm-folder-context-menu', + styleUrl: '../context-menu.scss', + shadow: true, +}) +export class DnnRmFolderContextMenu { + + /** The item that triggered this menu. */ + @Prop() item!: Item; + + render() { + return ( + + {state.currentItems?.hasAddFoldersPermission && + + } + {state.currentItems?.hasManagePermission && + + } + {state.currentItems?.hasDeletePermission && + [ + + , + + ] + } + {state.currentItems.hasDeletePermission && this.item.unlinkAllowedStatus != "false" && + + } + + ); + } + +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/dnn-rm-folder-context-menu/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/dnn-rm-folder-context-menu/readme.md new file mode 100644 index 00000000000..6d6adb3ccad --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/context-menus/dnn-rm-folder-context-menu/readme.md @@ -0,0 +1,81 @@ +# dnn-rm-folder-context-menu + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------------- | --------- | ---------------------------------- | ------ | ----------- | +| `item` _(required)_ | -- | The item that triggered this menu. | `Item` | `undefined` | + + +## Dependencies + +### Used by + + - [dnn-rm-folder-list-item](../../dnn-rm-folder-list-item) + - [dnn-rm-items-cardview](../../dnn-rm-items-cardview) + - [dnn-rm-items-listview](../../dnn-rm-items-listview) + +### Depends on + +- [dnn-action-create-folder](../../actions/dnn-action-create-folder) +- [dnn-action-edit-item](../../actions/dnn-action-edit-item) +- [dnn-action-move-items](../../actions/dnn-action-move-items) +- [dnn-action-delete-items](../../actions/dnn-action-delete-items) +- [dnn-action-unlink-items](../../actions/dnn-action-unlink-items) + +### Graph +```mermaid +graph TD; + dnn-rm-folder-context-menu --> dnn-action-create-folder + dnn-rm-folder-context-menu --> dnn-action-edit-item + dnn-rm-folder-context-menu --> dnn-action-move-items + dnn-rm-folder-context-menu --> dnn-action-delete-items + dnn-rm-folder-context-menu --> dnn-action-unlink-items + dnn-action-create-folder --> dnn-modal + dnn-action-create-folder --> dnn-rm-create-folder + dnn-rm-create-folder --> dnn-button + dnn-button --> dnn-modal + dnn-button --> dnn-button + dnn-action-edit-item --> dnn-modal + dnn-action-edit-item --> dnn-rm-edit-folder + dnn-action-edit-item --> dnn-rm-edit-file + dnn-rm-edit-folder --> dnn-tabs + dnn-rm-edit-folder --> dnn-tab + dnn-rm-edit-folder --> dnn-permissions-grid + dnn-rm-edit-folder --> dnn-button + dnn-permissions-grid --> dnn-checkbox + dnn-permissions-grid --> dnn-button + dnn-permissions-grid --> dnn-searchbox + dnn-permissions-grid --> dnn-collapsible + dnn-rm-edit-file --> dnn-tabs + dnn-rm-edit-file --> dnn-tab + dnn-rm-edit-file --> dnn-button + dnn-action-move-items --> dnn-modal + dnn-action-move-items --> dnn-rm-move-items + dnn-rm-move-items --> dnn-rm-folder-list + dnn-rm-move-items --> dnn-rm-progress-bar + dnn-rm-move-items --> dnn-button + dnn-rm-folder-list --> dnn-rm-folder-list-item + dnn-rm-folder-list-item --> dnn-rm-folder-context-menu + dnn-treeview-item --> dnn-collapsible + dnn-action-delete-items --> dnn-modal + dnn-action-delete-items --> dnn-rm-delete-items + dnn-rm-delete-items --> dnn-rm-progress-bar + dnn-rm-delete-items --> dnn-button + dnn-action-unlink-items --> dnn-modal + dnn-action-unlink-items --> dnn-rm-unlink-items + dnn-rm-unlink-items --> dnn-rm-progress-bar + dnn-rm-unlink-items --> dnn-button + dnn-rm-items-cardview --> dnn-rm-folder-context-menu + dnn-rm-items-listview --> dnn-rm-folder-context-menu + style dnn-rm-folder-context-menu fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-resource-manager/dnn-resource-manager.scss b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-resource-manager/dnn-resource-manager.scss new file mode 100644 index 00000000000..9eb1d293f94 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-resource-manager/dnn-resource-manager.scss @@ -0,0 +1,54 @@ +:host { + display: block; + width:100%; +} + +.container{ + border: 1px solid lightgray; + display:flex; + flex-direction: column; + dnn-vertical-splitview{ + width: 100%; + height: 400px; + --left-pane-background-color: lightgray; + --right-pane-background-color: white; + .splitter{ + display: flex; + align-items: center; + box-shadow: inset 8px 0 8px -8px grey; + height: 100%; + button{ + margin: 0; + padding: 0; + width: 32px; + height: 32px; + border: 1px solid lightgray; + border-radius: 50%; + background-color: white; + box-shadow: 2px 2px 4px rgba(0,0,0,0.2); + position: relative; + left: -12px; + display: flex; + justify-content: center; + align-items: center; + cursor: pointer; + svg{ + transition: all 300ms ease-in-out; + } + &.expanded{ + svg{ + transform: rotate(180deg); + } + } + } + } + .folder-mappings{ + position: absolute; + bottom: 0; + left: 0; + border: 0; + background-color: transparent; + cursor: pointer; + } + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-resource-manager/dnn-resource-manager.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-resource-manager/dnn-resource-manager.tsx new file mode 100644 index 00000000000..29c69db03be --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-resource-manager/dnn-resource-manager.tsx @@ -0,0 +1,97 @@ +import { Component, Element, Host, h, State, Watch, Prop } from '@stencil/core'; +import state from "../../store/store"; +import { LocalizationClient } from "../../services/LocalizationClient"; +import { sortField } from '../../enums/SortField'; + +const localStorageSplitWidthKey = "dnn-resource-manager-last-folders-width"; +@Component({ + tag: 'dnn-resource-manager', + styleUrl: 'dnn-resource-manager.scss', + shadow: true, +}) +export class DnnResourceManager { + + /** The ID of the module. */ + @Prop() moduleId!: number; + + constructor() { + state.moduleId = this.moduleId; + this.localizationClient = new LocalizationClient(this.moduleId); + } + + @Element() el: HTMLDnnResourceManagerElement; + + @State() foldersExpanded = true; + + @Watch("foldersExpanded") async foldersExpandedChanged(expanded: boolean){ + const lastWidth = parseFloat(localStorage.getItem(localStorageSplitWidthKey)) || 30; + if (expanded){ + this.splitView.setSplitWidthPercentage(lastWidth); + return; + } + + this.splitView.setSplitWidthPercentage(0); + } + + + componentWillLoad() { + return new Promise((resolve, reject) => { + this.localizationClient.getResources() + .then(resources => + { + state.localization = resources; + state.sortField = sortField.itemName; + resolve(); + }) + .catch(error => { + console.error(error); + reject(); + }); + }) + } + + private splitView: HTMLDnnVerticalSplitviewElement; + private localizationClient: LocalizationClient; + private folderMappingsModal: HTMLDnnModalElement; + + private handleSplitWidthChanged(event: CustomEvent){ + if (event.detail != 0){ + localStorage.setItem(localStorageSplitWidthKey, event.detail.toString()); + } + } + + render() { + return ( + +
    + + this.splitView = el} + onWidthChanged={this.handleSplitWidthChanged} + > +
    + +
    + + + +
    + this.folderMappingsModal = el}> + + +
    +
    + ); + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-resource-manager/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-resource-manager/readme.md new file mode 100644 index 00000000000..187029a897d --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-resource-manager/readme.md @@ -0,0 +1,117 @@ +# dnn-resource-manager + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ----------------------- | ----------- | --------------------- | -------- | ----------- | +| `moduleId` _(required)_ | `module-id` | The ID of the module. | `number` | `undefined` | + + +## Dependencies + +### Depends on + +- [dnn-rm-top-bar](../dnn-rm-top-bar) +- dnn-vertical-splitview +- [dnn-rm-left-pane](../dnn-rm-left-pane) +- [dnn-rm-right-pane](../dnn-rm-right-pane) +- dnn-modal +- [dnn-rm-folder-mappings](../dnn-rm-folder-mappings) + +### Graph +```mermaid +graph TD; + dnn-resource-manager --> dnn-rm-top-bar + dnn-resource-manager --> dnn-vertical-splitview + dnn-resource-manager --> dnn-rm-left-pane + dnn-resource-manager --> dnn-rm-right-pane + dnn-resource-manager --> dnn-modal + dnn-resource-manager --> dnn-rm-folder-mappings + dnn-rm-top-bar --> dnn-searchbox + dnn-rm-left-pane --> dnn-rm-folder-list + dnn-rm-folder-list --> dnn-rm-folder-list-item + dnn-rm-folder-list-item --> dnn-collapsible + dnn-rm-folder-list-item --> dnn-rm-folder-context-menu + dnn-rm-folder-list-item --> dnn-treeview-item + dnn-rm-folder-list-item --> dnn-rm-folder-list-item + dnn-rm-folder-context-menu --> dnn-action-create-folder + dnn-rm-folder-context-menu --> dnn-action-edit-item + dnn-rm-folder-context-menu --> dnn-action-move-items + dnn-rm-folder-context-menu --> dnn-action-delete-items + dnn-rm-folder-context-menu --> dnn-action-unlink-items + dnn-action-create-folder --> dnn-modal + dnn-action-create-folder --> dnn-rm-create-folder + dnn-rm-create-folder --> dnn-button + dnn-button --> dnn-modal + dnn-button --> dnn-button + dnn-action-edit-item --> dnn-modal + dnn-action-edit-item --> dnn-rm-edit-folder + dnn-action-edit-item --> dnn-rm-edit-file + dnn-rm-edit-folder --> dnn-tabs + dnn-rm-edit-folder --> dnn-tab + dnn-rm-edit-folder --> dnn-permissions-grid + dnn-rm-edit-folder --> dnn-button + dnn-permissions-grid --> dnn-checkbox + dnn-permissions-grid --> dnn-button + dnn-permissions-grid --> dnn-searchbox + dnn-permissions-grid --> dnn-collapsible + dnn-rm-edit-file --> dnn-tabs + dnn-rm-edit-file --> dnn-tab + dnn-rm-edit-file --> dnn-button + dnn-action-move-items --> dnn-modal + dnn-action-move-items --> dnn-rm-move-items + dnn-rm-move-items --> dnn-rm-folder-list + dnn-rm-move-items --> dnn-rm-progress-bar + dnn-rm-move-items --> dnn-button + dnn-action-delete-items --> dnn-modal + dnn-action-delete-items --> dnn-rm-delete-items + dnn-rm-delete-items --> dnn-rm-progress-bar + dnn-rm-delete-items --> dnn-button + dnn-action-unlink-items --> dnn-modal + dnn-action-unlink-items --> dnn-rm-unlink-items + dnn-rm-unlink-items --> dnn-rm-progress-bar + dnn-rm-unlink-items --> dnn-button + dnn-treeview-item --> dnn-collapsible + dnn-rm-right-pane --> dnn-rm-actions-bar + dnn-rm-right-pane --> dnn-rm-files-pane + dnn-rm-right-pane --> dnn-rm-status-bar + dnn-rm-actions-bar --> dnn-vertical-overflow-menu + dnn-rm-actions-bar --> dnn-action-create-folder + dnn-rm-actions-bar --> dnn-action-upload-file + dnn-rm-actions-bar --> dnn-action-edit-item + dnn-rm-actions-bar --> dnn-action-move-items + dnn-rm-actions-bar --> dnn-action-delete-items + dnn-rm-actions-bar --> dnn-action-unlink-items + dnn-rm-actions-bar --> dnn-action-copy-url + dnn-rm-actions-bar --> dnn-action-download-item + dnn-rm-actions-bar --> dnn-collapsible + dnn-action-upload-file --> dnn-modal + dnn-action-upload-file --> dnn-rm-upload-file + dnn-rm-upload-file --> dnn-checkbox + dnn-rm-upload-file --> dnn-dropzone + dnn-rm-upload-file --> dnn-rm-queued-file + dnn-rm-queued-file --> dnn-button + dnn-rm-files-pane --> dnn-rm-items-listview + dnn-rm-files-pane --> dnn-rm-items-cardview + dnn-rm-items-listview --> dnn-rm-folder-context-menu + dnn-rm-items-listview --> dnn-rm-file-context-menu + dnn-rm-items-listview --> dnn-collapsible + dnn-rm-file-context-menu --> dnn-action-edit-item + dnn-rm-file-context-menu --> dnn-action-move-items + dnn-rm-file-context-menu --> dnn-action-delete-items + dnn-rm-file-context-menu --> dnn-action-download-item + dnn-rm-file-context-menu --> dnn-action-copy-url + dnn-rm-items-cardview --> dnn-collapsible + dnn-rm-items-cardview --> dnn-rm-folder-context-menu + dnn-rm-items-cardview --> dnn-rm-file-context-menu + style dnn-resource-manager fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-actions-bar/dnn-rm-actions-bar.scss b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-actions-bar/dnn-rm-actions-bar.scss new file mode 100644 index 00000000000..0b35b4053d3 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-actions-bar/dnn-rm-actions-bar.scss @@ -0,0 +1,59 @@ +:host { + display: flex; + align-items: center; + box-shadow: 0px 4px 8px -4px black; +} +button{ + padding:0; + margin:0; + background-color: transparent; + display: flex; + align-items: center; + border:0; + padding:0; + margin:0; + cursor: pointer; + svg{ + fill: var(--dnn-color-primary); + } +} +.right-controls{ + display: flex; + margin: 0 1em; + gap: 1em; + .sort,.sync{ + position: relative; + dnn-collapsible{ + position: absolute; + top: 100%; + right: 0; + background-color: white;; + &[expanded]{ + border: 1px solid lightgray; + box-shadow: 2px 2px 4px -2px; + } + .dropdown{ + display: flex; + flex-direction: column; + background-color: white;; + button{ + background-color:transparent; + border: none; + padding: 0.5em 1em; + margin: 0; + border-bottom: 1px solid lightgray; + white-space: nowrap; + svg{ + height: 1em; + width: 1em; + margin-right: 0.5em; + } + } + } + } + } +} +dnn-vertical-overflow-menu{ + flex-grow: 1; + margin-left:24px; +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-actions-bar/dnn-rm-actions-bar.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-actions-bar/dnn-rm-actions-bar.tsx new file mode 100644 index 00000000000..935bdbefa97 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-actions-bar/dnn-rm-actions-bar.tsx @@ -0,0 +1,220 @@ +import { Component, Host, h, State } from '@stencil/core'; +import state from '../../store/store'; +import { sortField, SortFieldInfo } from "../../enums/SortField"; +import { InternalServicesClient } from '../../services/InternalServicesClient'; +import { ItemsClient } from '../../services/ItemsClient'; +@Component({ + tag: 'dnn-rm-actions-bar', + styleUrl: 'dnn-rm-actions-bar.scss', + shadow: true, +}) +export class DnnRmActionsBar { + + @State() sortDropdownExpanded: boolean = false; + @State() syncDropdownExpanded: boolean = false; + + private internalServicesClient: InternalServicesClient; + private itemsClient: ItemsClient; + + constructor(){ + this.internalServicesClient = new InternalServicesClient(state.moduleId); + this.itemsClient = new ItemsClient(state.moduleId); + } + + private changeLayout(): void { + if (state.layout == "card"){ + state.layout = "list"; + return; + } + + state.layout = "card"; + } + + private renderSortButton(sortOption: SortFieldInfo){ + return( + + ); + } + + private renderRadioButton(checked = false){ + if (checked){ + return + } + else{ + return + } + } + + private syncFolderContent(recursive: boolean = false): void { + this.itemsClient.syncFolderContent( + state.currentItems.folder.folderId, + 0, + state.sortField, + recursive) + .then(() => { + this.getFolderContent(); + }) + .catch(error => console.log(error)); + } + + + private getFolderContent() { + this.getFolders() + .then(() => { + this.itemsClient.getFolderContent( + state.currentItems.folder.folderId, + 0, + state.pageSize, + state.sortField) + .then(data => state.currentItems = data) + .catch(error => console.error(error)); + }) + .catch(error => alert(error.Message)); + } + + private getFolders() { + return new Promise((resolve, reject) => { + this.internalServicesClient.getFolders() + .then(data => { + state.rootFolders = data; + resolve(data); + }) + .catch(reason => reject(reason)); + }); + } + + render() { + return ( + + + {state.selectedItems && state.selectedItems.length == 0 && state.currentItems && state.currentItems.hasAddFoldersPermission && + + } + {state.selectedItems && state.selectedItems.length == 0 && state.currentItems && state.currentItems.hasAddFilesPermission && + + } + {state.selectedItems.length == 1 && + // A single item is currently selected + state.currentItems.hasManagePermission && + + } + {state.selectedItems.length > 0 && + // One or multiple items are currently selected + state.currentItems.hasDeletePermission && + [ + + , + + ] + } + {state.selectedItems.length > 0 && state.selectedItems.every(i => i.isFolder && i.unlinkAllowedStatus && i.unlinkAllowedStatus != "false") && + + } + {state.selectedItems.length == 1 && !state.selectedItems[0].isFolder && location.protocol == "https:" && + + } + {state.selectedItems.length == 1 && !state.selectedItems[0].isFolder && + + } + +
    + {state.selectedItems.length > 0 && + + } +
    + + + + +
    +
    + + + + +
    + +
    +
    + ); + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-actions-bar/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-actions-bar/readme.md new file mode 100644 index 00000000000..33d497771bc --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-actions-bar/readme.md @@ -0,0 +1,95 @@ +# dnn-rm-actions-bar + + + + + + +## Dependencies + +### Used by + + - [dnn-rm-right-pane](../dnn-rm-right-pane) + +### Depends on + +- dnn-vertical-overflow-menu +- [dnn-action-create-folder](../actions/dnn-action-create-folder) +- [dnn-action-upload-file](../actions/dnn-action-upload-file) +- [dnn-action-edit-item](../actions/dnn-action-edit-item) +- [dnn-action-move-items](../actions/dnn-action-move-items) +- [dnn-action-delete-items](../actions/dnn-action-delete-items) +- [dnn-action-unlink-items](../actions/dnn-action-unlink-items) +- [dnn-action-copy-url](../actions/dnn-action-copy-url) +- [dnn-action-download-item](../actions/dnn-action-download-item) +- dnn-collapsible + +### Graph +```mermaid +graph TD; + dnn-rm-actions-bar --> dnn-vertical-overflow-menu + dnn-rm-actions-bar --> dnn-action-create-folder + dnn-rm-actions-bar --> dnn-action-upload-file + dnn-rm-actions-bar --> dnn-action-edit-item + dnn-rm-actions-bar --> dnn-action-move-items + dnn-rm-actions-bar --> dnn-action-delete-items + dnn-rm-actions-bar --> dnn-action-unlink-items + dnn-rm-actions-bar --> dnn-action-copy-url + dnn-rm-actions-bar --> dnn-action-download-item + dnn-rm-actions-bar --> dnn-collapsible + dnn-action-create-folder --> dnn-modal + dnn-action-create-folder --> dnn-rm-create-folder + dnn-rm-create-folder --> dnn-button + dnn-button --> dnn-modal + dnn-button --> dnn-button + dnn-action-upload-file --> dnn-modal + dnn-action-upload-file --> dnn-rm-upload-file + dnn-rm-upload-file --> dnn-checkbox + dnn-rm-upload-file --> dnn-dropzone + dnn-rm-upload-file --> dnn-rm-queued-file + dnn-rm-queued-file --> dnn-button + dnn-action-edit-item --> dnn-modal + dnn-action-edit-item --> dnn-rm-edit-folder + dnn-action-edit-item --> dnn-rm-edit-file + dnn-rm-edit-folder --> dnn-tabs + dnn-rm-edit-folder --> dnn-tab + dnn-rm-edit-folder --> dnn-permissions-grid + dnn-rm-edit-folder --> dnn-button + dnn-permissions-grid --> dnn-checkbox + dnn-permissions-grid --> dnn-button + dnn-permissions-grid --> dnn-searchbox + dnn-permissions-grid --> dnn-collapsible + dnn-rm-edit-file --> dnn-tabs + dnn-rm-edit-file --> dnn-tab + dnn-rm-edit-file --> dnn-button + dnn-action-move-items --> dnn-modal + dnn-action-move-items --> dnn-rm-move-items + dnn-rm-move-items --> dnn-rm-folder-list + dnn-rm-move-items --> dnn-rm-progress-bar + dnn-rm-move-items --> dnn-button + dnn-rm-folder-list --> dnn-rm-folder-list-item + dnn-rm-folder-list-item --> dnn-collapsible + dnn-rm-folder-list-item --> dnn-rm-folder-context-menu + dnn-rm-folder-list-item --> dnn-treeview-item + dnn-rm-folder-list-item --> dnn-rm-folder-list-item + dnn-rm-folder-context-menu --> dnn-action-create-folder + dnn-rm-folder-context-menu --> dnn-action-edit-item + dnn-rm-folder-context-menu --> dnn-action-move-items + dnn-rm-folder-context-menu --> dnn-action-delete-items + dnn-rm-folder-context-menu --> dnn-action-unlink-items + dnn-action-delete-items --> dnn-modal + dnn-action-delete-items --> dnn-rm-delete-items + dnn-rm-delete-items --> dnn-rm-progress-bar + dnn-rm-delete-items --> dnn-button + dnn-action-unlink-items --> dnn-modal + dnn-action-unlink-items --> dnn-rm-unlink-items + dnn-rm-unlink-items --> dnn-rm-progress-bar + dnn-rm-unlink-items --> dnn-button + dnn-treeview-item --> dnn-collapsible + dnn-rm-right-pane --> dnn-rm-actions-bar + style dnn-rm-actions-bar fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-create-folder/dnn-rm-create-folder.scss b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-create-folder/dnn-rm-create-folder.scss new file mode 100644 index 00000000000..898f5863232 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-create-folder/dnn-rm-create-folder.scss @@ -0,0 +1,19 @@ +:host { + display: block; +} + +.form{ + label{ + font-weight: bold; + margin-top: 0.5em; + } + display: grid; + grid-template-columns: 1fr; +} + +.controls{ + margin-top: 2em; + display: flex; + justify-content: flex-end; + gap: 1em; +} \ No newline at end of file diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-create-folder/dnn-rm-create-folder.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-create-folder/dnn-rm-create-folder.tsx new file mode 100644 index 00000000000..6df3fca6c12 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-create-folder/dnn-rm-create-folder.tsx @@ -0,0 +1,166 @@ +import { Component, Host, h, Element, State, Event, EventEmitter } from '@stencil/core'; +import { CreateNewFolderRequest, FolderMappingInfo, ItemsClient } from '../../services/ItemsClient'; +import state from '../../store/store'; + +@Component({ + tag: 'dnn-rm-create-folder', + styleUrl: 'dnn-rm-create-folder.scss', + shadow: true, +}) +export class DnnRmCreateFolder { + + /** + * Fires when there is a possibility that some folders have changed. + * Can be used to force parts of the UI to refresh. + */ + @Event() dnnRmFoldersChanged: EventEmitter; + + @Element() el : HTMLDnnRmCreateFolderElement + + @State() folderMappings: FolderMappingInfo[]; + + @State() newFolderRequest: CreateNewFolderRequest = { + FolderMappingId: -1, + FolderName: "", + ParentFolderId: state.currentItems.folder.folderId, + } + + private readonly itemsClient: ItemsClient; + private nameField: HTMLInputElement; + + constructor(){ + this.itemsClient = new ItemsClient(state.moduleId); + } + + componentWillLoad() { + this.itemsClient.getFolderMappings() + .then(data => { + this.folderMappings = data.sort((a, b) => a.FolderMappingID - b.FolderMappingID); + this.newFolderRequest = { + ...this.newFolderRequest, + FolderMappingId: this.folderMappings[0].FolderMappingID, + ParentFolderId: state.currentItems.folder.folderId, + }; + }) + .catch(reason => console.error(reason)); + } + + componentDidLoad() { + setTimeout(() => { + this.nameField.focus(); + }, 350); + } + + private handleCancel(): void { + const modal = this.el.parentElement as HTMLDnnModalElement; + modal.hide().then(() => { + setTimeout(() => { + document.body.removeChild(modal); + }, 300); + }); + } + + private handleTypeChanged(e: Event): void { + const select = e.target as HTMLSelectElement; + const option = select.options[select.selectedIndex] as HTMLOptionElement; + const newValue = Number.parseInt(option.value); + this.newFolderRequest = { + ...this.newFolderRequest, + FolderMappingId: newValue, + }; + } + + private handleSave(): void { + this.itemsClient.createNewFolder(this.newFolderRequest) + .then(() => { + this.dnnRmFoldersChanged.emit(); + state.currentItems = { + ...state.currentItems, + items: [], + }; + const modal = this.el.parentElement as HTMLDnnModalElement; + modal.hide().then(() => { + setTimeout(() => { + document.body.removeChild(modal); + }, 300); + }); + }) + .catch(error => alert(error)); + } + + private canChooseFolderProvider() { + return this.folderMappings && + this.folderMappings.find(f => f.FolderMappingID == state.currentItems.folder.folderMappingId).IsDefault; + } + + render() { + return ( + +

    {state.localization.AddFolder}

    +
    + {state.currentItems.folder.folderName.length > 0 &&[ + , + {state.currentItems.folder.folderName} + ]} + + this.nameField = el} + value={this.newFolderRequest.FolderName} + onInput={e => this.newFolderRequest = { + ...this.newFolderRequest, + FolderName: (e.target as HTMLInputElement).value, + }} + /> + {!this.newFolderRequest.FolderName && + {state.localization.FolderNameRequiredMessage} + } + {this.canChooseFolderProvider() && + [ + , + + ] + } + {this.canChooseFolderProvider() && this.folderMappings.find(m => m.FolderMappingID == this.newFolderRequest.FolderMappingId).IsDefault == false &&[ + , + this.newFolderRequest = { + ...this.newFolderRequest, + MappedName: (e.target as HTMLInputElement).value, + }} + /> + ]} +
    +
    + this.handleCancel()} + > + {state.localization.Cancel} + + this.handleSave()} + > + {state.localization.Save} + +
    +
    + ); + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-create-folder/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-create-folder/readme.md new file mode 100644 index 00000000000..be5ce70478c --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-create-folder/readme.md @@ -0,0 +1,37 @@ +# dnn-rm-edit-folder + + + + + + +## Events + +| Event | Description | Type | +| --------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------- | +| `dnnRmFoldersChanged` | Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh. | `CustomEvent` | + + +## Dependencies + +### Used by + + - [dnn-action-create-folder](../actions/dnn-action-create-folder) + +### Depends on + +- dnn-button + +### Graph +```mermaid +graph TD; + dnn-rm-create-folder --> dnn-button + dnn-button --> dnn-modal + dnn-button --> dnn-button + dnn-action-create-folder --> dnn-rm-create-folder + style dnn-rm-create-folder fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-delete-items/dnn-rm-delete-items.scss b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-delete-items/dnn-rm-delete-items.scss new file mode 100644 index 00000000000..ee2702875fa --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-delete-items/dnn-rm-delete-items.scss @@ -0,0 +1,42 @@ +:host { + display: block; +} +.general{ + display: flex; + .left{ + max-width: 256px; + border-right: 1px solid lightgray; + padding: 1em; + img{ + width: 100%; + } + } + .right{ + padding: 1em; + } +} + +.form{ + display: grid; + grid-template-columns: 1fr 2fr; + align-items: flex-end; + label{ + font-weight: bold; + text-align: right; + margin-right: 0.5em; + &::after{ + content: ':'; + } + align-self: flex-start; + } + input, textarea{ + margin-top: 0.5em; + } +} + +.controls{ + margin-top: 2em; + display: flex; + justify-content: flex-end; + gap: 1em; +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-delete-items/dnn-rm-delete-items.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-delete-items/dnn-rm-delete-items.tsx new file mode 100644 index 00000000000..5f62c1b59f2 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-delete-items/dnn-rm-delete-items.tsx @@ -0,0 +1,116 @@ +import { Component, Element, Event, EventEmitter, Host, h, Prop, State } from '@stencil/core'; +import { Item, ItemsClient } from '../../services/ItemsClient'; +import state from '../../store/store'; + +@Component({ + tag: 'dnn-rm-delete-items', + styleUrl: 'dnn-rm-delete-items.scss', + shadow: true, +}) +export class DnnRmDeleteItems { + + /** The list of items to delete. */ + @Prop() items!: Item[]; + + /** + * Fires when there is a possibility that some folders have changed. + * Can be used to force parts of the UI to refresh. + */ + @Event() dnnRmFoldersChanged: EventEmitter; + + @Element() el: HTMLDnnRmDeleteItemsElement; + + @State() deleting: boolean; + @State() deletedCount: number = 0; + @State() currentItemName: string; + + private itemsClient: ItemsClient; + + constructor() { + this.itemsClient = new ItemsClient(state.moduleId); + } + + private closeModal(): void { + const modal = this.el.parentElement as HTMLDnnModalElement; + modal.hide().then(() => { + setTimeout(() => { + document.body.removeChild(modal); + }, 300); + }); + } + + private handleDelete(): void { + this.deleting = true; + this.items.forEach(item => { + if (item.isFolder){ + this.itemsClient.deleteFolder({ + FolderId: item.itemId, + UnlinkAllowedStatus: false, + }) + .then(() => { + this.handleItemDeleted(item); + }) + .catch(reason => alert(reason)); + } + else { + this.itemsClient.deleteFile({ + FileId: item.itemId, + }) + .then(() => { + this.handleItemDeleted(item); + }) + .catch(reason => alert(reason)); + } + }); + } + + handleItemDeleted(item: Item) { + this.deletedCount++; + this.currentItemName = item.itemName; + if (this.deletedCount == this.items.length) { + this.deleting = false; + this.dnnRmFoldersChanged.emit(); + this.closeModal(); + } + } + + render() { + return ( + +

    {state.localization?.DeleteItems}

    +

    {state.localization?.ConfirmDeleteMessage}

    +
      + {this.items.map(item => ( +
    • {item.itemName}
    • + ))} +
    + {this.deleting && +
    +

    {state.localization?.DeletingItems} {this.deletedCount+1}/{state.selectedItems.length} ({this.currentItemName})

    + +
    + } +
    + this.closeModal()} + > + {state.localization.Cancel} + + this.handleDelete()} + disabled={this.deleting} + > + {state.localization?.Delete} + +
    +
    + ); + } +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-delete-items/readme.md b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-delete-items/readme.md new file mode 100644 index 00000000000..a3e59256013 --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-delete-items/readme.md @@ -0,0 +1,46 @@ +# dnn-rm-edit-file + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| -------------------- | --------- | ---------------------------- | -------- | ----------- | +| `items` _(required)_ | -- | The list of items to delete. | `Item[]` | `undefined` | + + +## Events + +| Event | Description | Type | +| --------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------- | +| `dnnRmFoldersChanged` | Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh. | `CustomEvent` | + + +## Dependencies + +### Used by + + - [dnn-action-delete-items](../actions/dnn-action-delete-items) + +### Depends on + +- [dnn-rm-progress-bar](../dnn-rm-progress-bar) +- dnn-button + +### Graph +```mermaid +graph TD; + dnn-rm-delete-items --> dnn-rm-progress-bar + dnn-rm-delete-items --> dnn-button + dnn-button --> dnn-modal + dnn-button --> dnn-button + dnn-action-delete-items --> dnn-rm-delete-items + style dnn-rm-delete-items fill:#f9f,stroke:#333,stroke-width:4px +``` + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-edit-file/dnn-rm-edit-file.scss b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-edit-file/dnn-rm-edit-file.scss new file mode 100644 index 00000000000..ee2702875fa --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-edit-file/dnn-rm-edit-file.scss @@ -0,0 +1,42 @@ +:host { + display: block; +} +.general{ + display: flex; + .left{ + max-width: 256px; + border-right: 1px solid lightgray; + padding: 1em; + img{ + width: 100%; + } + } + .right{ + padding: 1em; + } +} + +.form{ + display: grid; + grid-template-columns: 1fr 2fr; + align-items: flex-end; + label{ + font-weight: bold; + text-align: right; + margin-right: 0.5em; + &::after{ + content: ':'; + } + align-self: flex-start; + } + input, textarea{ + margin-top: 0.5em; + } +} + +.controls{ + margin-top: 2em; + display: flex; + justify-content: flex-end; + gap: 1em; +} diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-edit-file/dnn-rm-edit-file.tsx b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-edit-file/dnn-rm-edit-file.tsx new file mode 100644 index 00000000000..13ecabceefd --- /dev/null +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/src/components/dnn-rm-edit-file/dnn-rm-edit-file.tsx @@ -0,0 +1,146 @@ +import { Component, Element, Event, EventEmitter, Host, h, Prop, State } from '@stencil/core'; +import state from '../../store/store'; +import { FileDetails, ItemsClient, SaveFileDetailsRequest } from '../../services/ItemsClient'; + +@Component({ + tag: 'dnn-rm-edit-file', + styleUrl: 'dnn-rm-edit-file.scss', + shadow: true, +}) +export class DnnRmEditFile { + + /** The ID of the folder to edit. */ + @Prop() fileId!: number; + + /** + * Fires when there is a possibility that some folders have changed. + * Can be used to force parts of the UI to refresh. + */ + @Event() dnnRmFoldersChanged: EventEmitter; + + @Element() el: HTMLDnnRmEditFolderElement; + @State() fileDetails: FileDetails; + + private itemsClient: ItemsClient; + + constructor() { + this.itemsClient = new ItemsClient(state.moduleId); + } + + componentWillLoad(){ + this.itemsClient.getFileDetails(this.fileId) + .then(fileDetails => { + this.fileDetails = fileDetails; + }) + .catch(reason => alert(reason)); + } + + private closeModal(): void { + const modal = this.el.parentElement as HTMLDnnModalElement; + modal.hide().then(() => { + setTimeout(() => { + document.body.removeChild(modal); + }, 300); + }); + } + + private handleSave(): void { + const request: SaveFileDetailsRequest = { + fileId: this.fileId, + fileName: this.fileDetails.fileName, + title: this.fileDetails.title, + description: this.fileDetails.description, + }; + this.itemsClient.saveFileDetails(request) + .then(() => this.closeModal()) + .catch(reason => alert(reason)); + } + + render() { + return ( + +

    {state.localization?.Edit}

    + + +
    +
    + {this.fileDetails && this.fileDetails.iconUrl && + + } + {this.fileDetails && +
    + + {this.fileDetails.fileId} + + + {this.fileDetails.createdBy} + + + {this.fileDetails.createdOnDate} + + + {this.fileDetails.lastModifiedBy} + + + {this.fileDetails.lastModifiedOnDate} +
    + } +
    +
    +
    + + + this.fileDetails = { + ...this.fileDetails, + fileName: (e.target as HTMLInputElement).value, + } + } + /> + + + + this.fileDetails = { + ...this.fileDetails, + title: (e.target as HTMLInputElement).value.substring(0, 255), + } + } + /> + + +