Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New System App Module for easy file systems access #663

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3d52a6a
Move to BCApps
IceOnly Feb 29, 2024
62b73a7
Upgrade to BC24
IceOnly Feb 29, 2024
c0276ff
Add Interface changes
IceOnly Mar 1, 2024
7945909
Fix Account Browser
IceOnly Mar 1, 2024
692b8b7
Change application are to new logic
IceOnly Mar 1, 2024
1277528
Fix first batch of code review suggestions
IceOnly Mar 1, 2024
ca7455a
Add File Pagination Facade
IceOnly Mar 1, 2024
ae719dd
Reduce code in file browser page
IceOnly Mar 1, 2024
8d8eee9
Use only test lib for internal access
IceOnly Mar 1, 2024
4258a0b
Fix variable names
IceOnly Mar 1, 2024
30a0622
Add review suggestions
IceOnly Apr 10, 2024
5b3228a
Solve name and id conflicts
IceOnly Apr 10, 2024
0cfd765
Fix test
IceOnly Apr 10, 2024
0327220
Fix application areas
IceOnly Jun 10, 2024
0ec94d8
Remove unused label
IceOnly Jun 10, 2024
6f742e4
Simplify integer incrementation
IceOnly Jun 10, 2024
33afd83
Sort variables
IceOnly Jun 10, 2024
f701d9f
Add Init to AddEntry
IceOnly Jun 10, 2024
c3cd8b5
Change tooltip to code review suggestion
IceOnly Jun 10, 2024
a53d936
Solve code review comments
IceOnly Aug 23, 2024
e6bf344
Solve code review suggestions 2
IceOnly Aug 23, 2024
e077767
Use labels for telemetry
IceOnly Aug 23, 2024
f1c251a
Fix code review suggestions
IceOnly Aug 26, 2024
73ed292
Remove useless internal attributes
IceOnly Aug 27, 2024
017b7d0
Refactored to media only
IceOnly Aug 30, 2024
4e5968e
Fix tooltips
IceOnly Sep 17, 2024
5fd8fc8
Revert GetIsLegacyActionBarEnabled change
IceOnly Sep 17, 2024
ecf81b5
Renumber Test Lib
IceOnly Sep 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/System Application/App/File System/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Provides an API that lets you connect file system accounts to Business Central so that people can access files outside BC. The file system module consists of the following main entities:

### File Account
An file account holds the information needed to access a file system from Business Central.

...
40 changes: 40 additions & 0 deletions src/System Application/App/File System/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"id": "c9c54414-80c3-4cc9-98c6-589158882774",
"name": "File System",
"publisher": "Microsoft",
"brief": "Enables user to send emails from Business Central.",
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
"description": "Enables user to send emails from Business Central.",
"version": "25.0.0.0",
"privacyStatement": "https://go.microsoft.com/fwlink/?linkid=724009",
"EULA": "https://go.microsoft.com/fwlink/?linkid=2009120",
"help": "https://go.microsoft.com/fwlink/?linkid=2103698",
"url": "https://go.microsoft.com/fwlink/?linkid=724011",
"logo": "",
"dependencies": [
],
"internalsVisibleTo": [
{
"id": "fff6eee5-083f-4f07-9a49-e34f7e2aad77",
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
"name": "File Systen Test",
"publisher": "Microsoft"
},
{
"id": "f188754b-3ffb-443a-9507-f5fbdae3af2c",
"name": "File System Test Library",
"publisher": "Microsoft"
}
],
"screenshots": [

],
"platform": "25.0.0.0",
"application": "25.0.0.0",
"idRanges": [
{
"from": 70000,
"to": 70199
}
],
"target": "OnPrem",
"contextSensitiveHelpUrl": "https://go.microsoft.com/fwlink/?linkid=2134520"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.FileSystem;

permissionset 70000 "File System - Admin"

Check failure on line 8 in src/System Application/App/File System/permissions/FileSystemAdmin.PermissionSet.al

View workflow job for this annotation

GitHub Actions / Build System Application (Translated) / System Application (Translated)

AL0297 The application object identifier '70000' is not valid. It must be within the allowed ranges '[1..9999]'.

Check failure on line 8 in src/System Application/App/File System/permissions/FileSystemAdmin.PermissionSet.al

View workflow job for this annotation

GitHub Actions / Build System Application (Clean) / System Application (Clean)

AL0297 The application object identifier '70000' is not valid. It must be within the allowed ranges '[1..9999]'.

Check failure on line 8 in src/System Application/App/File System/permissions/FileSystemAdmin.PermissionSet.al

View workflow job for this annotation

GitHub Actions / Build System Application (Default) / System Application (Default)

AL0297 The application object identifier '70000' is not valid. It must be within the allowed ranges '[1..9999]'.
{
Access = Public;
Assignable = true;
Caption = 'File System - Admin';

IncludedPermissionSets = "File System - Edit";

Permissions =
tabledata "File Account" = RMID,
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
tabledata "File System Connector" = RMID,
tabledata "File System Connector Logo" = RMID,
tabledata "File Account Scenario" = RMID,
tabledata "File Scenario" = RMID,
tabledata "File Account Content" = RMID;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.FileSystem;

using System.Environment;

permissionset 70002 "File System - Read"

Check failure on line 10 in src/System Application/App/File System/permissions/FileSystemEdit.PermissionSet.al

View workflow job for this annotation

GitHub Actions / Build System Application (Translated) / System Application (Translated)

AL0297 The application object identifier '70002' is not valid. It must be within the allowed ranges '[1..9999]'.

Check failure on line 10 in src/System Application/App/File System/permissions/FileSystemEdit.PermissionSet.al

View workflow job for this annotation

GitHub Actions / Build System Application (Clean) / System Application (Clean)

AL0297 The application object identifier '70002' is not valid. It must be within the allowed ranges '[1..9999]'.

Check failure on line 10 in src/System Application/App/File System/permissions/FileSystemEdit.PermissionSet.al

View workflow job for this annotation

GitHub Actions / Build System Application (Default) / System Application (Default)

AL0297 The application object identifier '70002' is not valid. It must be within the allowed ranges '[1..9999]'.
{
Access = Internal;
Assignable = false;

IncludedPermissionSets = "File System - Objects";

Permissions = tabledata "File Account" = r,
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
tabledata "File System Connector" = r,
tabledata "File System Connector Logo" = r,
tabledata "File Account Scenario" = r,
tabledata "File Scenario" = r,
tabledata "File Account Content" = r,
tabledata Media = r; // File System Account Wizard requires this
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.FileSystem;

permissionset 70001 "File System - Objects"

Check failure on line 8 in src/System Application/App/File System/permissions/FileSystemObjects.PermissionSetExt.al

View workflow job for this annotation

GitHub Actions / Build System Application (Translated) / System Application (Translated)

AL0297 The application object identifier '70001' is not valid. It must be within the allowed ranges '[1..9999]'.

Check failure on line 8 in src/System Application/App/File System/permissions/FileSystemObjects.PermissionSetExt.al

View workflow job for this annotation

GitHub Actions / Build System Application (Clean) / System Application (Clean)

AL0297 The application object identifier '70001' is not valid. It must be within the allowed ranges '[1..9999]'.

Check failure on line 8 in src/System Application/App/File System/permissions/FileSystemObjects.PermissionSetExt.al

View workflow job for this annotation

GitHub Actions / Build System Application (Default) / System Application (Default)

AL0297 The application object identifier '70001' is not valid. It must be within the allowed ranges '[1..9999]'.
{
Access = Internal;
Assignable = false;

Permissions =
table "File Account" = X,
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
table "File System Connector" = X,
table "File System Connector Logo" = X,
table "File Account Scenario" = X,
table "File Scenario" = X,
table "File Account Content" = X,
codeunit "File Account" = X,
codeunit "File Account Impl." = X,
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
codeunit "File Scenario" = X,
codeunit "File Pagination Data" = X,
codeunit "File System Impl." = X,
codeunit "File System" = X,
codeunit "File Scenario Impl." = X,
page "File Accounts" = X,
page "File Account Wizard" = X,
page "Folder Name Input" = X,
page "File Scenarios FactBox" = X,
page "File Scenarios for Account" = X,
page "File Scenario Setup" = X,
page "File Account Browser" = X;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.FileSystem;

using System.Environment;

permissionset 70003 "File System - Edit"

Check failure on line 10 in src/System Application/App/File System/permissions/FileSystemRead.PermissionSet.al

View workflow job for this annotation

GitHub Actions / Build System Application (Translated) / System Application (Translated)

AL0297 The application object identifier '70003' is not valid. It must be within the allowed ranges '[1..9999]'.

Check failure on line 10 in src/System Application/App/File System/permissions/FileSystemRead.PermissionSet.al

View workflow job for this annotation

GitHub Actions / Build System Application (Clean) / System Application (Clean)

AL0297 The application object identifier '70003' is not valid. It must be within the allowed ranges '[1..9999]'.

Check failure on line 10 in src/System Application/App/File System/permissions/FileSystemRead.PermissionSet.al

View workflow job for this annotation

GitHub Actions / Build System Application (Default) / System Application (Default)

AL0297 The application object identifier '70003' is not valid. It must be within the allowed ranges '[1..9999]'.
{
Access = Public;
Assignable = false;
Caption = 'File System - Edit';

IncludedPermissionSets = "File System - Read";

Permissions = tabledata "File System Connector Logo" = imd,
tabledata "Tenant Media" = imd;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.FileSystem;

/// <summary>
/// Provides functionality to work with file accounts.
/// </summary>

codeunit 70000 "File Account"

Check failure on line 12 in src/System Application/App/File System/src/Account/FileAccount.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application (Translated) / System Application (Translated)

AL0297 The application object identifier '70000' is not valid. It must be within the allowed ranges '[1..9999]'.

Check failure on line 12 in src/System Application/App/File System/src/Account/FileAccount.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application (Clean) / System Application (Clean)

AL0297 The application object identifier '70000' is not valid. It must be within the allowed ranges '[1..9999]'.

Check failure on line 12 in src/System Application/App/File System/src/Account/FileAccount.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application (Default) / System Application (Default)

AL0297 The application object identifier '70000' is not valid. It must be within the allowed ranges '[1..9999]'.
{
Access = Public;

/// <summary>
/// Gets all of the file accounts registered in Business Central.
/// </summary>
/// <param name="LoadLogos">Flag, used to determine whether to load the logos for the accounts.</param>
/// <param name="TempFileAccount">Out parameter holding the file accounts.</param>
procedure GetAllAccounts(LoadLogos: Boolean; var TempFileAccount: Record "File Account" temporary)
begin
FileAccountImpl.GetAllAccounts(LoadLogos, TempFileAccount);
end;

/// <summary>
/// Gets all of the file accounts registered in Business Central.
/// </summary>
/// <param name="TempFileAccount">Out parameter holding the file accounts.</param>
procedure GetAllAccounts(var TempFileAccount: Record "File Account" temporary)
begin
FileAccountImpl.GetAllAccounts(false, TempFileAccount);
end;

/// <summary>
/// Checks if there is at least one file account registered in Business Central.
/// </summary>
/// <returns>True if there is any account registered in the system, otherwise - false.</returns>
procedure IsAnyAccountRegistered(): Boolean
begin
exit(FileAccountImpl.IsAnyAccountRegistered());
end;

var
FileAccountImpl: Codeunit "File Account Impl.";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.FileSystem;

/// <summary>
/// A common representation of an file account.
/// </summary>
table 70000 "File Account"

Check failure on line 11 in src/System Application/App/File System/src/Account/FileAccount.Table.al

View workflow job for this annotation

GitHub Actions / Build System Application (Translated) / System Application (Translated)

AL0297 The application object identifier '70000' is not valid. It must be within the allowed ranges '[1..9999]'.

Check failure on line 11 in src/System Application/App/File System/src/Account/FileAccount.Table.al

View workflow job for this annotation

GitHub Actions / Build System Application (Clean) / System Application (Clean)

AL0297 The application object identifier '70000' is not valid. It must be within the allowed ranges '[1..9999]'.

Check failure on line 11 in src/System Application/App/File System/src/Account/FileAccount.Table.al

View workflow job for this annotation

GitHub Actions / Build System Application (Default) / System Application (Default)

AL0297 The application object identifier '70000' is not valid. It must be within the allowed ranges '[1..9999]'.
{
Extensible = false;
TableType = Temporary;

fields
{
field(1; "Account Id"; Guid)
{
DataClassification = SystemMetadata;
}

field(2; Name; Text[250])
{
DataClassification = SystemMetadata; // Field only in Memory
}

field(4; Connector; Enum "File System Connector")
{
DataClassification = SystemMetadata;
}

field(5; Logo; Media)
{
Access = Internal;
DataClassification = SystemMetadata;
}

field(6; LogoBlob; Blob)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use Blobs of subtype bitmap anymore. We should use Media instead.

Copy link
Author

@IceOnly IceOnly Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solved.

{
Access = Internal;
DataClassification = SystemMetadata;
Subtype = Bitmap;
}
}

keys
{
key(PK; "Account Id", Connector)
{
Clustered = true;
}

key(Name; Name)
{
Description = 'Used for sorting';
}
}

fieldgroups
{
fieldgroup(Brick; Logo, Name)
{

}
}

}
Loading
Loading