Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
useWorkflowApp,
validateWorkflowStandard,
deployArtifacts,
uploadFileToKnowledgeHub,
} from './Services/WorkflowAndArtifacts';
import { ArmParser } from './Utilities/ArmParser';
import { WorkflowUtility, addConnectionInJson, addOrUpdateAppSettings } from './Utilities/Workflow';
Expand Down Expand Up @@ -58,6 +59,7 @@ import {
isArmResourceId,
optional,
BaseCognitiveServiceService,
BaseResourceService,
AGENT_MSI_REQUIRED_ROLE_DEFINITION_IDS,
RoleService,
normalizeAgentConnectionResourceIdForRoleAssignment,
Expand Down Expand Up @@ -1102,6 +1104,7 @@ const getDesignerServices = (
getAgentUrl: (isDraftMode?: boolean) =>
fetchAgentUrl(siteResourceId, workflowName, workflowApp?.properties?.defaultHostName ?? '', isDraftMode),
getAppIdentity: () => workflowApp?.identity,
getLogicAppId: () => siteResourceId,
isExplicitAuthRequiredForManagedIdentity: () => true,
isSplitOnSupported: () => !!isStateful,
resubmitWorkflow: async (runId, actionsToResubmit) => {
Expand Down Expand Up @@ -1131,6 +1134,8 @@ const getDesignerServices = (
notifyCallbackUrlUpdate: (triggerName, newTriggerId) => {
alert(`Callback URL for ${triggerName} trigger updated to ${newTriggerId}`);
},
uploadFileArtifact: uploadFileToKnowledgeHub,
isKnowledgeHubEnabled: () => true,
};

const hostService: IHostService = {
Expand Down Expand Up @@ -1203,6 +1208,7 @@ const getDesignerServices = (

const connectionParameterEditorService = new CustomConnectionParameterEditorService();
const editorService = new CustomEditorService(areCustomEditorsEnabled ?? false);
const resourceService = new BaseResourceService({ baseUrl: armUrl, httpClient, apiVersion });

return {
appService,
Expand All @@ -1226,6 +1232,7 @@ const getDesignerServices = (
cognitiveServiceService,
connectionParameterEditorService,
editorService,
resourceService,
userPreferenceService: new BaseUserPreferenceService(),
experimentationService: new BaseExperimentationService(),
};
Expand Down
5 changes: 5 additions & 0 deletions libs/designer-v2/src/lib/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ export default {
DROPDOWN: 'dropdown',
FILEPICKER: 'filepicker',
FLOATINGACTIONMENU: 'floatingactionmenu',
KNOWLEDGE_BASE: 'knowledgebase',
SCHEMA: 'schema',
STRING: 'string',
TABLE: 'table',
Expand Down Expand Up @@ -578,6 +579,10 @@ export default {
OPERATIONS: 'OPERATIONS',
CONNECTIONS: 'CONNECTIONS',
},
KNOWLEDGE_PANEL_TAB_NAMES: {
BASICS: 'BASICS',
MODEL: 'MODEL',
},
ERRORS_PANEL_TAB_NAMES: {
ERRORS: 'ERRORS',
WARNINGS: 'WARNINGS',
Expand Down
51 changes: 51 additions & 0 deletions libs/designer-v2/src/lib/core/actions/bjsworkflow/knowledge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import {
type IConnectionService,
type IConnectionParameterEditorService,
type ILoggerService,
InitCognitiveServiceService,
InitConnectionService,
InitConnectionParameterEditorService,
InitGatewayService,
InitLoggerService,
InitResourceService,
type IResourceService,
DevLogger,
type ICognitiveServiceService,
type IGatewayService,
} from '@microsoft/logic-apps-shared';
import { createAsyncThunk } from '@reduxjs/toolkit';

export interface KnowledgeServiceOptions {
cognitiveService: ICognitiveServiceService;
connectionService: IConnectionService;
connectionParameterEditorService: IConnectionParameterEditorService;
gatewayService: IGatewayService;
resourceService: IResourceService;
loggerService?: ILoggerService;
}

export const initializeData = createAsyncThunk('initializeKnowledgeData', async (services: KnowledgeServiceOptions) => {
initializeServices(services);
return true;
});

export const initializeServices = (services: KnowledgeServiceOptions) => {
const { cognitiveService, connectionService, connectionParameterEditorService, gatewayService, resourceService, loggerService } =
services;

InitCognitiveServiceService(cognitiveService);
InitConnectionService(connectionService);
InitConnectionParameterEditorService(connectionParameterEditorService);
InitGatewayService(gatewayService);
InitResourceService(resourceService);

const loggerServices: ILoggerService[] = [];
if (loggerService) {
loggerServices.push(loggerService);
}
if (process.env.NODE_ENV !== 'production') {
loggerServices.push(new DevLogger());
}

InitLoggerService(loggerServices);
};
Loading
Loading