Skip to content

Commit

Permalink
Refactors scaffolding action to be based on form (#181)
Browse files Browse the repository at this point in the history
## 🎯 Aim

is to add a scaffolding form for the add new project action

## βœ… What was done

- [X] added new webview for for the create project action

## πŸ”— Related issue

related: #124
  • Loading branch information
Adam-it authored Feb 20, 2024
1 parent 9b11ce4 commit c7762fa
Show file tree
Hide file tree
Showing 14 changed files with 513 additions and 334 deletions.
4 changes: 2 additions & 2 deletions src/constants/ExtensionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const ExtensionTypes = [
{
name: 'Field Customizer',
value: ExtensionType.field,
templates: ['React', 'Minimal', 'No framework']
templates: ['No framework', 'React', 'Minimal']
},
{
name: 'ListView Command Set',
Expand All @@ -27,7 +27,7 @@ export const ExtensionTypes = [
{
name: 'Form Customizer',
value: ExtensionType.formCustomizer,
templates: ['React', 'No framework']
templates: ['No framework', 'React']
},
{
name: 'Search Query Modifier',
Expand Down
10 changes: 10 additions & 0 deletions src/constants/SpfxAddComponentCommandInput.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ComponentType } from './ComponentTypes';
import { ExtensionType } from './ExtensionTypes';

export interface SpfxAddComponentCommandInput {
componentType: ComponentType;
componentName: string;
frameworkType: string;
extensionType: ExtensionType;
aceType: string;
}
6 changes: 6 additions & 0 deletions src/constants/SpfxScaffoldCommandInput.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { SpfxAddComponentCommandInput } from './SpfxAddComponentCommandInput';

export interface SpfxScaffoldCommandInput extends SpfxAddComponentCommandInput {
folderPath: string;
solutionName: string;
}
8 changes: 7 additions & 1 deletion src/constants/WebViewTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// eslint-disable-next-line no-shadow
export enum WebViewType {
samplesGallery = 'samplesGallery',
workflowForm = 'workflowForm'
workflowForm = 'workflowForm',
scaffoldForm = 'scaffoldForm'
}

export const WebViewTypes = [
Expand All @@ -15,5 +16,10 @@ export const WebViewTypes = [
Title: 'Sample Gallery',
homePageUrl: '/sp-dev-fx-samples',
value: WebViewType.samplesGallery
},
{
Title: 'Scaffold Form',
homePageUrl: '/scaffold-form',
value: WebViewType.scaffoldForm
}
];
8 changes: 8 additions & 0 deletions src/constants/WebviewCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ export const WebviewCommand = {
toWebview: {
viewType: 'view-type',
WorkflowCreated: 'workflow-created',
folderPath: 'folder-path',
validateSolutionName: 'validate-solution-name',
validateComponentName: 'validate-component-name',
},
toVSCode: {
useSample: 'use-sample',
redirectTo: 'redirect-to',
logError: 'log-error',
createWorkFlow: 'create-workflow',
createSpfxProject: 'create-spfx-project',
pickFolder: 'pick-folder',
validateSolutionName: 'validate-solution-name',
validateComponentName: 'validate-component-name',
addSpfxComponent: 'add-spfx-component',
}
};
2 changes: 2 additions & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ export * from './FrameworkTypes';
export * from './General';
export * from './GenerateWorkflowCommandInput';
export * from './ProjectFileContent';
export * from './SpfxAddComponentCommandInput';
export * from './SpfxScaffoldCommandInput';
export * from './WebviewCommand';
export * from './WebViewTypes';
Loading

0 comments on commit c7762fa

Please sign in to comment.