Skip to content

Commit

Permalink
Implemented new resource manager as per feedback (#5240)
Browse files Browse the repository at this point in the history
* initial swap of original frontent

* Fixed msbuild issues

* deleted files that should not get commited (build result)

* ignore build results

* Moved pre-packaging into UpdateFiles step

* Implemented base layou

* Initial attempt at PersonaBar integration

* commit project file

* integrated into persona bar

* Completed main panes layout

* Include Persona Bar panel

* implemented logic for folders pane

* Implemented expanding folders nesting

* Implemented base logic for items list view

* Implementented basics of cardview

* Replaced png folder icons for svg icons

* Implemented thumbnails in cardview

* Ensure folder list chidren are collapsed when parent is collapsed

* Implemented localization pattern

* Resolved merge conflicts, I'll use PRs in the future to prevent this...

* Implemented more list-view columns

Closes #31

* Added a little whtiespace

* Switched to non-beta dnn-elements v0.14.0

Switched to non-beta dnn-elements v0.14.0

* Implemented infinite scroll

Implemented infinite scroll

* Initial implementation of status bar

* Implemented file search

Implemented file search

* Removed stray console.log

* Implemented sorting

Implemented sorting

* Implemented multi-selection of items

Implemented multi-selection of items

* Implemented basics of action item with context menu in folder list

* Implemented context menu in listview

* Implemented context menu in cardview

* Got creating a folder working

* Got to create a actual folder

* Handled creating folder as a children of the context one

* Only show Add Folder if the user can do it

* Finished Create Folder implementation

* Bumped dnn-elements to v0.14.1

* re-architected actions/menus to support editing any type of item

* commit missing files

* Some more progress on item editor

* Handles relation between allow/deny permissions

* Finished initial implemenation of edit-folder

* Added file editing capability

Added file editing capability

* Implemented item move feature

Implemented item move feature

* Implemented delete feature

Implemented delete feature

* Implemented delete feature

Implemented delete feature

* Implemented unlink feature

Implemented unlink feature

* Implemented Copy-Url feature

Implemented Copy-Url feature
Note that this only works over https (clipboard access)

* Resolved a build issue caused by the latest rebase on Platform

This branch was rebased on the platform repository and by mistake the package.json and some other files got mixed into this. This PR fixes that bad merge.

* Bump stencil to 2.15.1

* Add localization to status bar

* Add resx file

* Add Cleanup component to manifest to ensure fresh start at 09.11.00

* Implement refresh and sync

* Add jsdocs for groupId

* Implement file download functionality

* Clean up commented code

* 'backup'

* Fixed 2 build issues

AEModule.build had 2 globs that would return some of the same files and have them duplicated in resources.zip files, which was not a major issue but found it while troubleshooting another issue.

Also, WebFormsMVP had recently been made into a package but it was not added to the list of unversioned manifest and would get automatically versioned by the current DNN version upon build.

* Resolved multiple build issues

Resolved multiple build issues
Docs were also uncommited, so this also pushes that

* Made the yarn watch process work as the other modules

now we can do `yarn watch --scope dnn-resource-manager` in order to view changes live on the test site :)

* Forgot to commit the gitignore file too

* Fixed wrong output path for yarn watch

Also creates a specific file for the dnn watch, if not we would required to decrale the output folder in the package.json which sounds dirty.

* Removed unecessary import

* Provides the groupId in the API calls headers

Provides the groupId in the API calls headers

* Added upload feature to resource manager

Added upload feature to resource manager

* Update DNN Platform/Modules/ResourceManager/App_LocalResources/ResourceManager.resx

Co-authored-by: David Poindexter <dpoindexter@nvisionative.com>

* Update dnn-elements and resolve file upload modal close refresh

* Implemented UI to manage folder mappings and folder providers

Implemented UI to manage folder mappings and folder providers

* rebuilt after rebase

* Resolve bug with the dimissing of context menu on folder list

* Added type/size verification before upload

Before this PR, the upload would happen before the file type and size validation would happen. This valides those in the frontend first to save on an upload that would not succeed anyway.

* Polished some UI for uploads and filenames.

- Adds a green checkmark feedback on successful uploads
- Makes the long filenames wrap in gridvriew

* Added licenses

* Changed package from resources to zip

* Update DNN Platform/Modules/ResourceManager/ResourceManager.Web/package.json

Co-authored-by: David Poindexter <dpoindexter@nvisionative.com>

* Adjusted package.json and removed redundant license

* Update DNN Platform/Modules/ResourceManager/ResourceManager.dnn

Co-authored-by: Daniel Valadas <info@danielvaladas.com>

* Update DNN Platform/Modules/ResourceManager/ResourceManager.dnn

Co-authored-by: Daniel Valadas <info@danielvaladas.com>

* Removed Persona Bar specific module for now

* Removed persona bar specific code for now

* Update SolutionInfo.cs

* Corrected SolutionInfo.cs to end with a single new line

* Fixed a yarn.lock typo and rebuilt

Co-authored-by: David Poindexter <dpoindexter@nvisionative.com>
  • Loading branch information
valadas and david-poindexter authored Aug 30, 2022
1 parent 66014ba commit c709cf7
Show file tree
Hide file tree
Showing 213 changed files with 9,572 additions and 10,316 deletions.
1 change: 1 addition & 0 deletions DNN Platform/Modules/ResourceManager/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Scripts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public static ArrayList ToPermissionInfos(this IList<UserPermission> permissions
AllowAccess = p.AllowAccess,
FolderID = folderId,
PermissionID = p.PermissionId,
RoleID = Null.NullInteger,
RoleID = int.Parse(Globals.glbRoleNothing),
UserID = permission.UserId,
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

/// <summary>
/// Manages the behaviour of the Resource Manager persona bar menu item.
/// </summary>
public class PersonaBarMenuController : IMenuItemController
{
/// <inheritdoc/>
public IDictionary<string, object> GetSettings(MenuItem menuItem)
{
return null;
}

/// <inheritdoc/>
public void UpdateParameters(MenuItem menuItem)
{
}

/// <inheritdoc/>
public bool Visible(MenuItem menuItem)
{
var user = UserController.Instance.GetCurrentUserInfo();
return user.Roles.Contains(PortalSettings.Current.AdministratorRoleName) || user.IsSuperUser;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
<Compile Include="Components\Models\ThumbnailContent.cs" />
<Compile Include="Components\PermissionHelper.cs" />
<Compile Include="Components\PermissionsManager.cs" />
<Compile Include="Components\PersonaBarMenuController.cs" />
<Compile Include="Components\ResourceManagerController.cs" />
<Compile Include="Components\SearchController.cs" />
<Compile Include="Components\SettingsManager.cs" />
Expand All @@ -133,6 +134,7 @@
<Compile Include="Services\Dto\MoveFolderRequest.cs" />
<Compile Include="Services\Dto\Permission.cs" />
<Compile Include="Services\Dto\Permissions.cs" />
<Compile Include="Services\Dto\RoleGroupDto.cs" />
<Compile Include="Services\Dto\RolePermission.cs" />
<Compile Include="Services\Dto\ThumbnailDownloadRequest.cs" />
<Compile Include="Services\Dto\UserPermission.cs" />
Expand All @@ -147,13 +149,6 @@
<Compile Include="Settings.ascx.designer.cs">
<DependentUpon>Settings.ascx</DependentUpon>
</Compile>
<Compile Include="View.ascx.cs">
<DependentUpon>View.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="View.ascx.designer.cs">
<DependentUpon>View.ascx</DependentUpon>
</Compile>
<AdditionalFiles Include="..\..\..\stylecop.json">
<Link>stylecop.json</Link>
</AdditionalFiles>
Expand Down Expand Up @@ -196,9 +191,7 @@
<Content Include="License.txt" />
<Content Include="module.css" />
<Content Include="ReleaseNotes.txt" />
<Content Include="Scripts\dnn.Localization.js" />
<Content Include="Settings.ascx" />
<Content Include="View.ascx" />
</ItemGroup>
<ItemGroup>
<Content Include="ResourceManager.dnn">
Expand All @@ -217,6 +210,10 @@
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Dnn.AdminExperience\Library\Dnn.PersonaBar.Library\Dnn.PersonaBar.Library.csproj">
<Project>{8b50ba8b-0a08-41b8-81b8-ea70707c7379}</Project>
<Name>Dnn.PersonaBar.Library</Name>
</ProjectReference>
<ProjectReference Include="..\..\DotNetNuke.Abstractions\DotNetNuke.Abstractions.csproj">
<Project>{6928A9B1-F88A-4581-A132-D3EB38669BB0}</Project>
<Name>DotNetNuke.Abstractions</Name>
Expand Down Expand Up @@ -257,6 +254,7 @@
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<Content Include="View.html" />
<Content Include="web.config" />
<None Include="web.Debug.config">
<DependentUpon>web.config</DependentUpon>
Expand All @@ -269,6 +267,9 @@
<Analyzer Include="..\..\..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\..\..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
</ItemGroup>
<ItemGroup>
<Folder Include="Scripts\" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 35 additions & 22 deletions DNN Platform/Modules/ResourceManager/Module.build
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RootDirectory>$(MSBuildProjectDirectory)\..\..\..</RootDirectory>
<ReactDirectory>$(MSBuildProjectDirectory)\ResourceManager.Web</ReactDirectory>
</PropertyGroup>
<Import Project="..\..\..\DNN_Platform.build" />
<PropertyGroup>
<Extension>zip</Extension>
<DNNFileName>ResourceManager</DNNFileName>
<PackageName>DNNCE_ResourceManager</PackageName>
<ModuleFolderName>$(WebsitePath)\DesktopModules\ResourceManager</ModuleFolderName>
<InstallPath>$(WebsiteInstallPath)\Module</InstallPath>
</PropertyGroup>
<Import Project="$(BuildScriptsPath)\Package.Targets" />
<Import Project="$(BuildScriptsPath)\Module.Build"/>
<Target Name="UpdateFiles">
<ItemGroup>
<Resources Remove="web.config" />
</ItemGroup>
</Target>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RootDirectory>$(MSBuildProjectDirectory)\..\..\..</RootDirectory>
<ReactDirectory>$(MSBuildProjectDirectory)\ResourceManager.Web</ReactDirectory>
</PropertyGroup>
<Import Project="..\..\..\DNN_Platform.build" />
<PropertyGroup>
<Extension>zip</Extension>
<DNNFileName>ResourceManager</DNNFileName>
<PackageName>DNNCE_ResourceManager</PackageName>
<ModuleFolderName>$(WebsitePath)\DesktopModules\ResourceManager</ModuleFolderName>
<InstallPath>$(WebsiteInstallPath)\Module</InstallPath>
</PropertyGroup>
<Import Project="$(BuildScriptsPath)\Package.Targets" />
<Import Project="$(BuildScriptsPath)\Module.Build"/>
<ItemGroup>
<Scripts Include="$(MSBuildProjectDirectory)\Scripts\**\*.*" />
</ItemGroup>
<Target Name="UpdateFiles">
<PropertyGroup>
<ComponentsDestinationFolder>$(MSBuildProjectDirectory)\Scripts\dnn-resource-manager</ComponentsDestinationFolder>
</PropertyGroup>
<ItemGroup>
<ComponentsSource Include="$(MSBuildProjectDirectory)\ResourceManager.Web\dist\dnn-resource-manager\**\*" />
</ItemGroup>
<RemoveDir Directories="$(ComponentsDestinationFolder)" />
<Copy SourceFiles="@(ComponentsSource)" DestinationFolder="$(ComponentsDestinationFolder)" />
<ItemGroup>
<Resources Remove="web.config" />
<Resources Remove="web.Debug.config" />
<Resources Remove="web.Release.config" />
</ItemGroup>
</Target>
</Project>
18 changes: 0 additions & 18 deletions DNN Platform/Modules/ResourceManager/ResourceManager.Web/.babelrc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit c709cf7

Please sign in to comment.