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

Merge for 1.13.2 #310

Merged
merged 38 commits into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6d5d7e1
Make DateTimePicker respect isMonthPickerVisible
robert-lindstrom Apr 26, 2019
023c83a
calendar translations
ltdu Apr 27, 2019
7b3d81e
rte translation
ltdu Apr 27, 2019
74d06ad
reorder based on mystrings.d.ts; normalise quotation
ltdu Apr 27, 2019
0f97825
improve/fix attachment related methods
ltdu Apr 28, 2019
9671b69
change attachment file and preview load
ltdu Apr 28, 2019
4b4ee8c
Fix issue with DateTimePicker layout in IE 11
robert-lindstrom May 15, 2019
fabc82c
Merge pull request #302 from SherpasGroup/fix-datetimepicker-layout
estruyf May 17, 2019
8387b0d
Updated changelog
estruyf May 17, 2019
af02d07
Merge branch 'fix-list-item-attachment' of https://github.com/ltdu/sp…
estruyf May 17, 2019
d6442d9
Merge branch 'ltdu-fix-list-item-attachment' into dev
estruyf May 17, 2019
1471c28
Updated changelog
estruyf May 17, 2019
01b3bed
Updated version
estruyf May 17, 2019
77d6b77
npm run changelog
estruyf May 17, 2019
5f1cbe5
Updated changelog
estruyf May 17, 2019
9b266b2
Merge branch 'lt-localization' of https://github.com/ltdu/sp-dev-fx-c…
estruyf May 17, 2019
4cf89c6
Updated changelog
estruyf May 17, 2019
2dfcd1c
Merge branch 'ltdu-lt-localization' into dev
estruyf May 17, 2019
e02b0c2
Updated changelog
estruyf May 17, 2019
c6c4bda
Merge branch 'FixIsMonthPickerVisibleNotRespected' of https://github.…
estruyf May 17, 2019
6e50490
Test out the isMonthPickerVisible property
estruyf May 17, 2019
5c46dbe
Merge branch 'SherpasGroup-FixIsMonthPickerVisibleNotRespected' into dev
estruyf May 17, 2019
ad8b91b
changelog updates
estruyf May 17, 2019
f0da9c5
#300 - Set the CDN fallback as the default method to show file icons
estruyf May 17, 2019
efa5b4f
Updated changelog
estruyf May 17, 2019
ea70d8d
#300 - added semicolons
estruyf May 17, 2019
554eee8
#277 - Fix for crashing on enter in RichText control
estruyf May 17, 2019
58e67a7
Updated changelog
estruyf May 17, 2019
34026ad
#293 - Fix for exporting the term action class
estruyf May 17, 2019
90b6cbc
#291 - Delete attachments by moving them to the recycle bin
estruyf May 17, 2019
09e6b0d
Updated changelog
estruyf May 17, 2019
cc37331
Fix of #296
AJIXuMuK May 17, 2019
5f73a3e
fix of #303
May 17, 2019
7140b53
Merge pull request #304 from AJIXuMuK/field-name-preview
estruyf May 20, 2019
30f1beb
Updated changelog
estruyf May 20, 2019
ce919da
Merge pull request #305 from AJIXuMuK/iframe-dlg-width
estruyf May 20, 2019
9535f4c
Updated changelog
estruyf May 20, 2019
e0df446
Merge branch 'dev' of github.com:SharePoint/sp-dev-fx-controls-react …
estruyf May 20, 2019
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
26 changes: 26 additions & 0 deletions CHANGELOG.JSON
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
{
"versions": [
{
"version": "1.13.2",
"changes": {
"new": [],
"enhancements": [
"Improvements to the `Lithuanian` localization [#285](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/285)"
],
"fixes": [
"`IFrameDialog`: dimensions issue [#303](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/303)",
"`DateTimePicker`: IE11 layout issue [#301](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/301)",
"`FileTypeIcon`: Only displays PDF's in SPFx `1.8.2` [#300](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/300)",
"`FieldNameRenderer`: Fails to encode URI when `hasPreview` [#296](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/296)",
"`TaxonomyPicker`: Cannot find name `TermLabelAction [#293](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/293)",
"`ListItemAttachments`: Move deleted attachments to the recycle bin [#291](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/291)",
"`DateTimePicker`: Does not respect `isMonthPickerVisible` prop [#283](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/283)",
"`ListItemAttachments`: Render issue fixed + improvements to the attachment API calls [#282](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/282)",
"`RichText`: Fixes an issue when hitting enter in the control [#277](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/277)"
]
},
"contributions": [
"[Tautvydas Duda](https://github.com/ltdu)",
"[Thomas Granheim](https://github.com/ThomasGranheim)",
"[Robert Lindström](https://github.com/robert-lindstrom)",
"[Alex Terentiev](https://github.com/AJIXuMuK)"
]
},
{
"version": "1.13.1",
"changes": {
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Releases

## 1.13.2

### Enhancements

- Improvements to the `Lithuanian` localization [#285](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/285)

### Fixes

- `IFrameDialog`: dimensions issue [#303](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/303)
- `DateTimePicker`: IE11 layout issue [#301](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/301)
- `FileTypeIcon`: Only displays PDF's in SPFx `1.8.2` [#300](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/300)
- `FieldNameRenderer`: Fails to encode URI when `hasPreview` [#296](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/296)
- `TaxonomyPicker`: Cannot find name `TermLabelAction [#293](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/293)
- `ListItemAttachments`: Move deleted attachments to the recycle bin [#291](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/291)
- `DateTimePicker`: Does not respect `isMonthPickerVisible` prop [#283](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/283)
- `ListItemAttachments`: Render issue fixed + improvements to the attachment API calls [#282](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/282)
- `RichText`: Fixes an issue when hitting enter in the control [#277](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/277)

### Contributors

Special thanks to our contributors (in alphabetical order): [Tautvydas Duda](https://github.com/ltdu), [Thomas Granheim](https://github.com/ThomasGranheim), [Robert Lindström](https://github.com/robert-lindstrom), [Alex Terentiev](https://github.com/AJIXuMuK).

## 1.13.1

### Fixes
Expand Down
22 changes: 22 additions & 0 deletions docs/documentation/docs/about/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Releases

## 1.13.2

### Enhancements

- Improvements to the `Lithuanian` localization [#285](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/285)

### Fixes

- `IFrameDialog`: dimensions issue [#303](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/303)
- `DateTimePicker`: IE11 layout issue [#301](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/301)
- `FileTypeIcon`: Only displays PDF's in SPFx `1.8.2` [#300](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/300)
- `FieldNameRenderer`: Fails to encode URI when `hasPreview` [#296](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/296)
- `TaxonomyPicker`: Cannot find name `TermLabelAction [#293](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/293)
- `ListItemAttachments`: Move deleted attachments to the recycle bin [#291](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/291)
- `DateTimePicker`: Does not respect `isMonthPickerVisible` prop [#283](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/283)
- `ListItemAttachments`: Render issue fixed + improvements to the attachment API calls [#282](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/282)
- `RichText`: Fixes an issue when hitting enter in the control [#277](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/277)

### Contributors

Special thanks to our contributors (in alphabetical order): [Tautvydas Duda](https://github.com/ltdu), [Thomas Granheim](https://github.com/ThomasGranheim), [Robert Lindström](https://github.com/robert-lindstrom), [Alex Terentiev](https://github.com/AJIXuMuK).

## 1.13.1

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pnp/spfx-controls-react",
"description": "Reusable React controls for SharePoint Framework solutions",
"version": "1.13.1",
"version": "1.13.2",
"engines": {
"node": ">=0.10.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/common/telemetry/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version: string = "1.13.1";
export const version: string = "1.13.2";
1 change: 1 addition & 0 deletions src/controls/dateTimePicker/DateTimePicker.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

.picker {
flex-grow: 1;
flex-basis: 0%;
}

.time {
Expand Down
16 changes: 8 additions & 8 deletions src/controls/dateTimePicker/DateTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ export class DateTimePicker extends React.Component<IDateTimePickerProps, IDateT
<div className={styles.time}>
<div className={styles.picker}>
<HoursComponent disabled={disabled}
timeConvention={timeConvention}
value={hours}
onChange={this.dropdownHoursChanged} />
timeConvention={timeConvention}
value={hours}
onChange={this.dropdownHoursChanged} />
</div>

<div className={styles.separator}>
Expand All @@ -230,8 +230,8 @@ export class DateTimePicker extends React.Component<IDateTimePickerProps, IDateT

<div className={styles.picker}>
<MinutesComponent disabled={disabled}
value={minutes}
onChange={this.dropdownMinutesChanged} />
value={minutes}
onChange={this.dropdownMinutesChanged} />
</div>

{
Expand All @@ -246,8 +246,8 @@ export class DateTimePicker extends React.Component<IDateTimePickerProps, IDateT
showSeconds && (
<div className={styles.picker}>
<SecondsComponent disabled={disabled}
value={seconds}
onChange={this.dropdownSecondsChanged} />
value={seconds}
onChange={this.dropdownSecondsChanged} />
</div>
)
}
Expand All @@ -274,7 +274,7 @@ export class DateTimePicker extends React.Component<IDateTimePickerProps, IDateT
disabled={disabled}
value={value}
strings={dateStrings}
isMonthPickerVisible={true}
isMonthPickerVisible={isMonthPickerVisible}
onSelectDate={this.onSelectDate}
allowTextInput={false}
firstDayOfWeek={firstDayOfWeek}
Expand Down
3 changes: 2 additions & 1 deletion src/controls/fields/fieldNameRenderer/FieldNameRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ export class FieldNameRenderer extends React.Component<IFieldNameRendererProps,
else {
let url: string;
const filePath = this.props.filePath;
const parentPath = filePath.substring(0, filePath.lastIndexOf('/'));
if (this.props.hasPreview !== false) {
url = `#id=${filePath}&parent=${filePath.substring(0, filePath.lastIndexOf('/'))}`;
url = `#id=${encodeURIComponent(filePath)}&parent=${encodeURIComponent(parentPath)}`;
}
else {
url = filePath;
Expand Down
31 changes: 23 additions & 8 deletions src/controls/fileTypeIcon/FileTypeIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,25 @@ export class FileTypeIcon extends React.Component<IFileTypeIconProps, {}> {
const knownImgs = ApplicationIconList[appIdx].imageName;
// Check if the file extension is known
const imgIdx = knownImgs.indexOf(extension);

const imgExists = ApplicationIconList[appIdx].cdnImageName && ApplicationIconList[appIdx].cdnImageName.indexOf(extension) !== -1;
let fallbackImg = null;
if (imgExists) {
fallbackImg = extension;
} else if (ApplicationIconList[appIdx].cdnImageName && ApplicationIconList[appIdx].cdnImageName.length > 0) {
fallbackImg = ApplicationIconList[appIdx].cdnImageName[0];
}

if (imgIdx !== -1) {
return {
image: knownImgs[imgIdx],
cdnFallback: ApplicationIconList[appIdx].cdnImageName || null
cdnFallback: fallbackImg
};
} else {
// Return the first one if it was not known
return {
image: knownImgs[0],
cdnFallback: ApplicationIconList[appIdx].cdnImageName || null
cdnFallback: fallbackImg
};
}
}
Expand All @@ -156,22 +165,28 @@ export class FileTypeIcon extends React.Component<IFileTypeIconProps, {}> {
// Check if an application has found
if (appIdx !== -1) {
const knownApp = ApplicationIconList[appIdx];

let fallbackImg = null;
if (knownApp.cdnImageName && knownApp.cdnImageName.length > 0) {
fallbackImg = knownApp.cdnImageName[0];
}

if (iconType === IconType.font) {
return {
image: knownApp.iconName,
cdnFallback: null
cdnFallback: fallbackImg
};
} else {
// Check if the application has a known list of image types
if (knownApp.imageName.length > 0) {
return {
image: knownApp.imageName[0],
cdnFallback: null
cdnFallback: fallbackImg
};
} else {
return {
image: null,
cdnFallback: knownApp.cdnImageName || null
cdnFallback: fallbackImg
};
}
}
Expand Down Expand Up @@ -209,11 +224,11 @@ export class FileTypeIcon extends React.Component<IFileTypeIconProps, {}> {
// Return an image icon element
const iconImage = this._getIconImageName();
// Check if the image was found, otherwise a generic image will be returned
if (iconImage.image) {
iconElm = <Icon iconType={IconUIType.image} imageProps={{ className: `ms-BrandIcon--${iconImage.size} ms-BrandIcon--${iconImage.image}` }} />;
} else if (iconImage.cdnFallback) {
if (iconImage.cdnFallback) {
const iconUrl = `${ICON_CDN_URL}/${iconImage.size.replace("icon", "")}/${iconImage.cdnFallback}.png`;
iconElm = <Icon iconType={IconUIType.image} imageProps={{ src: iconUrl }} />;
} else if (iconImage.cdnFallback) {
iconElm = <Icon iconType={IconUIType.image} imageProps={{ className: `ms-BrandIcon--${iconImage.size} ms-BrandIcon--${iconImage.image}` }} />;
} else {
// Return a generic image
let imgElm = <img />;
Expand Down
31 changes: 20 additions & 11 deletions src/controls/fileTypeIcon/IFileTypeIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface IApplicationIcons {
extensions: string[];
iconName: string;
imageName: string[];
cdnImageName?: string;
cdnImageName?: string[];
}

/**
Expand All @@ -59,7 +59,8 @@ export const ApplicationIconList: IApplicationIcons[] = [
application: ApplicationType.Access,
extensions: ['accdb', 'accde', 'accdt', 'accdr', 'mdb'],
iconName: 'AccessLogo',
imageName: ['accdb']
imageName: ['accdb'],
cdnImageName: ["accdb"]
},
{
application: ApplicationType.ASPX,
Expand All @@ -83,13 +84,15 @@ export const ApplicationIconList: IApplicationIcons[] = [
application: ApplicationType.CSV,
extensions: ['csv'],
iconName: 'ExcelDocument',
imageName: ['csv']
imageName: ['csv'],
cdnImageName: ['csv']
},
{
application: ApplicationType.Excel,
extensions: ['xls', 'xlt', 'xlm', 'xlsx', 'xlsm', 'xltx', 'xltm', 'ods'],
iconName: 'ExcelDocument',
imageName: ['xlsx', 'xls', 'xltx', 'ods']
imageName: ['xlsx', 'xls', 'xltx', 'ods'],
cdnImageName: ['xlsx', 'xltx', 'ods']
},
{
application: ApplicationType.HTML,
Expand All @@ -113,14 +116,15 @@ export const ApplicationIconList: IApplicationIcons[] = [
application: ApplicationType.OneNote,
extensions: ['one', 'onepkg', 'onetoc'],
iconName: 'OneNoteLogo',
imageName: ['one', 'onepkg', 'onetoc']
imageName: ['one', 'onepkg', 'onetoc'],
cdnImageName: ['one', 'onetoc']
},
{
application: ApplicationType.PDF,
extensions: ['pdf'],
iconName: 'PDF',
imageName: [],
cdnImageName: 'pdf'
cdnImageName: ['pdf']
},
{
application: ApplicationType.PowerApps,
Expand All @@ -132,19 +136,22 @@ export const ApplicationIconList: IApplicationIcons[] = [
application: ApplicationType.PowerPoint,
extensions: ['ppt', 'pot', 'pps', 'pptx', 'pptm', 'potx', 'potm', 'ppam', 'ppsx', 'ppsm', 'sldx', 'sldx'],
iconName: 'PowerPointDocument',
imageName: ['odp', 'potx', 'ppsx', 'pptx']
imageName: ['odp', 'potx', 'ppsx', 'pptx'],
cdnImageName: ['pptx', 'odp', 'potx', 'ppsx']
},
{
application: ApplicationType.Project,
extensions: ['mpp', 'mpt', 'mpx', 'mpd'],
iconName: 'ProjectLogoInverse',
imageName: ['mpp', 'mpt']
imageName: ['mpp', 'mpt'],
cdnImageName: ['mpp', 'mpt']
},
{
application: ApplicationType.Publisher,
extensions: ['pub'],
iconName: 'PublisherLogo',
imageName: ['pub']
imageName: ['pub'],
cdnImageName: ['pub']
},
{
application: ApplicationType.SASS,
Expand All @@ -156,13 +163,15 @@ export const ApplicationIconList: IApplicationIcons[] = [
application: ApplicationType.Visio,
extensions: ['vsd', 'vss', 'vst', 'vdx', 'vsx', 'vtx', 'vsdx'],
iconName: 'VisioDocument',
imageName: ['vsdx', 'vssx', 'vstx']
imageName: ['vsdx', 'vssx', 'vstx'],
cdnImageName: ['vsdx', 'vssx', 'vstx']
},
{
application: ApplicationType.Word,
extensions: ['doc', 'dot', 'docx', 'docm', 'dotx', 'dotm', 'docb', 'odt'],
iconName: 'WordDocument',
imageName: ['docx', 'dotx', 'odt']
imageName: ['docx', 'dotx', 'odt'],
cdnImageName: ['docx', 'dotx', 'odt']
}
];

Expand Down
36 changes: 27 additions & 9 deletions src/controls/iFrameDialog/IFrameDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export interface IFrameDialogProps extends IDialogProps {
}

export interface IFrameDialogState {
dialogId: string;
dialogId: string | null;
isStylingSet?: boolean;
}

/**
Expand Down Expand Up @@ -108,11 +109,21 @@ export class IFrameDialog extends React.Component<IFrameDialogProps, IFrameDialo
name,
sandbox,
scrolling,
seamless
seamless,
modalProps,
className
} = this.props;

let dlgModalProps = {
...modalProps,
onLayerDidMount: () => { this.setDialogStyling(); }
};

return (
<Dialog className={`${this.state.dialogId} ${this.props.className}`}
{...omit(this.props, 'className')}>
<Dialog
className={`${this.state.dialogId} ${className || ''}`}
modalProps={dlgModalProps}
{...omit(this.props, 'className', 'modalProps')}>
<IFrameDialogContent src={this.props.url}
iframeOnLoad={iframeOnLoad}
close={this.props.onDismiss}
Expand All @@ -133,12 +144,19 @@ export class IFrameDialog extends React.Component<IFrameDialogProps, IFrameDialo
* Set the dialog style
*/
private setDialogStyling(): void {
if (!this.props.hidden && this.state.dialogId) {
if (!this.state.isStylingSet && !this.props.hidden && this.state.dialogId) {
const element = document.querySelector(`.${this.state.dialogId} .ms-Dialog-main`) as HTMLElement;
if (element && this.props.width) {
element.style.width = this.props.width;
element.style.minWidth = this.props.width;
element.style.maxWidth = this.props.width;
const {
width
} = this.props;
if (element && width) {
element.style.width = width;
element.style.minWidth = width;
element.style.maxWidth = width;

this.setState({
isStylingSet: true
});
}
}
}
Expand Down
Loading