Skip to content

Commit

Permalink
Bug 560051: New "Allowed Languages" page is missing permissions and s…
Browse files Browse the repository at this point in the history
…ome fit and finish (#2481)

<!-- Thank you for submitting a Pull Request. If you're new to
contributing to BCApps please read our pull request guideline below
* https://github.com/microsoft/BCApps/Contributing.md
-->
#### Summary <!-- Provide a general summary of your changes -->
- Adds missing permission. Everyone should be able to read "Allowed
Languages"
- Add a notification to the Languages page, if the view is filtered
- Updates a few strings
- Adds action to reach the Allowed Languages from the UI (Languages
page)

#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
Fixes
[AB#560051](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/560051)
  • Loading branch information
JesperSchulz authored Dec 10, 2024
1 parent 676166e commit adbd1fc
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ table 3563 "Allowed Language"
Caption = 'Allowed Language';
DataClassification = SystemMetadata;
DataPerCompany = false;
InherentEntitlements = X;
InherentPermissions = X;
InherentEntitlements = RX;
InherentPermissions = RX;

fields
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ page 3563 "Allowed Languages"
HelpLink = 'https://go.microsoft.com/fwlink/?linkid=2149387';
AdditionalSearchTerms = 'company,role center,role,language';
AboutTitle = 'About allowed languages.';
AboutText = 'Define a list of allowed languages which is enabled for this environment. If nothing is specified, then the user will be able to use all available languages.';
Permissions = tabledata "Allowed Language" = r;
AboutText = 'Define a list of allowed languages which are enabled in this environment. If nothing is specified, the user will be able to select from all languages.';

layout
{
Expand All @@ -28,9 +27,11 @@ page 3563 "Allowed Languages"
repeater(AllowedLanguages)
{
field("Language Id"; Rec."Language Id")
{ }
{
}
field(Language; Rec.Language)
{ }
{
}
}
}
}
Expand Down
24 changes: 24 additions & 0 deletions src/System Application/App/Language/src/LanguageImpl.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ codeunit 54 "Language Impl."
LanguageIdOverrideMsg: Label 'LanguageIdOverride has been applied in GetLanguageIdOrDefault. The new Language Id is %1.', Comment = '%1 - Language ID';
FormatRegionOverrideMsg: Label 'FormatRegionOverride has been applied in GetFormatRegionOrDefault. The new FormatRegion is %1.', Comment = '%1 - Format Region';
LanguageCategoryTxt: Label 'Language';
NotificationAllowedLanguagesLbl: Label '2c2bd28b-926c-47a7-bbc4-cf76f8173549', Locked = true;
NotificationAllowedLanguagesMessageLbl: Label 'This list of languages has been filtered by your administrator.';
ReadMoreLbl: Label 'Read more';

procedure GetUserLanguageCode() UserLanguageCode: Code[10]
var
Expand Down Expand Up @@ -349,6 +352,27 @@ codeunit 54 "Language Impl."
exit(CultureInfo.CurrentCulture.Name);
end;

procedure ShowAllowedLanguagesNotification()
var
AllowedLanguage: Record "Allowed Language";
Notification: Notification;
NotificationGuid: Guid;
begin
if AllowedLanguage.IsEmpty() then
exit;

NotificationGuid := NotificationAllowedLanguagesLbl;
Notification.Id(NotificationGuid);
Notification.Message(NotificationAllowedLanguagesMessageLbl);
Notification.AddAction(ReadMoreLbl, Codeunit::"Language Impl.", 'OpenReadMore');
Notification.Send();
end;

procedure OpenReadMore(Notification: Notification)
begin
Hyperlink('https://go.microsoft.com/fwlink/?linkid=2299275');
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"UI Helper Triggers", GetApplicationLanguage, '', false, false)]
local procedure SetApplicationLanguageId(var language: Integer)
begin
Expand Down
17 changes: 14 additions & 3 deletions src/System Application/App/Language/src/Languages.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,18 @@ page 9 Languages
}
}
}

actions
{
area(Navigation)
{
action(ShowAllowedLanguagesNotification)
{
ApplicationArea = All;
Caption = 'Allowed Languages';
ToolTip = 'Shows the list of allowed languages for this environment.';
RunObject = Page "Allowed Languages";
Image = Language;
}
}
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ page 535 "Windows Languages"
}
}

trigger OnOpenPage()
var
LanguageImpl: Codeunit "Language Impl.";
begin
LanguageImpl.ShowAllowedLanguagesNotification();
end;
}


0 comments on commit adbd1fc

Please sign in to comment.