Skip to content

Commit

Permalink
Fix codereview suggestions from StefanMaron
Browse files Browse the repository at this point in the history
  • Loading branch information
IceOnly committed Dec 12, 2024
1 parent 7685987 commit 83ec1ff
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,12 @@ table 9450 "File Account"

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(1; "Account Id"; Guid) { }
field(2; Name; Text[250]) { }
field(4; Connector; Enum "File System Connector") { }
field(5; Logo; Media)
{
Access = Internal;
DataClassification = SystemMetadata;
}
}

Expand All @@ -48,8 +38,6 @@ table 9450 "File Account"

fieldgroups
{
fieldgroup(Brick; Logo, Name)
{
}
fieldgroup(Brick; Logo, Name) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,11 @@ codeunit 9451 "File Account Impl."
FileAccountsPage.LookupMode(true);
FileAccountsPage.EnableLookupMode();
FileAccountsPage.Caption(ChooseNewDefaultTxt);
if FileAccountsPage.RunModal() = Action::LookupOK then begin
FileAccountsPage.GetAccount(NewDefaultFileAccount);
exit(true);
end;
if FileAccountsPage.RunModal() <> Action::LookupOK then
exit;

exit(false);
FileAccountsPage.GetAccount(NewDefaultFileAccount);
exit(true);
end;

local procedure ImportLogo(var FileAccount: Record "File Account"; FileSystemConnector: Interface "File System Connector")
Expand All @@ -134,6 +133,7 @@ codeunit 9451 "File Account Impl."

if ConnectorLogoBase64 = '' then
exit;

if not FileSystemConnectorLogo.Get(FileAccount.Connector) then begin
TempBlob.CreateOutStream(OutStream);
Base64Convert.FromBase64(ConnectorLogoBase64, OutStream);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ page 9451 "File Account Wizard"
{
Editable = false;
ShowCaption = false;
ToolTip = ' ';
Caption = ' ';
ToolTip = ' ', Locked = true;
}
}
group(NotDone)
Expand All @@ -57,8 +56,7 @@ page 9451 "File Account Wizard"
{
Editable = false;
ShowCaption = false;
ToolTip = ' ';
Caption = ' ';
ToolTip = ' ', Locked = true;
}
}

Expand All @@ -76,7 +74,6 @@ page 9451 "File Account Wizard"
{
Editable = false;
ShowCaption = false;
Caption = ' ';
ToolTip = 'View information about how to set up the file capabilities.';

trigger OnDrillDown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ page 9450 "File Accounts"
part(Scenarios; "File Scenarios FactBox")
{
Caption = 'File Scenarios';
SubPageLink = "Account Id" = field("Account Id"), Connector = field(Connector), Scenario = filter(<> 0); // Do not show Default scenario
SubPageLink = "Account Id" = field("Account Id"), Connector = field(Connector), Scenario = filter(<> Default);
}
}
}
Expand Down Expand Up @@ -192,32 +192,22 @@ page 9450 "File Accounts"
{
Caption = 'New';

actionref(AddAccount_Promoted; AddAccount)
{
}
actionref(AddAccount_Promoted; AddAccount) { }
}
group(Category_Process)
{
Caption = 'Process';

actionref(MakeDefault_Promoted; MakeDefault)
{
}
actionref(BrowseAccount_Promoted; BrowseAccount)
{
}
actionref(Delete_Promoted; Delete)
{
}
actionref(MakeDefault_Promoted; MakeDefault) { }
actionref(BrowseAccount_Promoted; BrowseAccount) { }
actionref(Delete_Promoted; Delete) { }
}

group(Category_Category4)
{
Caption = 'Navigate';

actionref(FileScenarioSetup_Promoted; FileScenarioSetup)
{
}
actionref(FileScenarioSetup_Promoted; FileScenarioSetup) { }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,9 @@ table 9451 "File System Connector"

fields
{
field(1; Connector; Enum "File System Connector")
{
DataClassification = SystemMetadata;
}
field(2; Logo; Media)
{
DataClassification = SystemMetadata;
}
field(3; Description; Text[250])
{
DataClassification = SystemMetadata;
}
field(1; Connector; Enum "File System Connector") { }
field(2; Logo; Media) { }
field(3; Description; Text[250]) { }
}

keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@ table 9452 "File System Connector Logo"

fields
{
field(1; Connector; Enum "File System Connector")
{
DataClassification = SystemMetadata;
}
field(2; Logo; Media)
{
DataClassification = CustomerContent;
}
field(1; Connector; Enum "File System Connector") { }
field(2; Logo; Media) { }
}

keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ table 9455 "File Account Content"
field(1; "Type"; Enum "File Type")
{
Caption = 'Type';
DataClassification = ToBeClassified;
}
field(2; Name; Text[2048])
{
Caption = 'Name';
DataClassification = ToBeClassified;
}
field(10; "Parent Directory"; Text[2048])
{
Caption = 'Parent Directory';
DataClassification = ToBeClassified;
}
}
keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,13 @@ table 9453 "File Account Scenario"

fields
{
field(1; Scenario; Integer)
{
DataClassification = SystemMetadata;
}
field(2; Connector; Enum "File System Connector")
{
DataClassification = SystemMetadata;
}
field(3; "Account Id"; Guid)
{
DataClassification = SystemMetadata;
}
field(4; "Display Name"; Text[2048])
{
DataClassification = SystemMetadata;
}
field(5; Default; Boolean)
{
DataClassification = SystemMetadata;
}
field(6; EntryType; Option)
{
DataClassification = SystemMetadata;
OptionMembers = Account,Scenario;
}
field(7; Position; Integer)
{
DataClassification = SystemMetadata;
}
field(1; Scenario; Integer) { }
field(2; Connector; Enum "File System Connector") { }
field(3; "Account Id"; Guid) { }
field(4; "Display Name"; Text[2048]) { }
field(5; Default; Boolean) { }
field(6; EntryType; Enum "File Acount Entry Type") { }
field(7; Position; Integer) { }
}

keys
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// ------------------------------------------------------------------------------------------------
// 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;

enum 9453 "File Acount Entry Type"
{
Access = Internal;
Extensible = false;

value(0; Account) { }
value(1; Scenario) { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,16 @@ namespace System.FileSystem;
/// </summary>
table 9454 "File Scenario"
{
DataClassification = SystemMetadata;
Access = Internal;
InherentPermissions = X;
InherentEntitlements = X;

fields
{
field(1; Scenario; Enum "File Scenario")
{
DataClassification = SystemMetadata;
}
field(2; Connector; Enum "File System Connector")
{
DataClassification = SystemMetadata;
}
field(3; "Account Id"; Guid)
{
DataClassification = SystemMetadata;
}
field(1; Scenario; Enum "File Scenario") { }
field(2; Connector; Enum "File System Connector") { }
field(3; "Account Id"; Guid) { }
}

keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ codeunit 9453 "File Scenario Impl."
FileAccount := AllFileAccounts;
exit(true);
end;

exit(false);
end;

procedure SetFileAccount(Scenario: Enum "File Scenario"; FileAccount: Record "File Account")
Expand Down Expand Up @@ -155,7 +153,7 @@ codeunit 9453 "File Scenario Impl."
FileAccountScenarios.SetCurrentKey("Display Name"); // sort scenarios by "Display Name"
end;

local procedure AddEntry(var FileAccountScenario: Record "File Account Scenario"; EntryType: Option; Scenario: Integer; AccountId: Guid; FileSystemConnector: Enum "File System Connector"; DisplayName: Text[2048]; Default: Boolean; var Position: Integer)
local procedure AddEntry(var FileAccountScenario: Record "File Account Scenario"; EntryType: Enum "File Acount Entry Type"; Scenario: Integer; AccountId: Guid; FileSystemConnector: Enum "File System Connector"; DisplayName: Text[2048]; Default: Boolean; var Position: Integer)
begin
// Add entry to the File Account Scenario while maintaining the position so that the tree represents the data correctly
FileAccountScenario.Init();
Expand Down Expand Up @@ -187,12 +185,12 @@ codeunit 9453 "File Scenario Impl."
FileScenariosForAccount.SetRecord(FileAccountScenario);

if FileScenariosForAccount.RunModal() <> Action::LookupOK then
exit(false);
exit;

FileScenariosForAccount.GetSelectedScenarios(SelectedFileAccScenarios);

if not SelectedFileAccScenarios.FindSet() then
exit(false);
exit;

repeat
if not FileScenario.Get(SelectedFileAccScenarios.Scenario) then begin
Expand Down Expand Up @@ -259,7 +257,7 @@ codeunit 9453 "File Scenario Impl."
FileAccountImpl.CheckPermissions();

if not FileAccountScenario.FindSet() then
exit(false);
exit;

FileAccount.GetAllAccounts(false, SelectedFileAccount);
if SelectedFileAccount.Get(FileAccountScenario."Account Id", FileAccountScenario.Connector) then;
Expand All @@ -269,7 +267,7 @@ codeunit 9453 "File Scenario Impl."
AccountsPage.Caption := ChangeFileAccountForScenarioTxt;

if AccountsPage.RunModal() <> Action::LookupOK then
exit(false);
exit;

AccountsPage.GetAccount(SelectedFileAccount);

Expand All @@ -295,7 +293,7 @@ codeunit 9453 "File Scenario Impl."
FileAccountImpl.CheckPermissions();

if not FileAccountScenario.FindSet() then
exit(false);
exit;

repeat
if FileAccountScenario.EntryType = FileAccountScenario.EntryType::Scenario then begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,9 @@ page 9452 "File Scenario Setup"
{
group(Category_Process)
{
actionref(AddScenario_Promoted; AddScenario)
{
}
actionref(ChangeAccount_Promoted; ChangeAccount)
{
}
actionref(Unassign_Promoted; Unassign)
{
}
actionref(AddScenario_Promoted; AddScenario) { }
actionref(ChangeAccount_Promoted; ChangeAccount) { }
actionref(Unassign_Promoted; Unassign) { }
}
}
}
Expand Down Expand Up @@ -187,7 +181,7 @@ page 9452 "File Scenario Setup"
FileAccountId: Guid;
FileConnector: Enum "File System Connector";
Style, DefaultTxt : Text;
TypeOfEntry: Option Account,Scenario;
TypeOfEntry: Enum "File Acount Entry Type";
Indentation: Integer;
CanUserManageFileSetup: Boolean;
}

0 comments on commit 83ec1ff

Please sign in to comment.