Skip to content

Commit

Permalink
Merge branch 'release/5.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
nsteenbeek committed Jul 16, 2021
2 parents b9b5d6d + 557d975 commit 41fa001
Show file tree
Hide file tree
Showing 50 changed files with 2,763 additions and 2,288 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
webpack.config.js
webpack.config.ts
bin/*.js
6 changes: 6 additions & 0 deletions bin/Entity/Entity.attributesContext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* This is a generated file, please regenerate and do not modify */

import {EntityAttributeNames} from './Entity.enum';
import FormContext = Xrm.FormContext;

export class EntityFormContext {}
2 changes: 1 addition & 1 deletion bin/Entity/Entity.form.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Translation} from '../translation/Translation';
import {Translation} from '../../translation/Translation';
import {EntityFormContext} from './Entity.formContext';

export class EntityForm extends EntityFormContext {
Expand Down
4 changes: 2 additions & 2 deletions bin/Entity/Entity.formContext.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* This is a generated file, please regenerate and do not modify */

import {EntityAttributeNames} from './Entity.enum';
import {EntityFormContext} from '../Entity.formContext';
import FormContext = Xrm.FormContext;

export class EntityFormContext {}
export class FormNameFormContext extends EntityFormContext {}
13 changes: 10 additions & 3 deletions bin/Entity/Entity.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
import {EntityForm} from './Entity.form';

export const Form = {
// In D365 Form specify Form onLoad function: <%= publisher %>.<%= namespace %>.Entity.Form.onLoad
// In D365 Form '<%= formname %>' specify Form onLoad function: <%= publisher %>.<%= namespace %>.Entity.Form.onLoad
onLoad: async (executionContext: Xrm.Events.EventContext): Promise<void> => {
return EntityForm.onLoad(executionContext);
}
};

export const Ribbon = {
// In Ribbon WorkBench specify function: <%= publisher %>.<%= namespace %>.Entity.Ribbon.myRibbonMethod
// In Ribbon WorkBench specify function: <%= publisher %>.<%= namespace %>.Entity.Ribbon.myRibbonMethod1
// In Ribbon WorkBench specify Xrm Parameter 'Primary Control', which is formContext
myRibbonMethod: (formContext: Xrm.FormContext): void => {
myRibbonMethod1: (formContext: Xrm.FormContext): void => {
console.log(formContext); // Prevent linting error
// EntityForm.myFormMethod(formContext);
},

// In Ribbon WorkBench specify function: <%= publisher %>.<%= namespace %>.Entity.Ribbon.myRibbonMethod2
// In Ribbon WorkBench specify Xrm Parameter 'Primary Control', which is gridControl
myRibbonMethod2: (gridControl: Xrm.Controls.GridControl): void => {
console.log(gridControl); // Prevent linting error
// EntityForm.myFormMethod(gridControl);
}
};
4 changes: 4 additions & 0 deletions bin/Entity/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"forms": [],
"webresources": []
}
23 changes: 23 additions & 0 deletions bin/EnvironmentVariable/EnvironmentVariable.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* This is a generated file, please regenerate and do not modify */
/* eslint-disable max-len */

type ComponentStateValues = 0 | 1 | 2 | 3;

interface EnvironmentVariableModel extends Model {
// Attributes for $select
environmentvariablevalueid?: string; // PrimaryIdAttribute
schemaname?: string; // PrimaryNameAttribute
introducedversion?: string;
componentstate?: ComponentStateValues;
value?: string;
environmentvariabledefinitionid?: string;
overwritetime?: string;
solutionid?: string;
environmentvariablevalueidunique?: string;
ismanaged?: boolean;

// NavigationProperties for $expand
// EnvironmentVariableDefinitionId?: EnvironmentVariableDefinitionModel; // entity EnvironmentVariableDefinition needs to be generated
}

/* eslint-enable max-len */
33 changes: 33 additions & 0 deletions bin/EnvironmentVariable/EnvironmentVariable.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* This is a generated file, please regenerate and do not modify */

import {WebApi} from '../WebApi/WebApi';

export class EnvironmentVariableService {
private static logicalName = 'environmentvariablevalue';
private static async retrieveMultipleRecords(multipleSystemQueryOptions: MultipleSystemQueryOptions): Promise<EnvironmentVariableModel[]> {
return WebApi.retrieveMultipleRecords(EnvironmentVariableService.logicalName, multipleSystemQueryOptions);
}

private static async getEnvironmentVariableValue(schemaname: string): Promise<EnvironmentVariableModel> {
const environmentvariabledefinitions = await WebApi.retrieveMultipleRecords('environmentvariabledefinition', {
select: ['environmentvariabledefinitionid'],
filters: [{
conditions: [{
attribute: 'schemaname',
value: schemaname
}]
}]
});
const environmentvariabledefinition = environmentvariabledefinitions[0] as {environmentvariabledefinitionid: string};
const environmentVariableValues = await EnvironmentVariableService.retrieveMultipleRecords({
select: ['value'],
filters: [{
conditions: [{
attribute: 'environmentvariabledefinitionid',
value: environmentvariabledefinition.environmentvariabledefinitionid
}]
}]
});
return environmentVariableValues[0];
}
}
File renamed without changes.
4 changes: 3 additions & 1 deletion bin/WebresourceTsx/Webresource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ interface WebresourceProps {}
// eslint-disable-next-line no-unused-vars,max-lines-per-function
const Webresource: React.FC<WebresourceProps> = (props: WebresourceProps): JSX.Element => {
const [yourBoolean, setYourBoolean] = useState(false);
console.log(yourBoolean + setYourBoolean); // Prevent linting error
console.log(yourBoolean); // Prevent linting error
console.log(setYourBoolean); // Prevent linting error
console.log(props); // Prevent linting error
// eslint-disable-next-line max-lines-per-function
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion bin/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/root/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
webpack.config.js
webpack.config.ts
karma.conf.js
test-main.js
postcss.config.js
Expand Down
25 changes: 12 additions & 13 deletions bin/root/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
"scripts": {
"build": "npm run clean && webpack --mode development",
"build:prod": "npm run clean && webpack --mode production --bail --progress",
"resx": "node tools/resx.js",
"setFormCustomizable:true": "node tools/setFormCustomizable.js --customizable true",
"setFormCustomizable:false": "node tools/setFormCustomizable.js --customizable false",
"clean": "IF exist dist (rmdir /s /q dist)",
"deploy": "hso-d365 deploy",
"watch": "webpack --watch",
"watch": "webpack --watch --mode development",
"start": "webpack serve",
"starthttps": "webpack serve --https",
"lint": "eslint ./ --ext .js,.ts,.tsx"
"lint": "eslint ./ --ext .js,.ts,.tsx",
"deploy": "hso-d365 deploy",
"resx": "hso-d365 extractTranslations",
"setFormCustomizable:true": "hso-d365 setFormCustomizable true",
"setFormCustomizable:false": "hso-d365 setFormCustomizable false",
"update": "hso-d365 update"
},
"devDependencies": {
"@babel/core": "^7.12.10",
Expand All @@ -24,20 +25,20 @@
"@types/node": "^14.14.14",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/shelljs": "^0.8.9",
"@types/webpack": "^5.28.0",
"@types/xrm": "^9.0.33",
"@typescript-eslint/eslint-plugin": "^4.10.0",
"@typescript-eslint/parser": "^4.10.0",
"adal-angular": "^1.0.18",
"autoprefixer": "^10.1.0",
"babel-loader": "^8.2.2",
"babel-plugin-istanbul": "^6.0.0",
"copy-webpack-plugin": "^7.0.0",
"coverage-istanbul-loader": "^3.0.5",
"cross-env": "^7.0.3",
"css-loader": "^5.0.1",
"cssnano": "^4.1.10",
"eslint": "^7.16.0",
"eslint-loader": "^4.0.2",
"eslint-webpack-plugin": "^2.5.2",
"json-loader": "^0.5.7",
"karma": "^5.2.3",
"karma-chrome-launcher": "^3.1.0",
Expand All @@ -50,22 +51,20 @@
"mini-css-extract-plugin": "^1.3.3",
"moment": "^2.29.1",
"node-sass": "^5.0.0",
"open": "^7.3.0",
"postcss": "^8.2.1",
"postcss-loader": "^4.1.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"replace-in-file-webpack-plugin": "^1.0.6",
"sass-loader": "^10.1.0",
"shelljs": "^0.8.4",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.0.3",
"ts-loader": "^8.0.12",
"ts-node": "^10.1.0",
"typescript": "^4.1.3",
"webpack": "^5.11.0",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^3.11.0",
"xml2js": "^0.4.23"
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
}
Expand Down
4 changes: 1 addition & 3 deletions bin/root/src/Http/Http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ export const jsonHttpHeaders = {
'Content-Type': 'application/json; charset=utf-8'
};

/* eslint-disable @typescript-eslint/no-explicit-any */
export class Http {
public static request(method: Method, url: string, data?: any, httpHeaders: HttpHeaders = {}): Promise<XMLHttpRequest> {
public static request<D>(method: Method, url: string, data?: D, httpHeaders: HttpHeaders = {}): Promise<XMLHttpRequest> {
return new Promise((resolve, reject): void => {
const request = new XMLHttpRequest(),
requestData = data && JSON.stringify(data),
Expand All @@ -31,4 +30,3 @@ export class Http {
});
}
}
/* eslint-enable @typescript-eslint/no-explicit-any */
4 changes: 2 additions & 2 deletions bin/root/src/WebApi/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ export class Service {
Targets: string[];
} {
const attributeMetadata = entityMetadata.Attributes.get(attribute);
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
let attributeDescriptor = attributeMetadata.attributeDescriptor;
if (attributeDescriptor.AttributeOf) {
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
attributeDescriptor = entityMetadata.Attributes.get(attributeDescriptor.AttributeOf).attributeDescriptor;
}
Expand Down
Loading

0 comments on commit 41fa001

Please sign in to comment.