@khester/create-dynamics-app 1.1.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -0
- package/dist/artifacts/registry.d.ts +18 -0
- package/dist/artifacts/registry.d.ts.map +1 -0
- package/dist/artifacts/registry.js +340 -0
- package/dist/artifacts/registry.js.map +1 -0
- package/dist/artifacts/types.d.ts +122 -0
- package/dist/artifacts/types.d.ts.map +1 -0
- package/dist/artifacts/types.js +7 -0
- package/dist/artifacts/types.js.map +1 -0
- package/dist/artifacts/validators.d.ts +16 -0
- package/dist/artifacts/validators.d.ts.map +1 -0
- package/dist/artifacts/validators.js +45 -0
- package/dist/artifacts/validators.js.map +1 -0
- package/dist/fromDesign.d.ts +5 -0
- package/dist/fromDesign.d.ts.map +1 -0
- package/dist/fromDesign.js +98 -0
- package/dist/fromDesign.js.map +1 -0
- package/dist/index.js +129 -177
- package/dist/index.js.map +1 -1
- package/dist/injectDevTools.d.ts +28 -0
- package/dist/injectDevTools.d.ts.map +1 -0
- package/dist/injectDevTools.js +148 -0
- package/dist/injectDevTools.js.map +1 -0
- package/dist/scaffold.d.ts +48 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +180 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/templatePlan.d.ts +3 -0
- package/dist/templatePlan.d.ts.map +1 -0
- package/dist/templatePlan.js +43 -0
- package/dist/templatePlan.js.map +1 -0
- package/dist/utils/copyTemplate.d.ts +13 -1
- package/dist/utils/copyTemplate.d.ts.map +1 -1
- package/dist/utils/copyTemplate.js +98 -4
- package/dist/utils/copyTemplate.js.map +1 -1
- package/dist/utils/updatePackageJson.d.ts +11 -1
- package/dist/utils/updatePackageJson.d.ts.map +1 -1
- package/dist/utils/updatePackageJson.js +12 -10
- package/dist/utils/updatePackageJson.js.map +1 -1
- package/package.json +10 -7
- package/templates/_shared/dev-tools/auth/get-token.js +72 -0
- package/templates/_shared/dev-tools/dev/mock-xrm.js +42 -0
- package/templates/_shared/dev-tools/metadata-sync/index.js +152 -0
- package/templates/_shared/dev-tools/smoke/test-retrieve.js +44 -0
- package/templates/dialog-form/README.md +27 -0
- package/templates/dialog-form/_variants/App.v8.tsx +39 -0
- package/templates/dialog-form/_variants/App.v9.tsx +41 -0
- package/templates/dialog-form/gitignore +5 -0
- package/templates/dialog-form/package.json +27 -0
- package/templates/dialog-form/public/index.html +11 -0
- package/templates/dialog-form/src/index.tsx +10 -0
- package/templates/dialog-form/src/services/dataverse.ts +30 -0
- package/templates/dialog-form/tsconfig.json +15 -0
- package/templates/dialog-form/webpack.config.js +17 -0
- package/templates/grid-customizer/README.md +28 -0
- package/templates/grid-customizer/gitignore +4 -0
- package/templates/grid-customizer/package.json +25 -0
- package/templates/grid-customizer/src/GridCustomizer.ts +28 -0
- package/templates/grid-customizer/src/cell-renderers.tsx +35 -0
- package/templates/grid-customizer/src/index.ts +4 -0
- package/templates/grid-customizer/src/types/grid-types.ts +30 -0
- package/templates/grid-customizer/src/utils/color-utils.ts +24 -0
- package/templates/grid-customizer/tsconfig.json +15 -0
- package/templates/grid-customizer/webpack.config.js +17 -0
- package/templates/pcf-dataset/ControlManifest.Input.xml +16 -0
- package/templates/pcf-dataset/README.md +21 -0
- package/templates/pcf-dataset/gitignore +5 -0
- package/templates/pcf-dataset/index.ts +39 -0
- package/templates/pcf-dataset/package.json +30 -0
- package/templates/pcf-dataset/strings/{{componentName}}.1033.resx +47 -0
- package/templates/pcf-dataset/tsconfig.json +8 -0
- package/templates/pcf-dataset/{{componentName}}Component.tsx +39 -0
- package/templates/pcf-field/ControlManifest.Input.xml +17 -0
- package/templates/pcf-field/README.md +95 -0
- package/templates/pcf-field/_variants/ValueInput.boolean.tsx +24 -0
- package/templates/pcf-field/_variants/ValueInput.date.tsx +27 -0
- package/templates/pcf-field/_variants/ValueInput.number.tsx +35 -0
- package/templates/pcf-field/_variants/ValueInput.text.tsx +27 -0
- package/templates/pcf-field/gitignore +5 -0
- package/templates/pcf-field/index.ts +61 -0
- package/templates/pcf-field/package.json +30 -0
- package/templates/pcf-field/strings/{{componentName}}.1033.resx +47 -0
- package/templates/pcf-field/tsconfig.json +8 -0
- package/templates/pcf-field/{{componentName}}Component.tsx +35 -0
- package/templates/power-pages-starter/gitignore +5 -0
- package/templates/react-custom-page/gitignore +5 -0
- package/templates/{dynamics-365-starter → react-custom-page}/package.json +3 -3
- package/templates/react-custom-page/tools/metadata-sync/index.js +152 -0
- package/templates/static-web-app/README.md +36 -0
- package/templates/static-web-app/_variants/App.v8.tsx +32 -0
- package/templates/static-web-app/_variants/App.v9.tsx +31 -0
- package/templates/static-web-app/api/host.json +12 -0
- package/templates/static-web-app/api/package.json +19 -0
- package/templates/static-web-app/api/src/functions/hello.ts +16 -0
- package/templates/static-web-app/api/tsconfig.json +14 -0
- package/templates/static-web-app/frontend/index.html +12 -0
- package/templates/static-web-app/frontend/package.json +23 -0
- package/templates/static-web-app/frontend/src/index.tsx +8 -0
- package/templates/static-web-app/frontend/tsconfig.json +16 -0
- package/templates/static-web-app/frontend/vite.config.ts +13 -0
- package/templates/static-web-app/gitignore +8 -0
- package/templates/static-web-app/package.json +15 -0
- package/templates/static-web-app/staticwebapp.config.json +7 -0
- package/templates/teams-app/README.md +27 -0
- package/templates/teams-app/_variants/graph.off.ts +7 -0
- package/templates/teams-app/_variants/graph.on.ts +22 -0
- package/templates/teams-app/appPackage/manifest.json +26 -0
- package/templates/teams-app/gitignore +5 -0
- package/templates/teams-app/index.html +12 -0
- package/templates/teams-app/package.json +26 -0
- package/templates/teams-app/src/App.tsx +25 -0
- package/templates/teams-app/src/index.tsx +8 -0
- package/templates/teams-app/tsconfig.json +16 -0
- package/templates/teams-app/vite.config.ts +9 -0
- package/templates/web-resource/README.md +39 -0
- package/templates/web-resource/_variants/App.v8.tsx +29 -0
- package/templates/web-resource/_variants/App.v9.tsx +28 -0
- package/templates/web-resource/gitignore +5 -0
- package/templates/web-resource/package.json +27 -0
- package/templates/web-resource/public/index.html +11 -0
- package/templates/web-resource/src/index.tsx +10 -0
- package/templates/web-resource/src/services/dataverse.ts +30 -0
- package/templates/web-resource/tsconfig.json +15 -0
- package/templates/web-resource/webpack.config.js +17 -0
- package/dist/utils/consultingHelpers.d.ts +0 -13
- package/dist/utils/consultingHelpers.d.ts.map +0 -1
- package/dist/utils/consultingHelpers.js +0 -569
- package/dist/utils/consultingHelpers.js.map +0 -1
- package/templates/dynamics-365-starter/INTEGRATION_TEST_RESULTS.md +0 -302
- package/templates/dynamics-365-starter/PHASE_4_COMPLETION_SUMMARY.md +0 -305
- package/templates/dynamics-365-starter/deployment/QUICKSTART-MAC.md +0 -507
- package/templates/dynamics-365-starter/deployment/QUICKSTART-WINDOWS.md +0 -372
- package/templates/dynamics-365-starter/deployment/pipelines/README.md +0 -375
- package/templates/dynamics-365-starter/deployment/pipelines/azure-pipelines.yml +0 -330
- package/templates/dynamics-365-starter/deployment/pipelines/github-actions.yml +0 -422
- package/templates/dynamics-365-starter/deployment/pipelines/jenkins.groovy +0 -636
- package/templates/dynamics-365-starter/deployment/scripts/deploy.ps1 +0 -417
- package/templates/dynamics-365-starter/deployment/scripts/deploy.sh +0 -582
- package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.ps1 +0 -486
- package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.sh +0 -567
- package/templates/dynamics-365-starter/deployment/scripts/validate-setup.ps1 +0 -703
- package/templates/dynamics-365-starter/deployment/scripts/validate-setup.sh +0 -671
- package/templates/dynamics-365-starter/docs/team-standards/README.md +0 -273
- package/templates/dynamics-365-starter/docs/team-standards/client-onboarding.md +0 -577
- package/templates/dynamics-365-starter/docs/team-standards/code-review-checklist.md +0 -359
- package/templates/dynamics-365-starter/docs/team-standards/coding-standards.md +0 -700
- package/templates/dynamics-365-starter/docs/team-standards/cross-platform-team-guide.md +0 -736
- package/templates/dynamics-365-starter/docs/team-standards/development-workflows.md +0 -727
- package/templates/dynamics-365-starter/docs/troubleshooting/common-errors.md +0 -758
- package/templates/dynamics-365-starter/docs/troubleshooting/platform-specific-issues.md +0 -878
- package/templates/dynamics-365-starter/src/client-project-template/README.md +0 -234
- package/templates/dynamics-365-starter/src/client-project-template/config/client.template.json +0 -114
- package/templates/dynamics-365-starter/src/client-project-template/config/environments/template.json +0 -186
- package/templates/dynamics-365-starter/src/client-project-template/scripts/client-setup.js +0 -667
- package/templates/dynamics-365-starter/src/examples/README.md +0 -52
- package/templates/dynamics-365-starter/src/examples/component-examples/opportunity-management.tsx +0 -625
- package/templates/dynamics-365-starter/src/examples/entity-examples/opportunity-model.ts +0 -545
- package/templates/dynamics-365-starter/src/examples/integration-examples/custom-pcf-wrapper.tsx +0 -722
- package/templates/dynamics-365-starter/src/examples/workflow-examples/sales-workflow.ts +0 -662
- package/templates/dynamics-365-starter/src/page-templates/EntityDashboard.tsx +0 -519
- package/templates/dynamics-365-starter/src/page-templates/EntityDetailPage.tsx +0 -456
- package/templates/dynamics-365-starter/src/page-templates/EntityListPage.tsx +0 -406
- package/templates/dynamics-365-starter/src/page-templates/RelatedEntitiesPage.tsx +0 -578
- package/templates/dynamics-365-starter/src/page-templates/SearchPage.tsx +0 -629
- package/templates/dynamics-365-starter/tools/entity-generator/index.js +0 -168
- package/templates/dynamics-365-starter/tools/entity-generator/templates/constants.template.ts +0 -124
- package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.css +0 -283
- package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.tsx +0 -275
- package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.css +0 -204
- package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.tsx +0 -413
- package/templates/dynamics-365-starter/tools/entity-generator/templates/model.template.ts +0 -250
- package/templates/dynamics-365-starter/tools/metadata-sync/d365-client.js +0 -410
- package/templates/dynamics-365-starter/tools/metadata-sync/index.js +0 -512
- package/templates/dynamics-365-starter/tools/metadata-sync/type-generator.js +0 -675
- /package/templates/{dynamics-365-starter → react-custom-page}/README.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/deployment/README.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/docs/ARCHITECTURE_OVERVIEW.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/docs/BEST_PRACTICES.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/docs/MIGRATION_GUIDE.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/public/index.html +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/scripts/custom-build.js +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountForm.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountForm.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountManagement.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountManagement.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactForm.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactForm.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactManagement.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactManagement.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LogDialog.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingContext.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingDebugPanel.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingDebugPanel.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingProvider.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/logger.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/constants/account.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/constants/contact.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/index.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/models/Account.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/models/BaseEntity.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/models/Contact.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/pcf/ContactControlWrapper.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/pcf/MultiEntityControlWrapper.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/providers/DynamicsProvider.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/services/MockApiService.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/services/ServiceFactory.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/services/XrmApiService.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/styles/index.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/tsconfig.json +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/webpack.config.js +0 -0
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
TextField,
|
|
4
|
-
DatePicker,
|
|
5
|
-
Dropdown,
|
|
6
|
-
IDropdownOption,
|
|
7
|
-
Checkbox,
|
|
8
|
-
PrimaryButton,
|
|
9
|
-
DefaultButton,
|
|
10
|
-
MessageBar,
|
|
11
|
-
MessageBarType,
|
|
12
|
-
Stack,
|
|
13
|
-
Separator
|
|
14
|
-
} from '@fluentui/react';
|
|
15
|
-
// Replace 'SampleEntity' with your actual entity PascalCase name during template processing
|
|
16
|
-
// import { BaseEntity } from '../../models/BaseEntity';
|
|
17
|
-
// import { Logger } from '../../components/Logging/logger';
|
|
18
|
-
import './SampleEntityForm.css';
|
|
19
|
-
|
|
20
|
-
// Template base entity interface - replace with actual BaseEntity during generation
|
|
21
|
-
interface BaseEntity {
|
|
22
|
-
id?: string;
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Template Logger - replace with actual Logger during generation
|
|
27
|
-
const Logger = {
|
|
28
|
-
log: (message: string, source?: string) => console.log(message, source),
|
|
29
|
-
warn: (message: string, source?: string) => console.warn(message, source),
|
|
30
|
-
error: (message: string, source?: string, error?: any) => console.error(message, source, error)
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// Template interfaces - replace with actual entity interface during generation
|
|
34
|
-
interface ISampleEntity {
|
|
35
|
-
id?: string;
|
|
36
|
-
name?: string;
|
|
37
|
-
description?: string;
|
|
38
|
-
priority?: number;
|
|
39
|
-
dueDate?: Date;
|
|
40
|
-
amount?: number;
|
|
41
|
-
isActive?: boolean;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface SampleEntity extends BaseEntity, ISampleEntity {}
|
|
45
|
-
|
|
46
|
-
// Template constants - replace with actual constants during generation
|
|
47
|
-
const SampleEntityConstants = {
|
|
48
|
-
PrimaryNameAttribute: 'name',
|
|
49
|
-
Description: 'description',
|
|
50
|
-
Priority: 'priority',
|
|
51
|
-
DueDate: 'dueDate',
|
|
52
|
-
Amount: 'amount',
|
|
53
|
-
IsActive: 'isActive',
|
|
54
|
-
FieldDisplayNames: {
|
|
55
|
-
name: 'Name',
|
|
56
|
-
description: 'Description',
|
|
57
|
-
priority: 'Priority',
|
|
58
|
-
dueDate: 'Due Date',
|
|
59
|
-
amount: 'Amount',
|
|
60
|
-
isActive: 'Is Active'
|
|
61
|
-
},
|
|
62
|
-
PriorityOptions: {
|
|
63
|
-
Low: 1,
|
|
64
|
-
Medium: 2,
|
|
65
|
-
High: 3,
|
|
66
|
-
Critical: 4
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
interface SampleEntityFormProps {
|
|
71
|
-
sampleEntity?: SampleEntity | null;
|
|
72
|
-
onSave: (sampleEntityData: Partial<ISampleEntity>) => Promise<void>;
|
|
73
|
-
onCancel: () => void;
|
|
74
|
-
readOnly?: boolean;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export const SampleEntityForm: React.FC<SampleEntityFormProps> = ({
|
|
78
|
-
sampleEntity,
|
|
79
|
-
onSave,
|
|
80
|
-
onCancel,
|
|
81
|
-
readOnly = false
|
|
82
|
-
}) => {
|
|
83
|
-
const [formData, setFormData] = useState<Partial<ISampleEntity>>({});
|
|
84
|
-
const [errors, setErrors] = useState<string[]>([]);
|
|
85
|
-
const [saving, setSaving] = useState(false);
|
|
86
|
-
|
|
87
|
-
// Initialize form data
|
|
88
|
-
useEffect(() => {
|
|
89
|
-
if (sampleEntity) {
|
|
90
|
-
setFormData({
|
|
91
|
-
[SampleEntityConstants.PrimaryNameAttribute]: sampleEntity[SampleEntityConstants.PrimaryNameAttribute] || '',
|
|
92
|
-
[SampleEntityConstants.Description]: sampleEntity[SampleEntityConstants.Description] || '',
|
|
93
|
-
[SampleEntityConstants.Priority]: sampleEntity[SampleEntityConstants.Priority] || SampleEntityConstants.PriorityOptions.Medium,
|
|
94
|
-
[SampleEntityConstants.DueDate]: sampleEntity[SampleEntityConstants.DueDate] || null,
|
|
95
|
-
[SampleEntityConstants.Amount]: sampleEntity[SampleEntityConstants.Amount] || 0,
|
|
96
|
-
[SampleEntityConstants.IsActive]: sampleEntity[SampleEntityConstants.IsActive] ?? true
|
|
97
|
-
});
|
|
98
|
-
} else {
|
|
99
|
-
// Default values for new entity
|
|
100
|
-
setFormData({
|
|
101
|
-
[SampleEntityConstants.PrimaryNameAttribute]: '',
|
|
102
|
-
[SampleEntityConstants.Description]: '',
|
|
103
|
-
[SampleEntityConstants.Priority]: SampleEntityConstants.PriorityOptions.Medium,
|
|
104
|
-
[SampleEntityConstants.DueDate]: null,
|
|
105
|
-
[SampleEntityConstants.Amount]: 0,
|
|
106
|
-
[SampleEntityConstants.IsActive]: true
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}, [sampleEntity]);
|
|
110
|
-
|
|
111
|
-
// Handle field changes
|
|
112
|
-
const handleFieldChange = (fieldName: string, value: any) => {
|
|
113
|
-
setFormData(prev => ({
|
|
114
|
-
...prev,
|
|
115
|
-
[fieldName]: value
|
|
116
|
-
}));
|
|
117
|
-
|
|
118
|
-
// Clear errors when user starts typing
|
|
119
|
-
if (errors.length > 0) {
|
|
120
|
-
setErrors([]);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
// Validate form
|
|
125
|
-
const validateForm = (): boolean => {
|
|
126
|
-
const validationErrors: string[] = [];
|
|
127
|
-
|
|
128
|
-
// Required field validation
|
|
129
|
-
if (!formData[SampleEntityConstants.PrimaryNameAttribute]?.trim()) {
|
|
130
|
-
validationErrors.push(`${SampleEntityConstants.FieldDisplayNames[SampleEntityConstants.PrimaryNameAttribute]} is required`);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Additional validation rules
|
|
134
|
-
if (formData[SampleEntityConstants.PrimaryNameAttribute] &&
|
|
135
|
-
formData[SampleEntityConstants.PrimaryNameAttribute].length > 100) {
|
|
136
|
-
validationErrors.push(`${SampleEntityConstants.FieldDisplayNames[SampleEntityConstants.PrimaryNameAttribute]} cannot exceed 100 characters`);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (formData[SampleEntityConstants.Amount] &&
|
|
140
|
-
formData[SampleEntityConstants.Amount] < 0) {
|
|
141
|
-
validationErrors.push(`${SampleEntityConstants.FieldDisplayNames[SampleEntityConstants.Amount]} cannot be negative`);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
setErrors(validationErrors);
|
|
145
|
-
return validationErrors.length === 0;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
// Handle save
|
|
149
|
-
const handleSave = async () => {
|
|
150
|
-
if (!validateForm()) {
|
|
151
|
-
Logger.warn('Sample Entity form validation failed');
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
try {
|
|
156
|
-
setSaving(true);
|
|
157
|
-
Logger.log('Saving Sample Entity form data');
|
|
158
|
-
await onSave(formData);
|
|
159
|
-
} catch (error) {
|
|
160
|
-
Logger.error('Error saving Sample Entity:', error);
|
|
161
|
-
setErrors([error instanceof Error ? error.message : 'Failed to save Sample Entity']);
|
|
162
|
-
} finally {
|
|
163
|
-
setSaving(false);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// Priority options
|
|
168
|
-
const priorityOptions: IDropdownOption[] = Object.entries(SampleEntityConstants.PriorityOptions).map(([key, value]) => ({
|
|
169
|
-
key: value as string | number,
|
|
170
|
-
text: key
|
|
171
|
-
}));
|
|
172
|
-
|
|
173
|
-
return (
|
|
174
|
-
<div className="sample-entity-form">
|
|
175
|
-
{errors.length > 0 && (
|
|
176
|
-
<MessageBar messageBarType={MessageBarType.error}>
|
|
177
|
-
<ul className="sample-entity-form-errors">
|
|
178
|
-
{errors.map((error, index) => (
|
|
179
|
-
<li key={index}>{error}</li>
|
|
180
|
-
))}
|
|
181
|
-
</ul>
|
|
182
|
-
</MessageBar>
|
|
183
|
-
)}
|
|
184
|
-
|
|
185
|
-
<Stack tokens={{ childrenGap: 20 }}>
|
|
186
|
-
{/* Basic Information Section */}
|
|
187
|
-
<div className="sample-entity-form-section">
|
|
188
|
-
<h3 className="sample-entity-form-section-title">Basic Information</h3>
|
|
189
|
-
|
|
190
|
-
<TextField
|
|
191
|
-
label={SampleEntityConstants.FieldDisplayNames[SampleEntityConstants.PrimaryNameAttribute]}
|
|
192
|
-
required
|
|
193
|
-
value={formData[SampleEntityConstants.PrimaryNameAttribute] || ''}
|
|
194
|
-
onChange={(_, newValue) => handleFieldChange(SampleEntityConstants.PrimaryNameAttribute, newValue)}
|
|
195
|
-
disabled={readOnly}
|
|
196
|
-
placeholder="Enter Sample Entity name"
|
|
197
|
-
maxLength={100}
|
|
198
|
-
className="sample-entity-form-field"
|
|
199
|
-
/>
|
|
200
|
-
|
|
201
|
-
<TextField
|
|
202
|
-
label={SampleEntityConstants.FieldDisplayNames[SampleEntityConstants.Description]}
|
|
203
|
-
multiline
|
|
204
|
-
rows={3}
|
|
205
|
-
value={formData[SampleEntityConstants.Description] || ''}
|
|
206
|
-
onChange={(_, newValue) => handleFieldChange(SampleEntityConstants.Description, newValue)}
|
|
207
|
-
disabled={readOnly}
|
|
208
|
-
placeholder="Enter description"
|
|
209
|
-
className="sample-entity-form-field"
|
|
210
|
-
/>
|
|
211
|
-
|
|
212
|
-
<Dropdown
|
|
213
|
-
label={SampleEntityConstants.FieldDisplayNames[SampleEntityConstants.Priority]}
|
|
214
|
-
options={priorityOptions}
|
|
215
|
-
selectedKey={formData[SampleEntityConstants.Priority]}
|
|
216
|
-
onChange={(_, option) => handleFieldChange(SampleEntityConstants.Priority, option?.key)}
|
|
217
|
-
disabled={readOnly}
|
|
218
|
-
className="sample-entity-form-field"
|
|
219
|
-
/>
|
|
220
|
-
</div>
|
|
221
|
-
|
|
222
|
-
<Separator />
|
|
223
|
-
|
|
224
|
-
{/* Additional Details Section */}
|
|
225
|
-
<div className="sample-entity-form-section">
|
|
226
|
-
<h3 className="sample-entity-form-section-title">Additional Details</h3>
|
|
227
|
-
|
|
228
|
-
<DatePicker
|
|
229
|
-
label={SampleEntityConstants.FieldDisplayNames[SampleEntityConstants.DueDate]}
|
|
230
|
-
value={formData[SampleEntityConstants.DueDate] ? new Date(formData[SampleEntityConstants.DueDate]) : undefined}
|
|
231
|
-
onSelectDate={(date) => handleFieldChange(SampleEntityConstants.DueDate, date)}
|
|
232
|
-
disabled={readOnly}
|
|
233
|
-
placeholder="Select due date"
|
|
234
|
-
ariaLabel="Due date"
|
|
235
|
-
className="sample-entity-form-field"
|
|
236
|
-
/>
|
|
237
|
-
|
|
238
|
-
<TextField
|
|
239
|
-
label={SampleEntityConstants.FieldDisplayNames[SampleEntityConstants.Amount]}
|
|
240
|
-
type="number"
|
|
241
|
-
value={formData[SampleEntityConstants.Amount]?.toString() || '0'}
|
|
242
|
-
onChange={(_, newValue) => handleFieldChange(SampleEntityConstants.Amount, parseFloat(newValue || '0'))}
|
|
243
|
-
disabled={readOnly}
|
|
244
|
-
prefix="$"
|
|
245
|
-
className="sample-entity-form-field"
|
|
246
|
-
/>
|
|
247
|
-
|
|
248
|
-
<Checkbox
|
|
249
|
-
label={SampleEntityConstants.FieldDisplayNames[SampleEntityConstants.IsActive]}
|
|
250
|
-
checked={formData[SampleEntityConstants.IsActive] ?? true}
|
|
251
|
-
onChange={(_, checked) => handleFieldChange(SampleEntityConstants.IsActive, checked)}
|
|
252
|
-
disabled={readOnly}
|
|
253
|
-
className="sample-entity-form-field"
|
|
254
|
-
/>
|
|
255
|
-
</div>
|
|
256
|
-
|
|
257
|
-
{/* Action Buttons */}
|
|
258
|
-
{!readOnly && (
|
|
259
|
-
<Stack horizontal horizontalAlign="end" tokens={{ childrenGap: 10 }}>
|
|
260
|
-
<DefaultButton
|
|
261
|
-
text="Cancel"
|
|
262
|
-
onClick={onCancel}
|
|
263
|
-
disabled={saving}
|
|
264
|
-
/>
|
|
265
|
-
<PrimaryButton
|
|
266
|
-
text={sampleEntity ? "Update" : "Create"}
|
|
267
|
-
onClick={handleSave}
|
|
268
|
-
disabled={saving}
|
|
269
|
-
/>
|
|
270
|
-
</Stack>
|
|
271
|
-
)}
|
|
272
|
-
</Stack>
|
|
273
|
-
</div>
|
|
274
|
-
);
|
|
275
|
-
};
|
package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.css
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
/* {{displayName}} Management Component Styles */
|
|
2
|
-
/* Generated by Entity Generator */
|
|
3
|
-
/* Replace 'sample-entity' with your actual entity name during template processing */
|
|
4
|
-
|
|
5
|
-
.sample-entity-management {
|
|
6
|
-
padding: 20px;
|
|
7
|
-
max-width: 100%;
|
|
8
|
-
min-height: 400px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.sample-entity-management-title {
|
|
12
|
-
margin: 0 0 20px 0;
|
|
13
|
-
font-size: 24px;
|
|
14
|
-
font-weight: 600;
|
|
15
|
-
color: #323130;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.sample-entity-management-command-bar {
|
|
19
|
-
margin-bottom: 16px;
|
|
20
|
-
border-bottom: 1px solid #edebe9;
|
|
21
|
-
padding-bottom: 8px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.sample-entity-management-loading {
|
|
25
|
-
display: flex;
|
|
26
|
-
justify-content: center;
|
|
27
|
-
align-items: center;
|
|
28
|
-
min-height: 200px;
|
|
29
|
-
flex-direction: column;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.sample-entity-management-list {
|
|
33
|
-
margin-top: 10px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.sample-entity-management-name-link {
|
|
37
|
-
color: #0078d4;
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
text-decoration: none;
|
|
40
|
-
font-weight: 500;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.sample-entity-management-name-link:hover {
|
|
44
|
-
text-decoration: underline;
|
|
45
|
-
color: #106ebe;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* Responsive design */
|
|
49
|
-
@media (max-width: 768px) {
|
|
50
|
-
.sample-entity-management {
|
|
51
|
-
padding: 10px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.sample-entity-management-title {
|
|
55
|
-
font-size: 20px;
|
|
56
|
-
margin-bottom: 15px;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* List row hover effects */
|
|
61
|
-
.sample-entity-management-list .ms-DetailsRow:hover {
|
|
62
|
-
background-color: #f8f9fa;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.sample-entity-management-list .ms-DetailsRow.is-selected {
|
|
66
|
-
background-color: #deecf9;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* Command bar customizations */
|
|
70
|
-
.sample-entity-management-command-bar .ms-CommandBar {
|
|
71
|
-
background-color: transparent;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.sample-entity-management-command-bar .ms-CommandBarItem-link {
|
|
75
|
-
color: #323130;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.sample-entity-management-command-bar .ms-CommandBarItem-link:hover {
|
|
79
|
-
background-color: #f3f2f1;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.sample-entity-management-command-bar .ms-CommandBarItem-link:disabled {
|
|
83
|
-
color: #a19f9d;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* Loading spinner */
|
|
87
|
-
.sample-entity-management-loading .ms-Spinner-label {
|
|
88
|
-
margin-top: 10px;
|
|
89
|
-
color: #605e5c;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/* Message bar styling */
|
|
93
|
-
.sample-entity-management .ms-MessageBar {
|
|
94
|
-
margin-bottom: 16px;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/* Panel content spacing */
|
|
98
|
-
.sample-entity-management .ms-Panel-main .ms-Panel-contentInner {
|
|
99
|
-
padding: 0 24px 20px 24px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* Details list column headers */
|
|
103
|
-
.sample-entity-management-list .ms-DetailsHeader-cell {
|
|
104
|
-
font-weight: 600;
|
|
105
|
-
color: #323130;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/* Priority column styling */
|
|
109
|
-
.sample-entity-management-list .priority-high {
|
|
110
|
-
color: #d13438;
|
|
111
|
-
font-weight: 600;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.sample-entity-management-list .priority-medium {
|
|
115
|
-
color: #ff8c00;
|
|
116
|
-
font-weight: 500;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.sample-entity-management-list .priority-low {
|
|
120
|
-
color: #107c10;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.sample-entity-management-list .priority-critical {
|
|
124
|
-
color: #a4262c;
|
|
125
|
-
font-weight: 700;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/* Date column styling */
|
|
129
|
-
.sample-entity-management-list .date-column {
|
|
130
|
-
color: #605e5c;
|
|
131
|
-
font-size: 13px;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/* Empty state */
|
|
135
|
-
.sample-entity-management-empty {
|
|
136
|
-
text-align: center;
|
|
137
|
-
padding: 40px 20px;
|
|
138
|
-
color: #605e5c;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.sample-entity-management-empty-icon {
|
|
142
|
-
font-size: 48px;
|
|
143
|
-
color: #a19f9d;
|
|
144
|
-
margin-bottom: 16px;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.sample-entity-management-empty-title {
|
|
148
|
-
font-size: 18px;
|
|
149
|
-
font-weight: 600;
|
|
150
|
-
margin-bottom: 8px;
|
|
151
|
-
color: #323130;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.sample-entity-management-empty-description {
|
|
155
|
-
font-size: 14px;
|
|
156
|
-
margin-bottom: 20px;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/* Error state */
|
|
160
|
-
.sample-entity-management-error {
|
|
161
|
-
text-align: center;
|
|
162
|
-
padding: 40px 20px;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.sample-entity-management-error-icon {
|
|
166
|
-
font-size: 48px;
|
|
167
|
-
color: #d13438;
|
|
168
|
-
margin-bottom: 16px;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.sample-entity-management-error-title {
|
|
172
|
-
font-size: 18px;
|
|
173
|
-
font-weight: 600;
|
|
174
|
-
margin-bottom: 8px;
|
|
175
|
-
color: #d13438;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.sample-entity-management-error-description {
|
|
179
|
-
font-size: 14px;
|
|
180
|
-
color: #605e5c;
|
|
181
|
-
margin-bottom: 20px;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/* Accessibility improvements */
|
|
185
|
-
.sample-entity-management-name-link:focus {
|
|
186
|
-
outline: 2px solid #0078d4;
|
|
187
|
-
outline-offset: 2px;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/* Print styles */
|
|
191
|
-
@media print {
|
|
192
|
-
.sample-entity-management-command-bar {
|
|
193
|
-
display: none;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.sample-entity-management {
|
|
197
|
-
padding: 0;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.sample-entity-management-title {
|
|
201
|
-
font-size: 18px;
|
|
202
|
-
margin-bottom: 10px;
|
|
203
|
-
}
|
|
204
|
-
}
|