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

Release/0.23.2 #953

Merged
merged 54 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
42cbb84
Bump follow-redirects from 1.15.3 to 1.15.4
dependabot[bot] Jan 11, 2024
4296b25
Fixed a localization fallback issue
valadas Feb 14, 2024
1eb2ec7
Merge pull request #917 from DNNCommunity/dependabot/npm_and_yarn/fol…
valadas Feb 14, 2024
cd083e7
Bump @types/node from 20.10.0 to 20.11.17
dependabot[bot] Feb 14, 2024
b980b14
Bump @storybook/addon-a11y from 7.5.3 to 7.6.15
dependabot[bot] Feb 14, 2024
00a0a9d
Bump @storybook/blocks from 7.5.3 to 7.6.15
dependabot[bot] Feb 14, 2024
a557f7e
Bump @babel/preset-env from 7.23.3 to 7.23.9
dependabot[bot] Feb 14, 2024
6549e34
Merge pull request #926 from valadas/localization-fallback
david-poindexter Feb 14, 2024
7de2089
Updated Nuke to v8.0.0
valadas Feb 14, 2024
1adbd52
Merge pull request #921 from DNNCommunity/dependabot/npm_and_yarn/bab…
valadas Feb 14, 2024
7b2c8fd
Merge pull request #931 from valadas/nuke-8.0.0
valadas Feb 14, 2024
6e4f6a4
Merge pull request #927 from DNNCommunity/dependabot/npm_and_yarn/typ…
valadas Feb 14, 2024
f81c409
Merge pull request #928 from DNNCommunity/dependabot/npm_and_yarn/sto…
valadas Feb 14, 2024
384af24
Merge pull request #930 from DNNCommunity/dependabot/npm_and_yarn/sto…
valadas Feb 14, 2024
3f3e869
Bump @storybook/react-webpack5 from 7.5.3 to 7.6.15
dependabot[bot] Feb 14, 2024
635718a
Merge pull request #929 from DNNCommunity/dependabot/npm_and_yarn/sto…
valadas Feb 14, 2024
fb24973
Bump @types/jest from 29.5.10 to 29.5.12
dependabot[bot] Feb 14, 2024
0cb5726
Bump @storybook/addon-interactions from 7.5.3 to 7.6.15
dependabot[bot] Feb 14, 2024
8a56158
Bump @types/react from 18.2.39 to 18.2.55
dependabot[bot] Feb 14, 2024
a32d162
Bump @stencil/core from 4.8.0 to 4.12.2
dependabot[bot] Feb 14, 2024
a238549
Bump lit from 3.1.0 to 3.1.2
dependabot[bot] Feb 14, 2024
98791c8
Merge pull request #932 from DNNCommunity/dependabot/npm_and_yarn/typ…
valadas Feb 14, 2024
06a75f3
Merge pull request #933 from DNNCommunity/dependabot/npm_and_yarn/sto…
valadas Feb 14, 2024
740f079
Merge pull request #934 from DNNCommunity/dependabot/npm_and_yarn/typ…
valadas Feb 14, 2024
581281d
Merge pull request #935 from DNNCommunity/dependabot/npm_and_yarn/ste…
valadas Feb 14, 2024
520efbe
Merge pull request #936 from DNNCommunity/dependabot/npm_and_yarn/lit…
valadas Feb 14, 2024
4f50303
Bump lerna from 8.0.0 to 8.1.2
dependabot[bot] Feb 14, 2024
0c4f505
Bump @storybook/web-components from 7.5.3 to 7.6.15
dependabot[bot] Feb 14, 2024
16727a1
Bump axe-playwright from 1.2.3 to 2.0.1
dependabot[bot] Feb 14, 2024
b8b77fe
Bump @stencil/sass from 3.0.7 to 3.0.9
dependabot[bot] Feb 14, 2024
62a7d3e
Merge pull request #937 from DNNCommunity/dependabot/npm_and_yarn/ler…
valadas Feb 14, 2024
2afb48b
Merge pull request #938 from DNNCommunity/dependabot/npm_and_yarn/sto…
valadas Feb 14, 2024
a68a931
Merge pull request #939 from DNNCommunity/dependabot/npm_and_yarn/axe…
valadas Feb 14, 2024
8a129f2
Merge pull request #940 from DNNCommunity/dependabot/npm_and_yarn/ste…
valadas Feb 14, 2024
604efb8
Bump @storybook/web-components-webpack5 from 7.5.3 to 7.6.15
dependabot[bot] Feb 14, 2024
45c9f30
Bump storybook from 7.5.3 to 7.6.15
dependabot[bot] Feb 14, 2024
367b6c2
Bump license-checker-rseidelsohn from 4.2.11 to 4.3.0
dependabot[bot] Feb 14, 2024
cb85de7
Bump gh-pages from 6.1.0 to 6.1.1
dependabot[bot] Feb 14, 2024
05f7c56
Merge pull request #942 from DNNCommunity/dependabot/npm_and_yarn/sto…
valadas Feb 14, 2024
5152e5e
Merge pull request #943 from DNNCommunity/dependabot/npm_and_yarn/sto…
valadas Feb 14, 2024
e62e033
Merge pull request #944 from DNNCommunity/dependabot/npm_and_yarn/lic…
valadas Feb 14, 2024
d9d293a
Merge pull request #945 from DNNCommunity/dependabot/npm_and_yarn/gh-…
valadas Feb 14, 2024
30d6b87
Bump @storybook/addon-essentials from 7.5.3 to 7.6.15
dependabot[bot] Feb 14, 2024
9ddfb0c
Bump @typescript-eslint/parser from 4.33.0 to 7.0.1
dependabot[bot] Feb 14, 2024
b726933
Bump @storybook/addon-links from 7.5.3 to 7.6.15
dependabot[bot] Feb 14, 2024
e13c2fb
Merge pull request #946 from DNNCommunity/dependabot/npm_and_yarn/sto…
valadas Feb 14, 2024
025e163
Merge pull request #948 from DNNCommunity/dependabot/npm_and_yarn/typ…
valadas Feb 14, 2024
775a65a
Merge pull request #949 from DNNCommunity/dependabot/npm_and_yarn/sto…
valadas Feb 14, 2024
52e7365
Bump @typescript-eslint/eslint-plugin from 6.13.0 to 7.0.1
dependabot[bot] Feb 14, 2024
00f3e08
Bump eslint from 7.32.0 to 8.56.0
dependabot[bot] Feb 14, 2024
5f8acea
Merge pull request #950 from DNNCommunity/dependabot/npm_and_yarn/typ…
valadas Feb 14, 2024
a052f1d
Merge pull request #951 from DNNCommunity/dependabot/npm_and_yarn/esl…
valadas Feb 14, 2024
2931290
Fixed a casing issue on validation of allowed extensions
valadas Feb 14, 2024
9b365ba
Merge pull request #952 from valadas/extension-casing-issue
valadas Feb 14, 2024
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
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
_build/
.nuke/temp/
.vs/
.vscode/
.vscode/
_build/bin
_build/obj
2 changes: 1 addition & 1 deletion _build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="7.0.6" />
<PackageReference Include="Nuke.Common" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fi

echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"

if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "NUKE_ENTERPRISE_TOKEN" != "" ]]; then
if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then
"$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true
"$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true
fi
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.400-preview.23330.10",
"version": "8.0.100",
"rollForward": "latestMajor"
}
}
11,931 changes: 5,729 additions & 6,202 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions packages/stencil-library/custom-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@
"type": {
"text": "string[]"
},
"description": "A list of allowed file extensions.\nIf not specified, any file is allowed.\nEx: [\"jpg\", \"jped\", \"gif\", \"png\"]",
"description": "A list of allowed file extensions.\nIf not specified, any file is allowed.\nEx: [\"jpg\", \"jpeg\", \"gif\", \"png\"]",
"required": false
},
{
Expand Down Expand Up @@ -665,10 +665,9 @@
"kind": "field",
"name": "resx",
"type": {
"text": "{ capture: string; dragAndDropFile: string; or: string; takePicture: string; uploadFile: string; imageTooSmall: string; modalCloseText: string; }"
"text": "ImageCropperResx"
},
"description": "Can be used to customize controls text.\nSome values support tokens, see default values for examples.",
"default": "{\n capture: \"Capture\",\n dragAndDropFile: \"Drag and drop an image\",\n or: \"or\",\n takePicture: \"Take a picture\",\n uploadFile: \"Upload an image\",\n imageTooSmall: \"The image you are attempting to upload does not meet the minimum size requirement of {width} pixels by {height} pixels. Please upload a larger image.\",\n modalCloseText: \"Close\",\n }",
"required": false
},
{
Expand Down Expand Up @@ -1100,7 +1099,6 @@
"text": "ILocalization"
},
"description": "Optionally allows localizing the component strings.",
"default": "{\n Add: \"Add\",\n AllRoles: \"All Roles\",\n FilterByGroup: \"Filter By Group\",\n GlobalRoles: \"Global Roles\",\n Role: \"Role\",\n RolePermissions: \"Role Permissions\",\n SelectRole: \"Select Role\",\n User: \"User\",\n UserPermissions: \"User Permissions\",\n }",
"required": false
},
{
Expand Down
3 changes: 2 additions & 1 deletion packages/stencil-library/licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"@dnncommunity/[email protected]": {
"licenses": "MIT",
"repository": "https://github.com/dnncommunity/dnn-elements",
"path": ""
"path": "",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\README.md"
},
"@eslint/[email protected]": {
"licenses": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions packages/stencil-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"deploy-storybook": "gh-pages -d storybook-static --branch site"
},
"devDependencies": {
"@stencil/core": "4.8.0",
"@stencil/core": "4.12.2",
"@stencil/eslint-plugin": "^0.4.0",
"@stencil/react-output-target": "^0.5.1",
"@stencil/sass": "^3.0.4",
Expand All @@ -45,9 +45,9 @@
"@storybook/web-components-webpack5": "^7.5.3",
"@timkendrick/monaco-editor": "^0.0.9",
"@types/jest": "^29.5.10",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"axe-playwright": "^1.2.3",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"axe-playwright": "^2.0.1",
"babel-loader": "^9.1.2",
"eslint": "^8.51.0",
"eslint-plugin-react": "^7.16.0",
Expand Down
26 changes: 6 additions & 20 deletions packages/stencil-library/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { DnnColorInfo } from "./components/dnn-color-input/dnn-color-info";
import { ColorInfo } from "./utilities/colorInfo";
import { DropzoneResx } from "./components/dnn-dropzone/types";
import { ImageCropperResx } from "./components/dnn-image-cropper/types";
import { IPermissions } from "./components/dnn-permissions-grid/permissions-interface";
import { IRoleGroup } from "./components/dnn-permissions-grid/role-group-interface";
import { IRole } from "./components/dnn-permissions-grid/role-interface";
Expand All @@ -18,6 +19,7 @@ import { DnnToggleChangeEventDetail } from "./components/dnn-toggle/toggle-inter
export { DnnColorInfo } from "./components/dnn-color-input/dnn-color-info";
export { ColorInfo } from "./utilities/colorInfo";
export { DropzoneResx } from "./components/dnn-dropzone/types";
export { ImageCropperResx } from "./components/dnn-image-cropper/types";
export { IPermissions } from "./components/dnn-permissions-grid/permissions-interface";
export { IRoleGroup } from "./components/dnn-permissions-grid/role-group-interface";
export { IRole } from "./components/dnn-permissions-grid/role-interface";
Expand Down Expand Up @@ -183,7 +185,7 @@ export namespace Components {
*/
"allowCameraMode": boolean;
/**
* A list of allowed file extensions. If not specified, any file is allowed. Ex: ["jpg", "jped", "gif", "png"]
* A list of allowed file extensions. If not specified, any file is allowed. Ex: ["jpg", "jpeg", "gif", "png"]
*/
"allowedExtensions": string[];
/**
Expand Down Expand Up @@ -224,15 +226,7 @@ export namespace Components {
/**
* Can be used to customize controls text. Some values support tokens, see default values for examples.
*/
"resx": {
capture: string;
dragAndDropFile: string;
or: string;
takePicture: string;
uploadFile: string;
imageTooSmall: string;
modalCloseText: string;
};
"resx": ImageCropperResx;
/**
* Sets the desired final image width.
*/
Expand Down Expand Up @@ -1178,7 +1172,7 @@ declare namespace LocalJSX {
*/
"allowCameraMode"?: boolean;
/**
* A list of allowed file extensions. If not specified, any file is allowed. Ex: ["jpg", "jped", "gif", "png"]
* A list of allowed file extensions. If not specified, any file is allowed. Ex: ["jpg", "jpeg", "gif", "png"]
*/
"allowedExtensions"?: string[];
/**
Expand Down Expand Up @@ -1223,15 +1217,7 @@ declare namespace LocalJSX {
/**
* Can be used to customize controls text. Some values support tokens, see default values for examples.
*/
"resx"?: {
capture: string;
dragAndDropFile: string;
or: string;
takePicture: string;
uploadFile: string;
imageTooSmall: string;
modalCloseText: string;
};
"resx"?: ImageCropperResx;
/**
* Sets the desired final image width.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Host, h, Prop, State, Event, EventEmitter } from '@stencil/core';
import { Component, Host, h, Prop, State, Event, EventEmitter, Watch } from '@stencil/core';
import { getReadableFileSizeString } from '../../utilities/stringUtilities';
import { DropzoneResx } from './types';

Expand All @@ -9,11 +9,11 @@ import { DropzoneResx } from './types';
})
export class DnnDropzone {
/** Localization strings */
@Prop({mutable:true}) resx:DropzoneResx;
@Prop() resx:DropzoneResx;

/** A list of allowed file extensions.
* If not specified, any file is allowed.
* Ex: ["jpg", "jped", "gif", "png"]
* Ex: ["jpg", "jpeg", "gif", "png"]
*/
@Prop() allowedExtensions: string[];

Expand Down Expand Up @@ -45,6 +45,8 @@ export class DnnDropzone {
@State() fileTooLarge: boolean = false;

@State() invalidExtension: boolean = false;

@State() localResx: DropzoneResx;


private dropzone: HTMLElement;
Expand All @@ -64,7 +66,7 @@ export class DnnDropzone {
}

componentWillLoad() {
this.resx = {...this.defaultResx, ...this.resx}
this.mergeResx();
}

componentDidLoad() {
Expand All @@ -79,6 +81,15 @@ export class DnnDropzone {
}
}

@Watch('resx')
resxChanged() {
this.mergeResx();
}

private mergeResx(): void {
this.localResx = {...this.defaultResx, ...this.resx};
}

private checkIfBrowserCanTakeSnapshots(): Promise<boolean> {
return new Promise((resolve) => {
const mediaDevices = navigator.mediaDevices;
Expand Down Expand Up @@ -146,12 +157,13 @@ export class DnnDropzone {
for (let fileIndex = 0; fileIndex < files.length; fileIndex++) {
const file = files[fileIndex];
var regex = /(?:\.([^.]+))?$/;
const fileExtension = regex.exec(file.name)[1];
const fileExtension = regex.exec(file.name)[1]?.toLowerCase();
if (fileExtension == undefined){
hasInvalid = true;
}

if (this.allowedExtensions != undefined && !this.allowedExtensions.includes(fileExtension)){
var loweredAllowedExtensions = this.allowedExtensions.map(e => e.toLowerCase());
if (this.allowedExtensions != undefined && !loweredAllowedExtensions.includes(fileExtension)){
hasInvalid = true;
}

Expand Down Expand Up @@ -208,6 +220,12 @@ export class DnnDropzone {
this.filesSelected.emit(fileList)
}, "image/jpeg", this.captureQuality);
}

private getInvalidExtensionsMessage() {
var message = this.localResx.allowedFileExtensions;
var message = message.replace("{0}", this.allowedExtensions.join(", "));
return message;
}

render() {
return (
Expand All @@ -220,9 +238,9 @@ export class DnnDropzone {
>
{!this.takingPicture &&
[
<p>{this.resx?.dragAndDropFile}</p>
<p>{this.localResx?.dragAndDropFile}</p>
,
<p>- {this.resx?.or} -</p>
<p>- {this.localResx?.or} -</p>
,
<label class="upload-file">
<input
Expand All @@ -235,18 +253,18 @@ export class DnnDropzone {
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/></g><g><path d="M5,20h14v-2H5V20z M5,10h4v6h6v-6h4l-7-7L5,10z"/></g></svg>
</span>
&nbsp;
{this.resx?.uploadFile}
{this.localResx?.uploadFile}
</label>
,
this.canTakeSnapshots &&
[
<p>- {this.resx?.or} -</p>
<p>- {this.localResx?.or} -</p>
,
<button
onClick={() => this.takeSnapshot()}
>
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><circle cx="12" cy="12" r="3.2"/><path d="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"/></svg>
{this.resx?.takePicture}
{this.localResx?.takePicture}
</button>
]
]
Expand All @@ -258,30 +276,29 @@ export class DnnDropzone {
onClick={() => this.applySnapshot()}
>
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><circle cx="12" cy="12" r="3.2"/><path d="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"/></svg>&nbsp;
{this.resx?.capture}
{this.localResx?.capture}
</button>
</div>
}
{ this.fileTooLarge &&
<div class='error'>
<p>
{this.resx.uploadSizeTooLarge}
{this.localResx.uploadSizeTooLarge}
<br/>
{this.resx.fileSizeLimit.replace("{0}", getReadableFileSizeString(this.maxFileSize)) }
{this.localResx.fileSizeLimit.replace("{0}", getReadableFileSizeString(this.maxFileSize)) }
</p>
</div>
}
{ this.invalidExtension &&
<div class='error'>
<p>
{this.resx.invalidExtension}
{this.localResx.invalidExtension}
<br/>
{this.resx.allowedFileExtensions.replace("{0}", this.allowedExtensions.join(", ")) }
{this.getInvalidExtensionsMessage()}
</p>
</div>
}
</Host>
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
| Property | Attribute | Description | Type | Default |
| ------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | ----------- |
| `allowCameraMode` | `allow-camera-mode` | If true, will allow the user to take a snapshot using the device camera. (only works over https). | `boolean` | `false` |
| `allowedExtensions` | -- | A list of allowed file extensions. If not specified, any file is allowed. Ex: ["jpg", "jped", "gif", "png"] | `string[]` | `undefined` |
| `allowedExtensions` | -- | A list of allowed file extensions. If not specified, any file is allowed. Ex: ["jpg", "jpeg", "gif", "png"] | `string[]` | `undefined` |
| `captureQuality` | `capture-quality` | Specifies the jpeg quality for when the device camera is used to generate a picture. Needs to be a number between 0 and 1 and defaults to 0.8 | `number` | `0.8` |
| `maxFileSize` | `max-file-size` | Max file size in bytes. | `number` | `undefined` |
| `resx` | -- | Localization strings | `DropzoneResx` | `undefined` |
Expand Down
Loading
Loading