Skip to content

feat(Templates): Summary Tab + Publish & Unpublish Button with Logic handling #7189

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

Merged
merged 10 commits into from
May 7, 2025
34 changes: 22 additions & 12 deletions Localize/lang/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"+R90eK": "Retry policy interval is invalid, must match ISO 8601 duration format",
"+Uvo/p": "Alt text for down chevron",
"+ZSBrq": "Context menu for {title} card",
"+gBLFF": "Your template has been saved.",
"+ijo/2": "Paste last used expression",
"+l5XmZ": "Enter a positive integer between {min} and {max}",
"+mAJR3": "(UTC+08:00) Kuala Lumpur, Singapore",
Expand All @@ -23,7 +24,6 @@
"+powfX": "Time zone",
"+xXHdp": "No outputs",
"/2V8bQ": "Timed out",
"/5PrlZ": "Description is required.",
"/EU/oJ": "Required. A string that contains the time zone name of the source time zone. See 'Default Time Zones' at 'https://go.microsoft.com/fwlink/?linkid=2238292'.",
"/I/U8L": "Body",
"/IVuGP": "Discard",
Expand Down Expand Up @@ -76,6 +76,7 @@
"0RcjSp": "Collapse",
"0SSwxD": "Close panel",
"0UfxUM": "Next",
"0UjRS5": "Save + publish for production",
"0Vzp0l": "Collapse",
"0ZZJos": "Showing {current_index_start} - {current_index_last} of {max_count} results.",
"0a4IGE": "Refresh",
Expand Down Expand Up @@ -240,7 +241,6 @@
"53MgCQ": "Open panel",
"595Baw": "(UTC+09:00) Osaka, Sapporo, Tokyo",
"5DkTf5": "Target schema node not found for node key ''{nodeKey}''",
"5GmlRf": "At least one category is required.",
"5J9jne": "Tell Microsoft what you liked about this feature",
"5LLxEp": "Light mode image",
"5LV34t": "The ''{invalidProperties}'' properties are invalid for the ''{authType}'' authentication type.",
Expand Down Expand Up @@ -276,7 +276,6 @@
"6LJZ7n": "Retry policy",
"6OSgRP": "Test map",
"6PdOcy": "Cancel",
"6TFn8v": "Your template has been published in production!",
"6VV7OY": "Timeout value is invalid, must match ISO 8601 duration format",
"6WOs0A": "For default value:",
"6c1ffO": "Enter JSON object of authentication parameter",
Expand Down Expand Up @@ -451,6 +450,7 @@
"BWIM2x": "''Value'' must be a valid integer",
"BXb3CB": "Testing tab",
"BYrP8F": "Number",
"BYsNzz": "Your template has been unpublished.",
"Bewmet": "Array",
"BjrVzW": "Resource group",
"Bkc/+3": "Retry policy minimum interval is invalid, must match ISO 8601 duration format",
Expand Down Expand Up @@ -599,7 +599,6 @@
"GE14Xd": "(UTC-03:00) City of Buenos Aires",
"GEB1on": "This contains a value that is not between 0 and 59",
"GFnJQe": "Test map",
"GGmFte": "Save",
"GIUSQs": "Filter by data type",
"GLd3MU": "Required. The object to find inside the Within collection.",
"GQnN3U": "Explain flow",
Expand Down Expand Up @@ -717,6 +716,7 @@
"JyYLq1": "Zoom out",
"JzRzVp": "(UTC-09:00) Alaska",
"JzvOUc": "The value must not be empty.",
"K/enCE": "Your template has been published to {newStatus}!",
"K50znc": "Required. The object to add a new property to.",
"K5t+Ia": "Subscription",
"K7/DnZ": "Output",
Expand Down Expand Up @@ -1008,6 +1008,7 @@
"T0X+Iw": "Fetching...",
"T1q9LE": "Name",
"TEN+cR": "Give feedback",
"TEYRnv": "Save + unpublish template",
"TNEttQ": "Friday",
"TO7qos": "Returns the start of the month of a string timestamp",
"TQd85R": "Edit in basic mode",
Expand Down Expand Up @@ -1266,6 +1267,7 @@
"_+R90eK.comment": "error message for invalid retry interval",
"_+Uvo/p.comment": "Alt text for down chevron",
"_+ZSBrq.comment": "Accessibility label",
"_+gBLFF.comment": "Title for the toaster after saving template.",
"_+ijo/2.comment": "Token picker for 'Paste last used expression'",
"_+l5XmZ.comment": "description of maximum waiting runs setting",
"_+mAJR3.comment": "Time zone value ",
Expand All @@ -1274,7 +1276,6 @@
"_+powfX.comment": "Label for timezone",
"_+xXHdp.comment": "No outputs text",
"_/2V8bQ.comment": "Timed out run",
"_/5PrlZ.comment": "Error message when the workflow parameter description is empty.",
"_/EU/oJ.comment": "Required string parameter for source time zone",
"_/I/U8L.comment": "Label text for request or response body",
"_/IVuGP.comment": "Button text for discard the dialog",
Expand Down Expand Up @@ -1327,6 +1328,7 @@
"_0RcjSp.comment": "Aria label for collapse button",
"_0SSwxD.comment": "Label on button that closes floating panel",
"_0UfxUM.comment": "Button text for moving to the next tab in the create workflow panel",
"_0UjRS5.comment": "The description for button text of saving the template as production status",
"_0Vzp0l.comment": "Collapse, making the node smaller, hiding the contents",
"_0ZZJos.comment": "Accessibility label telling that the results showing is from {current_index_start} to {current_index_last} out of {max_count} items",
"_0a4IGE.comment": "Refresh button aria label",
Expand Down Expand Up @@ -1491,7 +1493,6 @@
"_53MgCQ.comment": "Hint for the button on the error card",
"_595Baw.comment": "Time zone value ",
"_5DkTf5.comment": "Error message for target schema node not found",
"_5GmlRf.comment": "Error shown when the Category field is missing",
"_5J9jne.comment": "Chatbot feedback card link asking what user liked about the feature",
"_5LLxEp.comment": "Light mode image label",
"_5LV34t.comment": "Error message when having multiple invalid authentication properties",
Expand Down Expand Up @@ -1527,7 +1528,6 @@
"_6LJZ7n.comment": "title for retry policy setting",
"_6OSgRP.comment": "Test map panel header",
"_6PdOcy.comment": "Cancel",
"_6TFn8v.comment": "Title for the toaster after publishing template.",
"_6VV7OY.comment": "error message for invalid timeout value",
"_6WOs0A.comment": "Error message when the workflow parameter description is empty.",
"_6c1ffO.comment": "Description for authentication parameter",
Expand Down Expand Up @@ -1702,6 +1702,7 @@
"_BWIM2x.comment": "Error validation message for invalid integer. Do not remove the double single quotes around the display name, as it is needed to wrap the placeholder text.",
"_BXb3CB.comment": "An accessibility label that describes the testing tab",
"_BYrP8F.comment": "Placeholder title for a newly inserted Number parameter",
"_BYsNzz.comment": "Title for the toaster after unpublishing template.",
"_Bewmet.comment": "Title for array dropdown input setting",
"_BjrVzW.comment": "Label for choosing resource group",
"_Bkc/+3.comment": "error message for invalid minimum retry interval",
Expand Down Expand Up @@ -1850,7 +1851,6 @@
"_GE14Xd.comment": "Time zone value ",
"_GEB1on.comment": "Error message for invalid minute array",
"_GFnJQe.comment": "Code view title",
"_GGmFte.comment": "The description for saving the profile tab content to the service provider",
"_GIUSQs.comment": "Filter by data type",
"_GLd3MU.comment": "Required object parameter to find for the contains function",
"_GQnN3U.comment": "Chatbot prompt to explain the flow",
Expand Down Expand Up @@ -1968,6 +1968,7 @@
"_JyYLq1.comment": "Aria label for a button that zooms out on the workflow",
"_JzRzVp.comment": "Time zone value ",
"_JzvOUc.comment": "Error message when the stage progressed without selecting kind.",
"_K/enCE.comment": "Title for the toaster after publishing template.",
"_K50znc.comment": "Required object parameter to add a property in addProperty function",
"_K5t+Ia.comment": "Label for choosing subscription id.",
"_K7/DnZ.comment": "The title of the output field in the static result parseJson action",
Expand Down Expand Up @@ -2259,6 +2260,7 @@
"_T0X+Iw.comment": "Fetching...",
"_T1q9LE.comment": "The label for the connector column",
"_TEN+cR.comment": "Button text for submitting feedback",
"_TEYRnv.comment": "The description for button text of saving the template rolling back to development status",
"_TNEttQ.comment": "Day of the week",
"_TO7qos.comment": "Label for description of custom startOfMonth Function",
"_TQd85R.comment": "Button label to show when selecting switch to advanced editor",
Expand Down Expand Up @@ -2526,6 +2528,7 @@
"_an1Z0T.comment": "Label for the workflow images section",
"_ao6BlS.comment": "Header for resource group name",
"_aoUT/3.comment": "Text for loading Azure Resources",
"_aoyT7n.comment": "Content for the toaster for after unpublishing template.",
"_apZgmJ.comment": "Error message while parsing ",
"_auUI93.comment": "label to inform to upload or select source schema to be used",
"_auci7r.comment": "Error validation message for CSVs",
Expand Down Expand Up @@ -2569,6 +2572,7 @@
"_c7kfkV.comment": "Error validation message for invalid JSON",
"_c8UPLp.comment": "Section 2 of text for including dynamic content section",
"_cBw7SC.comment": "Label for connection creation date",
"_cCmFCI.comment": "The tab label for the summary tab on the configure template wizard",
"_cHiBAn.comment": "Time zone value ",
"_cJkSrD.comment": "tooltip text of pagination setting",
"_cKNvk6.comment": "Label for Value",
Expand Down Expand Up @@ -2761,6 +2765,7 @@
"_hq1mk6.comment": "Error while parsing expression for path value",
"_hqa/U1.comment": "Warning tab name",
"_hrbDu6.comment": "Label text for retry duration",
"_hrs5f4.comment": "The description for button text of saving the template as testing status",
"_htj+eZ.comment": "Header to update target schema",
"_hvbclb.comment": "MSI Audience Label Display Name",
"_hwj1Ht.comment": "Chatbot prompt to edit the workflow",
Expand Down Expand Up @@ -2874,6 +2879,7 @@
"_l8lP1X.comment": "Error message for when status is failed and error and error code are not provided",
"_l8leI3.comment": "The label for the status field",
"_l9+EbH.comment": "Description label for template description",
"_l9sKzI.comment": "Error shown when the feature connector field is missing",
"_lA/sHA.comment": "Accessibility label for a button to copy all text in a value box",
"_lB56l2.comment": "Error validation message for Numbers",
"_lC+EbT.comment": "The tab label for the mocked results tab on the operation panel",
Expand Down Expand Up @@ -3009,6 +3015,7 @@
"_odQ554.comment": "Response body for test map API",
"_og5JOA.comment": "Millisecond",
"_ohpbkw.comment": "title for retry policy exponential interval setting",
"_oiME91.comment": "The label for the status and plan tab label",
"_ol3TWp.comment": "Button label to automaticlaly generate agent parameter",
"_om43/8.comment": "Aria label for workflows list table",
"_or0uUQ.comment": "Details tab description",
Expand Down Expand Up @@ -3103,6 +3110,7 @@
"_rd6fai.comment": "Aria describing the way to control the keyboard navigation",
"_rh5g4p.comment": "Successful run",
"_rl9UOO.comment": "Descriptive message to show if the connection for an action cannot be changed or edited due to being shown in dual-pane (pinned action) view.",
"_rlfK4u.comment": "Content for the toaster for after saving template.",
"_rsdJcV.comment": "Main message displayed in the placeholder",
"_rv0Pn+.comment": "Add new option",
"_rxIJfD.comment": "Time zone value ",
Expand Down Expand Up @@ -3201,8 +3209,6 @@
"_uNHpGB.comment": "Time zone value ",
"_uOU0lL.comment": "Accessibility label for no configuration required",
"_uOWkHS.comment": "Error message to show when loading dynamic outputs failed.",
"_uOlHLw.comment": "The description for the settings tab on the configure template wizard",
"_uQtott.comment": "The tab label for the review tab on the configure template wizard",
"_uR9WuI.comment": "Required collection parameters to check union function on",
"_uRAbJb.comment": "Parameter display name label",
"_uSr3WX.comment": "Connection Name",
Expand Down Expand Up @@ -3432,6 +3438,7 @@
"an1Z0T": "Workflow images",
"ao6BlS": "Resource group",
"aoUT/3": "Loading resources...",
"aoyT7n": "Gallery page will no longer contain this template in action.",
"apZgmJ": "Invalid operation path input value. Path value - {pathValue}, Path template - {pathTemplate}",
"auUI93": "Add or select a source schema to use for your map.",
"auci7r": "Enter a valid comma-separated string.",
Expand Down Expand Up @@ -3475,6 +3482,7 @@
"c7kfkV": "Enter a valid JSON.",
"c8UPLp": "Dynamic content may also be added from other sources.",
"cBw7SC": "Created",
"cCmFCI": "Summary",
"cHiBAn": "(UTC+09:00) Seoul",
"cJkSrD": "Retrieve more results up to the pagination limit",
"cKNvk6": "{label} value item",
Expand Down Expand Up @@ -3667,6 +3675,7 @@
"hq1mk6": "Operation path value does not match the template for segment. Path {pathValue}, Template {pathTemplate}",
"hqa/U1": "Warnings",
"hrbDu6": "Duration",
"hrs5f4": "Save + publish for testing",
"htj+eZ": "Update target schema",
"hvbclb": "Audience",
"hwj1Ht": "Edit flow",
Expand Down Expand Up @@ -3780,6 +3789,7 @@
"l8lP1X": "The error and its code are required when status is \"Failed\"",
"l8leI3": "Status",
"l9+EbH": "Description",
"l9sKzI": "At least one featured connector is required.",
"lA/sHA": "Copy the value of ''{label}'' to the clipboard",
"lB56l2": "Enter a valid number.",
"lC+EbT": "Mocked Results",
Expand Down Expand Up @@ -3915,6 +3925,7 @@
"odQ554": "Response body",
"og5JOA": "{count} Millisecond",
"ohpbkw": "Exponential interval",
"oiME91": "Status and Plan",
"ol3TWp": "Select to generate the agent parameter",
"om43/8": "Workflows list tabel",
"or0uUQ": "Configure details for this node",
Expand Down Expand Up @@ -4009,6 +4020,7 @@
"rd6fai": "Use left and right arrow keys to navigate between commands",
"rh5g4p": "Is successful",
"rl9UOO": "Connections cannot be edited in pinned view. Release the pinned action to make connection changes.",
"rlfK4u": "Your template in action is in development mode.",
"rsdJcV": "Select source schema elements to build your map",
"rv0Pn+": "Add new",
"rxIJfD": "(UTC+09:30) Darwin",
Expand Down Expand Up @@ -4107,8 +4119,6 @@
"uNHpGB": "(UTC+07:00) Bangkok, Hanoi, Jakarta",
"uOU0lL": "Select Create to create a new workflow based on this template, no configuration required.",
"uOWkHS": "Failed to retrieve dynamic outputs. As a result, this operation's outputs might not be visible in subsequent actions. Error details: {message}",
"uOlHLw": "The below are the settings for this template, to publish a template you need to go to Review and Publish and publish.",
"uQtott": "Review",
"uR9WuI": "Required. The collections to evaluate. An object that appears in any of the collections also appears in the result.",
"uRAbJb": "Parameter display name",
"uSr3WX": "Connection name",
Expand Down
3 changes: 1 addition & 2 deletions libs/designer/src/lib/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,7 @@ export default {
CONNECTIONS: 'CONNECTIONS',
PARAMETERS: 'PARAMETERS',
PROFILE: 'PROFILE',
PUBLISH: 'PUBLISH',
REVIEW: 'REVIEW',
SUMMARY: 'SUMMARY',
SELECT_WORKFLOWS: 'SELECT_WORKFLOWS',
CUSTOMIZE_WORKFLOWS: 'CUSTOMIZE_WORKFLOWS',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { selectWizardTab } from '../state/templates/tabSlice';
import { setLayerHostSelector } from '@fluentui/react';
import { TemplateInfoToast } from '../../ui/configuretemplate/toasters';
import { useIntl } from 'react-intl';
import { equals, type Template } from '@microsoft/logic-apps-shared';

export const ConfigureTemplateWizard = () => {
useEffect(() => setLayerHostSelector('#msla-layer-host'), []);
Expand Down Expand Up @@ -56,18 +57,48 @@ export const ConfigureTemplateWizard = () => {
}
};

const onPublish = () => {
const onSaveTemplate = (prevStatus: Template.TemplateEnvironment, newStatus: Template.TemplateEnvironment) => {
const isNewStatusPublished = equals(newStatus, 'Production') || equals(newStatus, 'Testing');
setToasterData({
title: intl.formatMessage({
defaultMessage: 'Your template has been published in production!',
id: '6TFn8v',
description: 'Title for the toaster after publishing template.',
}),
content: intl.formatMessage({
defaultMessage: 'Head on over to the gallery page to see your template in action.',
id: 'ILcDyX',
description: 'Content for the toaster for after publishing template.',
}),
title: isNewStatusPublished
? intl.formatMessage(
{
defaultMessage: 'Your template has been published to {newStatus}!',
id: 'K/enCE',
description: 'Title for the toaster after publishing template.',
},
{
newStatus,
}
)
: equals(prevStatus, 'Development')
? intl.formatMessage({
defaultMessage: 'Your template has been saved.',
id: '+gBLFF',
description: 'Title for the toaster after saving template.',
})
: intl.formatMessage({
defaultMessage: 'Your template has been unpublished.',
id: 'BYsNzz',
description: 'Title for the toaster after unpublishing template.',
}),
content: isNewStatusPublished
? intl.formatMessage({
defaultMessage: 'Head on over to the gallery page to see your template in action.',
id: 'ILcDyX',
description: 'Content for the toaster for after publishing template.',
})
: equals(prevStatus, 'Development')
? intl.formatMessage({
defaultMessage: 'Your template in action is in development mode.',
id: 'rlfK4u',
description: 'Content for the toaster for after saving template.',
})
: intl.formatMessage({
defaultMessage: 'Gallery page will no longer contain this template in action.',
id: 'aoyT7n',
description: 'Content for the toaster for after unpublishing template.',
}),
show: true,
});
};
Expand All @@ -76,7 +107,7 @@ export const ConfigureTemplateWizard = () => {
dispatch(selectWizardTab(tabId));
};

const panelTabs: TemplateTabProps[] = useConfigureTemplateWizardTabs({ onSaveWorkflows, onPublish });
const panelTabs: TemplateTabProps[] = useConfigureTemplateWizardTabs({ onSaveWorkflows, onSaveTemplate });
const selectedTabProps = selectedTabId ? panelTabs?.find((tab) => tab.id === selectedTabId) : panelTabs[0];

return (
Expand Down
29 changes: 29 additions & 0 deletions libs/designer/src/lib/core/configuretemplate/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,32 @@ export const getSupportedSkus = (connections: Record<string, Template.Connection
export const getDefinitionFromWorkflowManifest = (manifest: Template.WorkflowManifest): LogicAppsV2.WorkflowDefinition => {
return (manifest?.artifacts?.find((artifact) => equals(artifact.type, 'workflow')) as any)?.file as LogicAppsV2.WorkflowDefinition;
};

export const getSaveMenuButtons = (
resourceStrings: Record<string, string>,
currentStatus: Template.TemplateEnvironment,
onSave: (status: Template.TemplateEnvironment) => void
): { text: string; onClick: () => void }[] => {
const isPublishedState = equals(currentStatus, 'Testing') || equals(currentStatus, 'Production');
const saveDevelopmentButton = {
text: isPublishedState ? resourceStrings.SaveUnpublishButton : resourceStrings.SaveButtonText,
onClick: () => onSave('Development'),
};
const baseItems = isPublishedState ? [] : [saveDevelopmentButton];
baseItems.push(
...[
{
text: resourceStrings.SavePublishForTestingButton,
onClick: () => onSave('Testing'),
},
{
text: resourceStrings.SavePublishForProdButton,
onClick: () => onSave('Production'),
},
]
);
if (isPublishedState) {
baseItems.push(saveDevelopmentButton);
}
return baseItems;
};
Loading
Loading