Skip to content

Commit 31bb2a0

Browse files
authored
Merge pull request #310 from SharePoint/dev
Merge for 1.13.2
2 parents 32f22f2 + e0df446 commit 31bb2a0

File tree

17 files changed

+467
-211
lines changed

17 files changed

+467
-211
lines changed

CHANGELOG.JSON

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
{
22
"versions": [
3+
{
4+
"version": "1.13.2",
5+
"changes": {
6+
"new": [],
7+
"enhancements": [
8+
"Improvements to the `Lithuanian` localization [#285](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/285)"
9+
],
10+
"fixes": [
11+
"`IFrameDialog`: dimensions issue [#303](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/303)",
12+
"`DateTimePicker`: IE11 layout issue [#301](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/301)",
13+
"`FileTypeIcon`: Only displays PDF's in SPFx `1.8.2` [#300](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/300)",
14+
"`FieldNameRenderer`: Fails to encode URI when `hasPreview` [#296](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/296)",
15+
"`TaxonomyPicker`: Cannot find name `TermLabelAction [#293](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/293)",
16+
"`ListItemAttachments`: Move deleted attachments to the recycle bin [#291](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/291)",
17+
"`DateTimePicker`: Does not respect `isMonthPickerVisible` prop [#283](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/283)",
18+
"`ListItemAttachments`: Render issue fixed + improvements to the attachment API calls [#282](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/282)",
19+
"`RichText`: Fixes an issue when hitting enter in the control [#277](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/277)"
20+
]
21+
},
22+
"contributions": [
23+
"[Tautvydas Duda](https://github.com/ltdu)",
24+
"[Thomas Granheim](https://github.com/ThomasGranheim)",
25+
"[Robert Lindström](https://github.com/robert-lindstrom)",
26+
"[Alex Terentiev](https://github.com/AJIXuMuK)"
27+
]
28+
},
329
{
430
"version": "1.13.1",
531
"changes": {

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Releases
22

3+
## 1.13.2
4+
5+
### Enhancements
6+
7+
- Improvements to the `Lithuanian` localization [#285](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/285)
8+
9+
### Fixes
10+
11+
- `IFrameDialog`: dimensions issue [#303](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/303)
12+
- `DateTimePicker`: IE11 layout issue [#301](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/301)
13+
- `FileTypeIcon`: Only displays PDF's in SPFx `1.8.2` [#300](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/300)
14+
- `FieldNameRenderer`: Fails to encode URI when `hasPreview` [#296](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/296)
15+
- `TaxonomyPicker`: Cannot find name `TermLabelAction [#293](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/293)
16+
- `ListItemAttachments`: Move deleted attachments to the recycle bin [#291](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/291)
17+
- `DateTimePicker`: Does not respect `isMonthPickerVisible` prop [#283](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/283)
18+
- `ListItemAttachments`: Render issue fixed + improvements to the attachment API calls [#282](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/282)
19+
- `RichText`: Fixes an issue when hitting enter in the control [#277](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/277)
20+
21+
### Contributors
22+
23+
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).
24+
325
## 1.13.1
426

527
### Fixes

docs/documentation/docs/about/release-notes.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Releases
22

3+
## 1.13.2
4+
5+
### Enhancements
6+
7+
- Improvements to the `Lithuanian` localization [#285](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/285)
8+
9+
### Fixes
10+
11+
- `IFrameDialog`: dimensions issue [#303](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/303)
12+
- `DateTimePicker`: IE11 layout issue [#301](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/301)
13+
- `FileTypeIcon`: Only displays PDF's in SPFx `1.8.2` [#300](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/300)
14+
- `FieldNameRenderer`: Fails to encode URI when `hasPreview` [#296](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/296)
15+
- `TaxonomyPicker`: Cannot find name `TermLabelAction [#293](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/293)
16+
- `ListItemAttachments`: Move deleted attachments to the recycle bin [#291](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/291)
17+
- `DateTimePicker`: Does not respect `isMonthPickerVisible` prop [#283](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/283)
18+
- `ListItemAttachments`: Render issue fixed + improvements to the attachment API calls [#282](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/282)
19+
- `RichText`: Fixes an issue when hitting enter in the control [#277](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/277)
20+
21+
### Contributors
22+
23+
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).
24+
325
## 1.13.1
426

527
### Fixes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@pnp/spfx-controls-react",
33
"description": "Reusable React controls for SharePoint Framework solutions",
4-
"version": "1.13.1",
4+
"version": "1.13.2",
55
"engines": {
66
"node": ">=0.10.0"
77
},

src/common/telemetry/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const version: string = "1.13.1";
1+
export const version: string = "1.13.2";

src/controls/dateTimePicker/DateTimePicker.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
.picker {
2121
flex-grow: 1;
22+
flex-basis: 0%;
2223
}
2324

2425
.time {

src/controls/dateTimePicker/DateTimePicker.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ export class DateTimePicker extends React.Component<IDateTimePickerProps, IDateT
219219
<div className={styles.time}>
220220
<div className={styles.picker}>
221221
<HoursComponent disabled={disabled}
222-
timeConvention={timeConvention}
223-
value={hours}
224-
onChange={this.dropdownHoursChanged} />
222+
timeConvention={timeConvention}
223+
value={hours}
224+
onChange={this.dropdownHoursChanged} />
225225
</div>
226226

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

231231
<div className={styles.picker}>
232232
<MinutesComponent disabled={disabled}
233-
value={minutes}
234-
onChange={this.dropdownMinutesChanged} />
233+
value={minutes}
234+
onChange={this.dropdownMinutesChanged} />
235235
</div>
236236

237237
{
@@ -246,8 +246,8 @@ export class DateTimePicker extends React.Component<IDateTimePickerProps, IDateT
246246
showSeconds && (
247247
<div className={styles.picker}>
248248
<SecondsComponent disabled={disabled}
249-
value={seconds}
250-
onChange={this.dropdownSecondsChanged} />
249+
value={seconds}
250+
onChange={this.dropdownSecondsChanged} />
251251
</div>
252252
)
253253
}
@@ -274,7 +274,7 @@ export class DateTimePicker extends React.Component<IDateTimePickerProps, IDateT
274274
disabled={disabled}
275275
value={value}
276276
strings={dateStrings}
277-
isMonthPickerVisible={true}
277+
isMonthPickerVisible={isMonthPickerVisible}
278278
onSelectDate={this.onSelectDate}
279279
allowTextInput={false}
280280
firstDayOfWeek={firstDayOfWeek}

src/controls/fields/fieldNameRenderer/FieldNameRenderer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ export class FieldNameRenderer extends React.Component<IFieldNameRendererProps,
118118
else {
119119
let url: string;
120120
const filePath = this.props.filePath;
121+
const parentPath = filePath.substring(0, filePath.lastIndexOf('/'));
121122
if (this.props.hasPreview !== false) {
122-
url = `#id=${filePath}&parent=${filePath.substring(0, filePath.lastIndexOf('/'))}`;
123+
url = `#id=${encodeURIComponent(filePath)}&parent=${encodeURIComponent(parentPath)}`;
123124
}
124125
else {
125126
url = filePath;

src/controls/fileTypeIcon/FileTypeIcon.tsx

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,25 @@ export class FileTypeIcon extends React.Component<IFileTypeIconProps, {}> {
126126
const knownImgs = ApplicationIconList[appIdx].imageName;
127127
// Check if the file extension is known
128128
const imgIdx = knownImgs.indexOf(extension);
129+
130+
const imgExists = ApplicationIconList[appIdx].cdnImageName && ApplicationIconList[appIdx].cdnImageName.indexOf(extension) !== -1;
131+
let fallbackImg = null;
132+
if (imgExists) {
133+
fallbackImg = extension;
134+
} else if (ApplicationIconList[appIdx].cdnImageName && ApplicationIconList[appIdx].cdnImageName.length > 0) {
135+
fallbackImg = ApplicationIconList[appIdx].cdnImageName[0];
136+
}
137+
129138
if (imgIdx !== -1) {
130139
return {
131140
image: knownImgs[imgIdx],
132-
cdnFallback: ApplicationIconList[appIdx].cdnImageName || null
141+
cdnFallback: fallbackImg
133142
};
134143
} else {
135144
// Return the first one if it was not known
136145
return {
137146
image: knownImgs[0],
138-
cdnFallback: ApplicationIconList[appIdx].cdnImageName || null
147+
cdnFallback: fallbackImg
139148
};
140149
}
141150
}
@@ -156,22 +165,28 @@ export class FileTypeIcon extends React.Component<IFileTypeIconProps, {}> {
156165
// Check if an application has found
157166
if (appIdx !== -1) {
158167
const knownApp = ApplicationIconList[appIdx];
168+
169+
let fallbackImg = null;
170+
if (knownApp.cdnImageName && knownApp.cdnImageName.length > 0) {
171+
fallbackImg = knownApp.cdnImageName[0];
172+
}
173+
159174
if (iconType === IconType.font) {
160175
return {
161176
image: knownApp.iconName,
162-
cdnFallback: null
177+
cdnFallback: fallbackImg
163178
};
164179
} else {
165180
// Check if the application has a known list of image types
166181
if (knownApp.imageName.length > 0) {
167182
return {
168183
image: knownApp.imageName[0],
169-
cdnFallback: null
184+
cdnFallback: fallbackImg
170185
};
171186
} else {
172187
return {
173188
image: null,
174-
cdnFallback: knownApp.cdnImageName || null
189+
cdnFallback: fallbackImg
175190
};
176191
}
177192
}
@@ -209,11 +224,11 @@ export class FileTypeIcon extends React.Component<IFileTypeIconProps, {}> {
209224
// Return an image icon element
210225
const iconImage = this._getIconImageName();
211226
// Check if the image was found, otherwise a generic image will be returned
212-
if (iconImage.image) {
213-
iconElm = <Icon iconType={IconUIType.image} imageProps={{ className: `ms-BrandIcon--${iconImage.size} ms-BrandIcon--${iconImage.image}` }} />;
214-
} else if (iconImage.cdnFallback) {
227+
if (iconImage.cdnFallback) {
215228
const iconUrl = `${ICON_CDN_URL}/${iconImage.size.replace("icon", "")}/${iconImage.cdnFallback}.png`;
216229
iconElm = <Icon iconType={IconUIType.image} imageProps={{ src: iconUrl }} />;
230+
} else if (iconImage.cdnFallback) {
231+
iconElm = <Icon iconType={IconUIType.image} imageProps={{ className: `ms-BrandIcon--${iconImage.size} ms-BrandIcon--${iconImage.image}` }} />;
217232
} else {
218233
// Return a generic image
219234
let imgElm = <img />;

src/controls/fileTypeIcon/IFileTypeIcon.ts

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export interface IApplicationIcons {
4848
extensions: string[];
4949
iconName: string;
5050
imageName: string[];
51-
cdnImageName?: string;
51+
cdnImageName?: string[];
5252
}
5353

5454
/**
@@ -59,7 +59,8 @@ export const ApplicationIconList: IApplicationIcons[] = [
5959
application: ApplicationType.Access,
6060
extensions: ['accdb', 'accde', 'accdt', 'accdr', 'mdb'],
6161
iconName: 'AccessLogo',
62-
imageName: ['accdb']
62+
imageName: ['accdb'],
63+
cdnImageName: ["accdb"]
6364
},
6465
{
6566
application: ApplicationType.ASPX,
@@ -83,13 +84,15 @@ export const ApplicationIconList: IApplicationIcons[] = [
8384
application: ApplicationType.CSV,
8485
extensions: ['csv'],
8586
iconName: 'ExcelDocument',
86-
imageName: ['csv']
87+
imageName: ['csv'],
88+
cdnImageName: ['csv']
8789
},
8890
{
8991
application: ApplicationType.Excel,
9092
extensions: ['xls', 'xlt', 'xlm', 'xlsx', 'xlsm', 'xltx', 'xltm', 'ods'],
9193
iconName: 'ExcelDocument',
92-
imageName: ['xlsx', 'xls', 'xltx', 'ods']
94+
imageName: ['xlsx', 'xls', 'xltx', 'ods'],
95+
cdnImageName: ['xlsx', 'xltx', 'ods']
9396
},
9497
{
9598
application: ApplicationType.HTML,
@@ -113,14 +116,15 @@ export const ApplicationIconList: IApplicationIcons[] = [
113116
application: ApplicationType.OneNote,
114117
extensions: ['one', 'onepkg', 'onetoc'],
115118
iconName: 'OneNoteLogo',
116-
imageName: ['one', 'onepkg', 'onetoc']
119+
imageName: ['one', 'onepkg', 'onetoc'],
120+
cdnImageName: ['one', 'onetoc']
117121
},
118122
{
119123
application: ApplicationType.PDF,
120124
extensions: ['pdf'],
121125
iconName: 'PDF',
122126
imageName: [],
123-
cdnImageName: 'pdf'
127+
cdnImageName: ['pdf']
124128
},
125129
{
126130
application: ApplicationType.PowerApps,
@@ -132,19 +136,22 @@ export const ApplicationIconList: IApplicationIcons[] = [
132136
application: ApplicationType.PowerPoint,
133137
extensions: ['ppt', 'pot', 'pps', 'pptx', 'pptm', 'potx', 'potm', 'ppam', 'ppsx', 'ppsm', 'sldx', 'sldx'],
134138
iconName: 'PowerPointDocument',
135-
imageName: ['odp', 'potx', 'ppsx', 'pptx']
139+
imageName: ['odp', 'potx', 'ppsx', 'pptx'],
140+
cdnImageName: ['pptx', 'odp', 'potx', 'ppsx']
136141
},
137142
{
138143
application: ApplicationType.Project,
139144
extensions: ['mpp', 'mpt', 'mpx', 'mpd'],
140145
iconName: 'ProjectLogoInverse',
141-
imageName: ['mpp', 'mpt']
146+
imageName: ['mpp', 'mpt'],
147+
cdnImageName: ['mpp', 'mpt']
142148
},
143149
{
144150
application: ApplicationType.Publisher,
145151
extensions: ['pub'],
146152
iconName: 'PublisherLogo',
147-
imageName: ['pub']
153+
imageName: ['pub'],
154+
cdnImageName: ['pub']
148155
},
149156
{
150157
application: ApplicationType.SASS,
@@ -156,13 +163,15 @@ export const ApplicationIconList: IApplicationIcons[] = [
156163
application: ApplicationType.Visio,
157164
extensions: ['vsd', 'vss', 'vst', 'vdx', 'vsx', 'vtx', 'vsdx'],
158165
iconName: 'VisioDocument',
159-
imageName: ['vsdx', 'vssx', 'vstx']
166+
imageName: ['vsdx', 'vssx', 'vstx'],
167+
cdnImageName: ['vsdx', 'vssx', 'vstx']
160168
},
161169
{
162170
application: ApplicationType.Word,
163171
extensions: ['doc', 'dot', 'docx', 'docm', 'dotx', 'dotm', 'docb', 'odt'],
164172
iconName: 'WordDocument',
165-
imageName: ['docx', 'dotx', 'odt']
173+
imageName: ['docx', 'dotx', 'odt'],
174+
cdnImageName: ['docx', 'dotx', 'odt']
166175
}
167176
];
168177

0 commit comments

Comments
 (0)