From 5a443f007f6c7ea51486885560ad72d9749a4d4a Mon Sep 17 00:00:00 2001 From: Clement Seconde Date: Tue, 24 Oct 2023 15:11:19 +0100 Subject: [PATCH 1/2] merging with dev --- CHANGELOG.md | 10 ++++++++++ docs/documentation/docs/about/release-notes.md | 10 ++++++++++ src/common/telemetry/version.ts | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e178f394..58745230 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Releases +## 3.15.0 + +### Fixes + +- `Localization`: Errors in en-gb loc file [#582](https://github.com/pnp/sp-dev-fx-property-controls/pull/582) + +### Contributors + +Special thanks to our contributor: [andrew-lott](https://github.com/andrew-lott). + ## 3.14.0 ### Enhancements diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index e178f394..58745230 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -1,5 +1,15 @@ # Releases +## 3.15.0 + +### Fixes + +- `Localization`: Errors in en-gb loc file [#582](https://github.com/pnp/sp-dev-fx-property-controls/pull/582) + +### Contributors + +Special thanks to our contributor: [andrew-lott](https://github.com/andrew-lott). + ## 3.14.0 ### Enhancements diff --git a/src/common/telemetry/version.ts b/src/common/telemetry/version.ts index 75dc1cab..2a1654fe 100644 --- a/src/common/telemetry/version.ts +++ b/src/common/telemetry/version.ts @@ -1 +1 @@ -export const version: string = "3.14.0"; \ No newline at end of file +export const version: string = "3.15.0"; \ No newline at end of file From 67d879d007061bcf3b2c315ea2192617c5c68bb0 Mon Sep 17 00:00:00 2001 From: Clement Seconde Date: Wed, 25 Oct 2023 10:50:23 +0100 Subject: [PATCH 2/2] fix(FolderTile.tsx): missing locale on date object --- .../OneDriveFilesTab/OneDriveFilesTab.tsx | 6 ++++-- .../SiteFilePickerTab/SiteFilePickerTab.tsx | 4 +++- .../controls/FileBrowser/FileBrowser.tsx | 1 + .../controls/FileBrowser/IFileBrowserProps.ts | 2 ++ .../controls/FolderTile/FolderTile.tsx | 12 +++++++++--- .../controls/FolderTile/IFolderTileProps.ts | 2 ++ .../controls/TilesList/ITilesListProps.ts | 2 ++ .../controls/TilesList/TilesList.tsx | 3 ++- 8 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/propertyFields/filePicker/filePickerControls/OneDriveFilesTab/OneDriveFilesTab.tsx b/src/propertyFields/filePicker/filePickerControls/OneDriveFilesTab/OneDriveFilesTab.tsx index c782b946..52ec4e27 100644 --- a/src/propertyFields/filePicker/filePickerControls/OneDriveFilesTab/OneDriveFilesTab.tsx +++ b/src/propertyFields/filePicker/filePickerControls/OneDriveFilesTab/OneDriveFilesTab.tsx @@ -90,7 +90,7 @@ export class OneDriveFilesTab extends React.Component
- +
{libraryAbsolutePath !== undefined && @@ -101,7 +101,9 @@ export class OneDriveFilesTab extends React.Component} + accepts={accepts} + context={this.props.context} + />}
diff --git a/src/propertyFields/filePicker/filePickerControls/SiteFilePickerTab/SiteFilePickerTab.tsx b/src/propertyFields/filePicker/filePickerControls/SiteFilePickerTab/SiteFilePickerTab.tsx index 450eace8..a15670a9 100644 --- a/src/propertyFields/filePicker/filePickerControls/SiteFilePickerTab/SiteFilePickerTab.tsx +++ b/src/propertyFields/filePicker/filePickerControls/SiteFilePickerTab/SiteFilePickerTab.tsx @@ -59,7 +59,9 @@ export default class SiteFilePickerTab extends React.Component} + accepts={this.props.accepts} + context={this.props.context} + />}
diff --git a/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/FileBrowser.tsx b/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/FileBrowser.tsx index 369d2091..e840d5ac 100644 --- a/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/FileBrowser.tsx +++ b/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/FileBrowser.tsx @@ -198,6 +198,7 @@ export class FileBrowser extends React.Component) } diff --git a/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/IFileBrowserProps.ts b/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/IFileBrowserProps.ts index 32779f6a..ec35ca39 100644 --- a/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/IFileBrowserProps.ts +++ b/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/IFileBrowserProps.ts @@ -1,3 +1,4 @@ +import { BaseComponentContext } from "@microsoft/sp-component-base"; import { FileBrowserService } from "../../../../../services/FileBrowserService"; import { IFile } from "../../../../../services/FileBrowserService.types"; import { IFilePickerResult } from "../../FilePicker.types"; @@ -8,6 +9,7 @@ export interface IFileBrowserProps { libraryId: string; folderPath: string; accepts: string[]; + context: BaseComponentContext; onChange: (filePickerResult: IFilePickerResult) => void; onOpenFolder: (folder: IFile) => void; } diff --git a/src/propertyFields/filePicker/filePickerControls/controls/FolderTile/FolderTile.tsx b/src/propertyFields/filePicker/filePickerControls/controls/FolderTile/FolderTile.tsx index b138c6cd..31c23286 100644 --- a/src/propertyFields/filePicker/filePickerControls/controls/FolderTile/FolderTile.tsx +++ b/src/propertyFields/filePicker/filePickerControls/controls/FolderTile/FolderTile.tsx @@ -3,7 +3,7 @@ import styles from './FolderTile.module.scss'; import { css } from 'office-ui-fabric-react/lib/Utilities'; import { Icon, IconType } from 'office-ui-fabric-react/lib/Icon'; import * as strings from 'PropertyControlStrings'; -import { ScreenWidthMinLarge } from 'office-ui-fabric-react/lib/Styling'; +import { ScreenWidthMinLarge } from 'office-ui-fabric-react/lib/Styling'; import { IFolderTileProps } from './IFolderTileProps'; export class FolderTile extends React.Component { @@ -16,6 +16,12 @@ export class FolderTile extends React.Component { .replace('{1}', item.modifiedFriendly) .replace('{2}', item.modifiedBy) .replace('{3}', `${item.totalFileCount}`); + + // Get the user's locale + const userLocale = this.props.context.pageContext + ? this.props.context.pageContext.cultureInfo.currentCultureName || this.props.context.pageContext.cultureInfo.currentUICultureName // gets the language / locale of the user + : "en-US"; // defaults to American English + return (
{ data-is-sub-focuszone={true} data-disable-click-on-enter={true} data-selection-index={index} - onClick={(_event)=>this.props.onItemInvoked(item)} + onClick={(_event) => this.props.onItemInvoked(item)} >
{ - {item.modified} + {item.modified.toLocaleDateString(userLocale)} diff --git a/src/propertyFields/filePicker/filePickerControls/controls/FolderTile/IFolderTileProps.ts b/src/propertyFields/filePicker/filePickerControls/controls/FolderTile/IFolderTileProps.ts index a6763629..d22b5077 100644 --- a/src/propertyFields/filePicker/filePickerControls/controls/FolderTile/IFolderTileProps.ts +++ b/src/propertyFields/filePicker/filePickerControls/controls/FolderTile/IFolderTileProps.ts @@ -1,5 +1,6 @@ import { IDimensions } from "../../../../../services/IOneDriveService"; import { IFile } from "../../../../../services/FileBrowserService.types"; +import { BaseComponentContext } from "@microsoft/sp-component-base"; export interface IFolderTileProps { item: IFile; @@ -8,4 +9,5 @@ export interface IFolderTileProps { pageWidth: number; onItemInvoked: (item: IFile) => void; tileDimensions: IDimensions; + context: BaseComponentContext; } diff --git a/src/propertyFields/filePicker/filePickerControls/controls/TilesList/ITilesListProps.ts b/src/propertyFields/filePicker/filePickerControls/controls/TilesList/ITilesListProps.ts index 4d687e30..9bf1dd0c 100644 --- a/src/propertyFields/filePicker/filePickerControls/controls/TilesList/ITilesListProps.ts +++ b/src/propertyFields/filePicker/filePickerControls/controls/TilesList/ITilesListProps.ts @@ -2,12 +2,14 @@ import { FileBrowserService } from "../../../../../services/FileBrowserService"; import { IFile } from "../../../../../services/FileBrowserService.types"; import { Selection } from 'office-ui-fabric-react/lib/Selection'; import { IFilePickerResult } from "../../FilePicker.types"; +import { BaseComponentContext } from "@microsoft/sp-component-base"; export interface ITilesListProps { fileBrowserService: FileBrowserService; filePickerResult: IFilePickerResult; selection: Selection; items: IFile[]; + context: BaseComponentContext; onFolderOpen: (item: IFile) => void; onFileSelected: (item: IFile) => void; diff --git a/src/propertyFields/filePicker/filePickerControls/controls/TilesList/TilesList.tsx b/src/propertyFields/filePicker/filePickerControls/controls/TilesList/TilesList.tsx index e3289ddc..36962a21 100644 --- a/src/propertyFields/filePicker/filePickerControls/controls/TilesList/TilesList.tsx +++ b/src/propertyFields/filePicker/filePickerControls/controls/TilesList/TilesList.tsx @@ -118,7 +118,7 @@ export class TilesList extends React.Component { // Group items by folders and files let pageLength: number = 0; - for (let index = itemIndex; index < items.length; index++) { + for (let index = itemIndex;index < items.length;index++) { const element = items[index]; if (element && element.isFolder === isFolder) { pageLength++; @@ -214,6 +214,7 @@ export class TilesList extends React.Component { height: this._rowHeight - TILE_HORZ_PADDING }} onItemInvoked={(itemInvoked: IFile) => this._handleItemInvoked(itemInvoked)} + context={this.props.context} // used to get page locale /> :