Skip to content

Commit c053ca2

Browse files
authored
Merge pull request #35 from SharePoint/dev
Dev v1.4.1 PR
2 parents efc96e8 + 03e7c43 commit c053ca2

File tree

14 files changed

+98
-42
lines changed

14 files changed

+98
-42
lines changed

CHANGELOG.md

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

3+
## 1.4.1
4+
5+
**Enhancements**
6+
7+
- Optimized telemetry so that it only pushes control data
8+
9+
**Fixes**
10+
- Fixes for issue [#30 - Check if Label is null and if so don't render it.](https://github.com/SharePoint/sp-dev-fx-property-controls/issues/30)
11+
- Fix for issue [#33 - `PropertyFieldPeoplePicker` Validation does not work as expected.](https://github.com/SharePoint/sp-dev-fx-property-controls/issues/33)
12+
313
## 1.4.0
414

515
**New controls**

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

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

3+
## 1.4.1
4+
5+
**Enhancements**
6+
7+
- Optimized telemetry so that it only pushes control data
8+
9+
**Fixes**
10+
- Fixes for issue [#30 - Check if Label is null and if so don't render it.](https://github.com/SharePoint/sp-dev-fx-property-controls/issues/30)
11+
- Fix for issue [#33 - `PropertyFieldPeoplePicker` Validation does not work as expected.](https://github.com/SharePoint/sp-dev-fx-property-controls/issues/33)
12+
313
## 1.4.0
414

515
**New controls**

docs/documentation/docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This repository provides developers with a set of reusable property pane controls that can be used in their SharePoint Framework (SPFx) solutions.
44

5+
> **Important**: The controls project has a minimal dependency on SharePoint Framework version `1.3.0`. Be aware that the controls might not work in solutions your building for on-premises. As for on-premises solutions version `1.1.0` will get used.
6+
57
## Getting started
68

79
### Installation

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-property-controls",
33
"description": "Reusable property pane controls for SharePoint Framework solutions",
4-
"version": "1.4.0",
4+
"version": "1.4.1",
55
"engines": {
66
"node": ">=0.10.0"
77
},

src/common/appInsights/index.ts

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,35 @@ import { AppInsights } from "applicationinsights-js";
22
import { version } from './version';
33
import {Environment,EnvironmentType} from "@microsoft/sp-core-library";
44

5+
const controlType = "property";
6+
57
AppInsights.downloadAndSetup({ instrumentationKey: "9f59b81e-d2ed-411e-a961-8bcf3f7f04d0" });
68

7-
// Remove operation name from the telemetry
8-
if (AppInsights.context && AppInsights.context.operation && AppInsights.context.operation.name) {
9-
AppInsights.context.operation.name = null;
10-
}
9+
appInsights.queue.push(() => {
10+
// Remove operation name from the telemetry
11+
if (AppInsights.context && AppInsights.context.operation && AppInsights.context.operation.name) {
12+
AppInsights.context.operation.name = null;
13+
}
14+
15+
// Filter out telemetry data
16+
appInsights.context.addTelemetryInitializer((envelope: Microsoft.ApplicationInsights.IEnvelope) => {
17+
const telemetryItem = envelope.data.baseData;
18+
// Only send telemetry data if it contains data of this library
19+
if (!telemetryItem.properties || !telemetryItem.properties.controlType) {
20+
return false;
21+
}
22+
23+
// Only send telemetry if it is coming from the right control type
24+
if (telemetryItem.properties && telemetryItem.properties.controlType && telemetryItem.properties.controlType !== controlType) {
25+
return false;
26+
}
27+
});
28+
});
1129

1230
export function track(componentName: string, properties: any = {}): void {
1331
AppInsights.trackEvent(componentName, {
1432
version,
33+
controlType,
1534
debug: DEBUG ? "true" : "false",
1635
environment: EnvironmentType[Environment.type],
1736
...properties

src/propertyFields/codeEditor/PropertyFieldCodeEditorHost.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default class PropertyFieldCodeEditorHost extends React.Component<IProper
129129
public render(): JSX.Element {
130130
return (
131131
<div>
132-
<Label>{this.props.label}</Label>
132+
{this.props.label && <Label>{this.props.label}</Label>}
133133
<table className={styles.codeFieldTable}>
134134
<tbody>
135135
<tr>

src/propertyFields/colorPicker/PropertyFieldColorPickerHost.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default class PropertyFieldColorPickerHost extends React.Component<IPrope
3131
public render(): JSX.Element {
3232
return (
3333
<div>
34-
<Label>{this.props.label}</Label>
34+
{this.props.label && <Label>{this.props.label}</Label>}
3535
{this.props.style === PropertyFieldColorPickerStyle.Inline &&
3636
<table className={styles.cpInlineTable}>
3737
<tbody>

src/propertyFields/dateTimePicker/PropertyFieldDateTimePickerHost.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ export default class PropertyFieldDateTimePickerHost extends React.Component<IPr
324324
// Renders content
325325
return (
326326
<div className={styles.propertyFieldDateTimePicker}>
327-
<Label>{this.props.label}</Label>
327+
{this.props.label && <Label>{this.props.label}</Label>}
328328
<table cellPadding='0' cellSpacing='0'>
329329
<tbody>
330330
<tr>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.errorMessage {
2+
font-size: 12px;
3+
font-weight: 400;
4+
color: #a80000;
5+
margin: 0;
6+
padding-top: 5px;
7+
display: flex;
8+
align-items: center;
9+
}
10+
11+
.errorIcon {
12+
font-size: 14px;
13+
margin-right: 5px;
14+
}
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from 'react';
2-
2+
import styles from './FieldErrorMessage.module.scss';
3+
import { Icon } from 'office-ui-fabric-react/lib/Icon';
34

45
export interface IFieldErrorMessageProps {
5-
66
errorMessage: string;
77
}
88

@@ -13,14 +13,15 @@ export default class FieldErrorMessage extends React.Component<IFieldErrorMessag
1313
public render(): JSX.Element {
1414
if (this.props.errorMessage !== 'undefined' && this.props.errorMessage !== null && this.props.errorMessage !== '') {
1515
return (
16-
<div style={{ paddingBottom: '8px' }}><div aria-live='assertive' className='ms-u-screenReaderOnly' data-automation-id='error-message'>{this.props.errorMessage}</div>
17-
<span>
18-
<p className='ms-TextField-errorMessage ms-u-slideDownIn20'>{this.props.errorMessage}</p>
19-
</span>
16+
<div aria-live="assertive">
17+
<p className={`ms-TextField-errorMessage ${styles.errorMessage}`}>
18+
<Icon iconName='Error' className={styles.errorIcon} />
19+
<span data-automation-id="error-message">{this.props.errorMessage}</span>
20+
</p>
2021
</div>
2122
);
2223
} else {
23-
return <div />;
24+
return null;
2425
}
2526
}
2627
}

0 commit comments

Comments
 (0)