Skip to content
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

refactor: migrate office xml addin generator #11714

Merged
merged 16 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 12 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
34 changes: 0 additions & 34 deletions packages/fx-core/resource/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -379,40 +379,6 @@
"core.createProjectQuestion.apiSpec.multipleValidationErrors.message": "Incompatible OpenAPI description document. Check output panel for details.",
"core.createProjectQuestion.apiSpec.multipleValidationErrors.vscode.message": "Incompatible OpenAPI description document. Check [output panel](command:fx-extension.showOutputChannel) for details.",
"core.createProjectQuestion.meArchitecture.title": "Architecture of Search Based Message Extension",
"core.createProjectQuestion.officeXMLAddin.bar.title": "Office Add-in",
"core.createProjectQuestion.officeXMLAddin.bar.detail": "Creating Project.",
"core.createProjectQuestion.officeXMLAddin.mainEntry.title": "Office Add-in",
"core.createProjectQuestion.officeXMLAddin.mainEntry.detail": "Create integration with Outlook, Word, Excel, or PowerPoint",
"core.createProjectQuestion.officeXMLAddin.create.title": "Select to Create an Outlook, Word, Excel, or PowerPoint Add-in",
"core.createProjectQuestion.officeXMLAddin.word.title": "Word Add-in",
"core.createProjectQuestion.officeXMLAddin.word.detail": "Create an add-in that can run in Word across multiple platforms",
"core.createProjectQuestion.officeXMLAddin.word.sso.title": "Add-in with Single Sign On",
"core.createProjectQuestion.officeXMLAddin.word.sso.detail": "Create a Word add-in with Single Sign On capabilities",
"core.createProjectQuestion.officeXMLAddin.word.react.title": "Add-in with React Framework",
"core.createProjectQuestion.officeXMLAddin.word.react.detail": "Create a Word add-in with React framework",
"core.createProjectQuestion.officeXMLAddin.word.create.title": "Create a Word Add-in",
"core.createProjectQuestion.officeXMLAddin.excel.title": "Excel Add-in",
"core.createProjectQuestion.officeXMLAddin.excel.detail": "Extend Excel functionality and access Excel data on multiple platforms",
"core.createProjectQuestion.officeXMLAddin.excel.sso.title": "Add-in with Single Sign On",
"core.createProjectQuestion.officeXMLAddin.excel.sso.detail": "Create an Excel add-in with Single Sign On capabilities",
"core.createProjectQuestion.officeXMLAddin.excel.react.title": "Add-in with React Framework",
"core.createProjectQuestion.officeXMLAddin.excel.react.detail": "Create an Excel add-in with React framework",
"core.createProjectQuestion.officeXMLAddin.excel.cf.shared.title": "Excel Custom Functions Using Shared Runtime",
"core.createProjectQuestion.officeXMLAddin.excel.cf.shared.detail": "Create an Excel add-in leveraging Custom Functions using a Shared Runtime",
"core.createProjectQuestion.officeXMLAddin.excel.cf.js.title": "Excel Custom Functions Using JavaScript-only Runtime",
"core.createProjectQuestion.officeXMLAddin.excel.cf.js.detail": "Create an Excel add-in leveraging Custom Functions using a JavaScript-only Runtime",
"core.createProjectQuestion.officeXMLAddin.excel.create.title": "Create Excel Add-in",
"core.createProjectQuestion.officeXMLAddin.powerpoint.title": "PowerPoint Add-in",
"core.createProjectQuestion.officeXMLAddin.powerpoint.detail": "Build engaging solutions for presentations across platform",
"core.createProjectQuestion.officeXMLAddin.powerpoint.sso.title": "Add-in with Single Sign On",
"core.createProjectQuestion.officeXMLAddin.powerpoint.sso.detail": "PowerPoint add-in with Single Sign On capabilities",
"core.createProjectQuestion.officeXMLAddin.powerpoint.react.title": "Add-in with React Framework",
"core.createProjectQuestion.officeXMLAddin.powerpoint.react.detail": "Create a PowerPoint add-in with React framework",
"core.createProjectQuestion.officeXMLAddin.powerpoint.create.title": "Create a PowerPoint Add-in",
"core.createProjectQuestion.officeXMLAddin.taskpane.title": "Add-in with Basic Task Pane",
"core.createProjectQuestion.officeXMLAddin.taskpane.detail": "Customize the Ribbon with a button and create a dashboard in the Task Pane",
"core.createProjectQuestion.officeXMLAddin.manifestOnly.title": "Add-in Project With only Manifest File",
"core.createProjectQuestion.officeXMLAddin.manifestOnly.detail": "Create an add-in project that includes only the manifest file",
"core.aiAssistantBotOption.label": "AI Agent Bot",
"core.aiAssistantBotOption.detail": "A custom AI Agent bot in Teams using Teams AI library and OpenAI Assistants API",
"core.aiBotOption.label": "AI Chat Bot",
Expand Down
16 changes: 2 additions & 14 deletions packages/fx-core/src/component/coordinator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import {
CapabilityOptions,
CustomCopilotRagOptions,
MeArchitectureOptions,
OfficeAddinHostOptions,
ProjectTypeOptions,
QuestionNames,
ScratchOptions,
Expand All @@ -61,7 +60,6 @@ import { CopilotPluginGenerator } from "../generator/copilotPlugin/generator";
import { Generator } from "../generator/generator";
import { Generators } from "../generator/generatorProvider";
import { OfficeAddinGenerator } from "../generator/officeAddin/generator";
import { OfficeXMLAddinGenerator } from "../generator/officeXMLAddin/generator";
import { SPFxGenerator } from "../generator/spfx/spfxGenerator";
import { Feature2TemplateName } from "../generator/templates/templateNames";
import { convertToLangKey } from "../generator/utils";
Expand Down Expand Up @@ -191,18 +189,8 @@ class Coordinator {
const res = await SPFxGenerator.generate(context, inputs, projectPath);
if (res.isErr()) return err(res.error);
} else if (ProjectTypeOptions.officeAddinAllIds().includes(projectType)) {
const addinHost = inputs[QuestionNames.OfficeAddinHost];
if (
projectType === ProjectTypeOptions.officeXMLAddin().id &&
addinHost &&
addinHost !== OfficeAddinHostOptions.outlook().id
) {
const res = await OfficeXMLAddinGenerator.generate(context, inputs, projectPath);
if (res.isErr()) return err(res.error);
} else {
const res = await OfficeAddinGenerator.generate(context, inputs, projectPath);
if (res.isErr()) return err(res.error);
}
const res = await OfficeAddinGenerator.generate(context, inputs, projectPath);
if (res.isErr()) return err(res.error);
} else if (capability === CapabilityOptions.copilotPluginApiSpec().id) {
const res = await CopilotPluginGenerator.generatePluginFromApiSpec(
context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
// Licensed under the MIT license.
import { CopilotGenerator } from "./copilotPlugin/generator";
import { OfficeAddinGeneratorNew } from "./officeAddin/generator";
import { OfficeXmlAddinGeneratorNew } from "./officeXMLAddin/generator";
import { SPFxGeneratorImport, SPFxGeneratorNew } from "./spfx/spfxGenerator";
import { SsrTabGenerator } from "./templates/ssrTabGenerator";
import { DefaultTemplateGenerator } from "./templates/templateGenerator";

// When multiple generators are activated, only the top one will be executed.
export const Generators = [
new OfficeAddinGeneratorNew(),
new OfficeXmlAddinGeneratorNew(),
new SsrTabGenerator(),
new DefaultTemplateGenerator(),
new SPFxGeneratorNew(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { getLocalizedString } from "../../../common/localizeUtils";
import { assembleError } from "../../../error";
import {
CapabilityOptions,
OfficeAddinHostOptions,
ProgrammingLanguage,
ProjectTypeOptions,
QuestionNames,
Expand Down Expand Up @@ -108,11 +107,7 @@ export class OfficeAddinGenerator {
const capability = inputs[QuestionNames.Capabilities];
const inputHost = inputs[QuestionNames.OfficeAddinHost];
let host: string = inputHost;
if (
projectType === ProjectTypeOptions.outlookAddin().id ||
(projectType === ProjectTypeOptions.officeXMLAddin().id &&
inputHost === OfficeAddinHostOptions.outlook().id)
) {
if (projectType === ProjectTypeOptions.outlookAddin().id) {
host = "outlook";
} else if (projectType === ProjectTypeOptions.officeAddin().id) {
if (capability === "json-taskpane") {
Expand All @@ -133,10 +128,7 @@ export class OfficeAddinGenerator {
if (!fromFolder) {
// from template
const framework = getOfficeAddinFramework(inputs);
const templateConfig = getOfficeAddinTemplateConfig(
projectType,
inputs[QuestionNames.OfficeAddinHost]
);
const templateConfig = getOfficeAddinTemplateConfig();
const projectLink = templateConfig[capability].framework[framework][language];

// Copy project template files from project repository
Expand Down
249 changes: 0 additions & 249 deletions packages/fx-core/src/component/generator/officeXMLAddin/generator.ts

This file was deleted.

Loading
Loading