Skip to content

Commit

Permalink
[24.0] Add replacements for legacy control add-ins (#807)
Browse files Browse the repository at this point in the history
<!-- 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 -->
Some legacy style control add-ins were removed from the app DB and
introduced as System control add-ins in v. 24.0. Any usages of these
will fail or new tenants.

Introduce replacement addins as Obsolete = Pending to ensure that the
removal from the App DB is non-breaking.

#### 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#507953](https://dynamicssmb2.visualstudio.com/Dynamics%20SMB/_workitems/edit/507953/)
  • Loading branch information
stkillen authored Mar 22, 2024
1 parent 665dcb4 commit 839376f
Show file tree
Hide file tree
Showing 8 changed files with 632 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#if not CLEAN24
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

#pragma warning disable AA0247
controladdin "Microsoft.Dynamics.Nav.Client.FlowIntegration"
{
ObsoleteState = Pending;
ObsoleteTag = '24.0';
ObsoleteReason = 'Replaced with FlowIntegration addin.';
RequestedHeight = 600;
MinimumHeight = 600;
RequestedWidth = 320;
MinimumWidth = 320;
VerticalStretch = true;
VerticalShrink = true;
HorizontalStretch = true;
HorizontalShrink = true;

Scripts = 'Resources\FlowIntegration\js\msflowsdk-1.1.1.144.min.js',
'Resources\FlowIntegration\js\FlowIntegration.js';
StartupScript = 'Resources\FlowIntegration\js\Startup.js';
RecreateScript = 'Resources\FlowIntegration\js\Recreate.js';
RefreshScript = 'Resources\FlowIntegration\js\Refresh.js';

/// <summary>
/// Event raised when addin is done loading
/// </summary>
event ControlAddInReady();

/// <summary>
/// Event raised when error occurs
/// </summary>
/// <param name="Error">Error name</param>
/// <param name="Description">Description of the error.</param>
event ErrorOccurred(Error: Text; Description: Text);

/// <summary>
/// Event will be fired when the control add-in should be refreshed.
/// </summary>
event Refresh();

/// <summary>
/// Function that initializes the Flow API
/// </summary>
/// <param name="HostName">Flow service url needed by Flow API.</param>
/// <param name="Locale">Four-letter language and region code.</param>
/// <param name="FlowServiceToken">Microsoft Flow Service Access Token.</param>
procedure Initialize(HostName: Text; Locale: Text; FlowServiceToken: Text);

/// <summary>
/// Function that loads the embedded Flow into a container on a webpage
/// </summary>
/// <param name="EnvironmentId">Flow Environmnet ID</param>
procedure LoadFlows(EnvironmentId: Text);

/// <summary>
/// Function that loads embedded Flow templates into a container on a webpage
/// </summary>
/// <param name="EnvironmentId">Flow Environmnet ID</param>
/// <param name="SearchTerm">Filters templates matching the search term</param>
/// <param name="PageSize">Number of templates to be displayed in the container</param>
/// <param name="Destination">Determines page that opens when one selects a template</param>
procedure LoadTemplates(EnvironmentId: Text; SearchTerm: Text; PageSize: Text; Destination: Text);
}
#pragma warning restore AA0247
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#if not CLEAN24
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

#pragma warning disable AA0247
controladdin "Microsoft.Dynamics.Nav.Client.OAuthIntegration"
{
ObsoleteState = Pending;
ObsoleteTag = '24.0';
ObsoleteReason = 'Replaced with OAuthIntegration addin.';
RequestedHeight = 30;
RequestedWidth = 200;
MinimumHeight = 20;
MinimumWidth = 200;
VerticalStretch = true;
VerticalShrink = true;
HorizontalStretch = true;
HorizontalShrink = true;

Scripts = 'Resources\OAuthIntegration\js\OAuthIntegration.js';
StyleSheets = 'Resources\OAuthIntegration\stylesheets\OAuthIntegration.css';
StartupScript = 'Resources\OAuthIntegration\js\Startup.js';

/// <summary>
/// Starts the authorization process.
/// </summary>
/// <param name="Url">The authentication request AuthRequestUrl.</param>
procedure StartAuthorization(AuthRequestUrl: Text);

/// <summary>
/// Creates link to start the authorization process
/// </summary>
procedure Authorize(Url: Text; LinkName: Text; LinkToolTip: Text);

/// <summary>
/// Event triggered when an authorization code is retreieved.
/// </summary>
/// <param name="AuthCode">The authorization code retrieved as part of the authentication process.</param>
event AuthorizationCodeRetrieved(AuthCode: Text);

/// <summary>
/// Event triggered when the authorization process has failed.
/// </summary>
/// <param name="AuthError">The authorization error message received.</param>
/// <param name="AuthErrorDescription">A description of the authorization error received.</param>
event AuthorizationErrorOccurred(AuthError: Text; AuthErrorDescription: Text);

/// <summary>
/// Event triggered when the Add-In is loaded and ready to use.
/// </summary>
event ControlAddInReady();
}
#pragma warning restore AA0247
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#if not CLEAN24
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

#pragma warning disable AA0247
controladdin "Microsoft.Dynamics.Nav.Client.PageReady"
{
ObsoleteState = Pending;
ObsoleteTag = '24.0';
ObsoleteReason = 'Replaced with PageReady addin.';
Scripts = 'Resources\PageReady\js\PageReady.js';
StyleSheets = 'Resources\PageReady\stylesheets\PageReady.css';
RequestedWidth = 0;
RequestedHeight = 0;
HorizontalStretch = false;
VerticalStretch = false;

event AddInReady();
}
#pragma warning restore AA0247
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
#if not CLEAN24
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

#pragma warning disable AA0247
controladdin "Microsoft.Dynamics.Nav.Client.PowerBIManagement"
{
ObsoleteState = Pending;
ObsoleteTag = '24.0';
ObsoleteReason = 'Replaced with PowerBIManagement addin.';
RequestedHeight = 320;
MinimumHeight = 180;
RequestedWidth = 300;
MinimumWidth = 200;
VerticalStretch = true;
VerticalShrink = true;
HorizontalStretch = true;
HorizontalShrink = true;

Scripts = 'Resources\PowerBIManagement\js\PowerBIManagement.js',
// The powerbi.js file comes from the nuget package: Microsoft.PowerBI.Javascript version: 2.22.2
// https://github.com/microsoft/PowerBI-JavaScript/blob/master/dist/powerbi.js
// The file below should point to the nuget package when the AL infrastructure supports it.
'Resources\PowerBIManagement\js\powerbi.js';
StartupScript = 'Resources\PowerBIManagement\js\Startup.js';
StyleSheets = 'Resources\PowerBIManagement\stylesheets\PowerBIManagement.css';

/// <summary>
/// Event that will be fired when the AddIn is ready for communication through its API
/// </summary>
event ControlAddInReady();

/// <summary>
/// Event that will be fired when an error occurs in the add-in
/// </summary>
event ErrorOccurred(Operation: Text; ErrorText: Text);

/// <summary>
/// Event that will be fired when the page of the embedded report changes
/// </summary>
event ReportPageChanged(NewPage: Text; NewPageFilters: Text);

/// <summary>
/// Event that will be fired when the embedded report finishes loading
/// </summary>
event ReportLoaded(ReportFilters: Text; ActivePageName: Text; ActivePageFilters: Text; CorrelationId: Text);

/// <summary>
/// Event that will be fired when the embedded dashboard finishes loading
/// </summary>
event DashboardLoaded(CorrelationId: Text);

/// <summary>
/// Event that will be fired when the embedded dashboard tile finishes loading
/// </summary>
event DashboardTileLoaded(CorrelationId: Text);

/// <summary>
/// Event that will be fired when the embedded report visual finishes loading
/// </summary>
event ReportVisualLoaded(CorrelationId: Text);

/// <summary>
/// Initializes the Power BI Embed into the page
/// </summary>
[Obsolete('This method is deprecated. Please use EmbedReport instead.', '24.0')]
procedure InitializeReport(ReportLink: Text; ReportId: Text; AuthToken: Text; PowerBIApi: Text);

/// <summary>
/// Initializes the Power BI embed Report into the page
/// </summary>
procedure EmbedReport(ReportLink: Text; ReportId: Text; AuthToken: Text; PageName: Text);

/// <summary>
/// Initializes the Power BI embed Report into the page, with additional options
/// </summary>
procedure EmbedReportWithOptions(ReportLink: Text; ReportId: Text; AuthToken: Text; PageName: Text; ShowPanes: Boolean);

/// <summary>
/// Initializes the Power BI embed Dashboard into the page
/// </summary>
procedure EmbedDashboard(DashboardLink: Text; DashboardId: Text; AuthToken: Text);

/// <summary>
/// Initializes the Power BI embed Dashboard Tile into the page
/// </summary>
procedure EmbedDashboardTile(DashboardTileLink: Text; DashboardId: Text; TileId: Text; AuthToken: Text);

/// <summary>
/// Initializes the Power BI embed Report Visual into the page
/// </summary>
procedure EmbedReportVisual(ReportVisualLink: Text; ReportId: Text; PageName: Text; VisualName: Text; AuthToken: Text);

/// <summary>
/// Changes the current mode into View
/// </summary>
procedure ViewMode();

/// <summary>
/// Changes the current mode into Edit
/// </summary>
procedure EditMode();

/// <summary>
/// Enters full screen mode for the current embed
/// </summary>
procedure FullScreen();

/// <summary>
/// Updates the report filters with the provided new filters
/// </summary>
/// <param name="filters">A serialized JSON array of filters</param>
/// <remarks>
/// The new filters will replace any existing report filter for the same table columns
/// </remarks>
procedure UpdateReportFilters(Filters: Text);

/// <summary>
/// Removes the current report level filters
/// </summary>
procedure RemoveReportFilters();

/// <summary>
/// Updates the page filters with the provided new filters
/// </summary>
/// <param name="filters">A serialized JSON array of filters</param>
/// <remarks>
/// The new filters will replace any existing page filter for the same table columns
/// </remarks>
procedure UpdatePageFilters(Filters: Text);

/// <summary>
/// Removes the current page level filters
/// </summary>
procedure RemovePageFilters();

/// <summary>
/// Changes the active page of the report
/// </summary>
/// <param name="pageName">The name of the new page to set as active</param>
procedure SetPage(PageName: Text);

/// <summary>
/// Sets the properties for the browser frame containing the embed
/// </summary>
procedure InitializeFrame(FullPage: Boolean; Ratio: Text);
}
#pragma warning restore AA0247
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#if not CLEAN24
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

#pragma warning disable AA0247
controladdin "Microsoft.Dynamics.Nav.Client.RoleCenterSelector"
{
ObsoleteState = Pending;
ObsoleteTag = '24.0';
ObsoleteReason = 'Replaced with RoleCenterSelector addin.';
RequestedHeight = 750;
RequestedWidth = 560;
VerticalStretch = true;
HorizontalStretch = true;

Scripts = 'https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.5.1.min.js',
'https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js',
'Resources\RoleCenterSelector\js\RoleCenterSelector.js';
StartupScript = 'Resources\RoleCenterSelector\js\Startup.js';
RefreshScript = 'Resources\RoleCenterSelector\js\Refresh.js';
RecreateScript = 'Resources\RoleCenterSelector\js\Recreate.js';
StyleSheets = 'https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/css/fabric.min.css',
'https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/css/fabric.components.min.css',
'Resources\RoleCenterSelector\stylesheets\RoleCenterSelector.css';


event ControlAddInReady();

event OnAcceptAction();

event OnProfileSelected(ProfileId: Text);

procedure LoadRoleCenterFromJson(Json: Text);

procedure LoadPageDataFromJson(Json: Text);

procedure SetCurrentProfileId(ProfileId: Text);
}
#pragma warning restore AA0247
#endif
Loading

0 comments on commit 839376f

Please sign in to comment.