Skip to content

Commit

Permalink
Merge pull request #97 from SharePoint/dev
Browse files Browse the repository at this point in the history
Merge for 1.11.0 release
  • Loading branch information
estruyf committed Sep 20, 2018
2 parents c2c24dd + a7a2065 commit 29921d3
Show file tree
Hide file tree
Showing 47 changed files with 321 additions and 83 deletions.
6 changes: 6 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ jobs:
- run:
name: build
command: npm run build
- run:
name: sonarcloud:config
command: npm run sonarcloud:config $SONARCLOUD_TOKEN $CIRCLE_BRANCH
- run:
name: sonarcloud:start
command: npm run sonarcloud:start
- persist_to_workspace:
root: .
paths: .
Expand Down
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ gulpfile.js
tsconfig.json
yarn.lock
*.tgz
sonar-project.properties
gulpfile.sonarqube.js
tslint.json
13 changes: 13 additions & 0 deletions CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
{
"versions": [
{
"version": "1.11.0",
"changes": {
"new": [],
"enhancements": [
"`PropertyFieldCollectionData`: Show error messages [#96](https://github.com/SharePoint/sp-dev-fx-property-controls/issues/96)"
],
"fixes": [
"Fixes based on SonarCloud analysis"
]
},
"contributions": []
},
{
"version": "1.10.0",
"changes": {
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Releases

## 1.11.0

**Enhancements**

- `PropertyFieldCollectionData`: Show error messages [#96](https://github.com/SharePoint/sp-dev-fx-property-controls/issues/96)

**Fixes**

- Fixes based on SonarCloud analysis

## 1.10.0

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

## 1.11.0

**Enhancements**

- `PropertyFieldCollectionData`: Show error messages [#96](https://github.com/SharePoint/sp-dev-fx-property-controls/issues/96)

**Fixes**

- Fixes based on SonarCloud analysis

## 1.10.0

**Enhancements**
Expand Down
9 changes: 9 additions & 0 deletions gulpfile.sonarqube.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var gulp = require('gulp');
var sonarqubeScanner = require('sonarqube-scanner');

gulp.task('sonarqube', function(callback) {
sonarqubeScanner({
serverUrl : "https://sonarcloud.io",
options : {}
}, callback);
});
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pnp/spfx-property-controls",
"description": "Reusable property pane controls for SharePoint Framework solutions",
"version": "1.10.0",
"version": "1.11.0",
"engines": {
"node": ">=0.10.0"
},
Expand All @@ -12,7 +12,9 @@
"versionUpdater": "gulp versionUpdater",
"prepublishOnly": "gulp",
"changelog": "node scripts/create-changelog.js && node scripts/sync-changelogs.js && gulp versionUpdater",
"postinstall": "node postinstall/install.js"
"postinstall": "node postinstall/install.js",
"sonarcloud:config": "node ./scripts/sonarcloud.js",
"sonarcloud:start": "gulp sonarqube --gulpfile gulpfile.sonarqube.js"
},
"dependencies": {
"@pnp/telemetry-js": "1.0.0",
Expand All @@ -34,7 +36,8 @@
"@types/webpack-env": ">=1.12.1 <1.14.0",
"gulp": "~3.9.1",
"react": "15.4.2",
"react-dom": "15.4.2"
"react-dom": "15.4.2",
"sonarqube-scanner": "2.1.1"
},
"repository": {
"type": "git",
Expand Down
20 changes: 20 additions & 0 deletions scripts/sonarcloud.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const fs = require("fs");
const path = require("path");

const params = process.argv;
let token = "";
let branchName = "";
if (params && params.length > 0) {
branchName = params.pop();
token = params.pop();
}

const package = fs.readFileSync(path.join(__dirname, "../package.json"), "UTF8");
let sonarProps = fs.readFileSync(path.join(__dirname, "../sonar-project.properties"), "UTF8");
if (package && sonarProps) {
const pkg = JSON.parse(package);
sonarProps += `sonar.login=${token}\n`;
sonarProps += `sonar.projectVersion=${pkg.version}\n`;
sonarProps += `sonar.branch.name=${branchName}\n`;
fs.writeFileSync(path.join(__dirname, "../sonar-project.properties"), sonarProps, { encoding: "UTF8" })
}
6 changes: 6 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.ts.tslintconfigpath=temp/tslint.json
sonar.organization=sharepoint
sonar.projectKey=sp-dev-fx-property-controls
sonar.host.url=https://sonarcloud.io
26 changes: 13 additions & 13 deletions src/common/placeholderWithCallout/PlaceholderWithCallout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { IconButton, Callout, DirectionalHint } from 'office-ui-fabric-react';
import { Callout, DirectionalHint } from 'office-ui-fabric-react/lib/components/Callout';
import { IPlaceholderWithCalloutProps, IPlaceholderWithCalloutState } from './IPlaceholderWithCallout';
import { CalloutTriggers } from '../callout/Callout';

Expand All @@ -10,17 +10,17 @@ import styles from './PlaceholderWithCallout.module.scss';
* Displays a label and a callout
*/
export default class PlaceholderWithCallout extends React.Component<IPlaceholderWithCalloutProps, IPlaceholderWithCalloutState> {

private _infoIcon: HTMLElement;

public constructor(props: IPlaceholderWithCalloutProps, state: IPlaceholderWithCalloutState) {
super(props, state);
this._onCalloutDismiss = this._onCalloutDismiss.bind(this);
this.state = {
isCalloutVisible: false
};
}

public render(): JSX.Element {
return (
<div className={styles.placeholder}>
Expand All @@ -29,7 +29,7 @@ export default class PlaceholderWithCallout extends React.Component<IPlaceholder
</div>
<div className={styles.info}>
<i className={'ms-Icon ms-Icon--Info'} ref={(infoIcon) => { this._infoIcon = infoIcon; }}
onMouseOver={this.props.calloutTrigger === CalloutTriggers.Hover ? this._onInfoIconMouseOver.bind(this) : null}
onMouseOver={this.props.calloutTrigger === CalloutTriggers.Hover ? this._onInfoIconMouseOver.bind(this) : null}
onMouseOut={this.props.calloutTrigger === CalloutTriggers.Hover ? this._onInfoIconMouseOut.bind(this) : null}
onClick={this.props.calloutTrigger === CalloutTriggers.Click ? this._onInfoIconClick.bind(this) : null}></i>
</div>
Expand All @@ -49,16 +49,16 @@ export default class PlaceholderWithCallout extends React.Component<IPlaceholder
}
</div>);
}


private _onCalloutDismiss() {
if (this.state.isCalloutVisible) {
this.setState({
isCalloutVisible: false
});
}
}

private _onInfoIconMouseOver(): void {
if (this.props.calloutTrigger !== CalloutTriggers.Hover) {
return;
Expand All @@ -70,24 +70,24 @@ export default class PlaceholderWithCallout extends React.Component<IPlaceholder
});
}
}

private _onInfoIconMouseOut(e: MouseEvent): void {
if (this.props.calloutTrigger !== CalloutTriggers.Hover) {
return;
}

if (e.relatedTarget) {

let relatedTarget: HTMLElement = (e.relatedTarget as HTMLElement);
if (relatedTarget && relatedTarget.closest('.ms-Callout-container')) {
return;
}
}

this.setState({
isCalloutVisible: false
});

}

private _onInfoIconClick(): void {
Expand All @@ -99,4 +99,4 @@ export default class PlaceholderWithCallout extends React.Component<IPlaceholder
isCalloutVisible: !this.state.isCalloutVisible
});
}
}
}
26 changes: 13 additions & 13 deletions src/common/propertyFieldHeader/PropertyFieldHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { IconButton, Callout, DirectionalHint } from 'office-ui-fabric-react';
import { Callout, DirectionalHint } from 'office-ui-fabric-react/lib/components/Callout';
import { IPropertyFieldHeaderProps, IPropertyFieldHeaderState, CalloutTriggers } from './IPropertyFieldHeader';

import styles from './PropertyFieldHeader.module.scss';
Expand All @@ -9,17 +9,17 @@ import styles from './PropertyFieldHeader.module.scss';
* Displays a label and a callout
*/
export default class PropertyFieldHeader extends React.Component<IPropertyFieldHeaderProps, IPropertyFieldHeaderState> {

private _infoIcon: HTMLElement;

public constructor(props: IPropertyFieldHeaderProps, state: IPropertyFieldHeaderState) {
super(props, state);
this._onCalloutDismiss = this._onCalloutDismiss.bind(this);
this.state = {
isCalloutVisible: false
};
}

public render(): JSX.Element {
return (
<div className={styles.headerBar}>
Expand All @@ -28,7 +28,7 @@ export default class PropertyFieldHeader extends React.Component<IPropertyFieldH
</div>
<div className={styles.info}>
<i className={'ms-Icon ms-Icon--Info'} ref={(infoIcon) => { this._infoIcon = infoIcon; }}
onMouseOver={this.props.calloutTrigger === CalloutTriggers.Hover ? this._onInfoIconMouseOver.bind(this) : null}
onMouseOver={this.props.calloutTrigger === CalloutTriggers.Hover ? this._onInfoIconMouseOver.bind(this) : null}
onMouseOut={this.props.calloutTrigger === CalloutTriggers.Hover ? this._onInfoIconMouseOut.bind(this) : null}
onClick={this.props.calloutTrigger === CalloutTriggers.Click ? this._onInfoIconClick.bind(this) : null}></i>
</div>
Expand All @@ -48,16 +48,16 @@ export default class PropertyFieldHeader extends React.Component<IPropertyFieldH
}
</div>);
}


private _onCalloutDismiss() {
if (this.state.isCalloutVisible) {
this.setState({
isCalloutVisible: false
});
}
}

private _onInfoIconMouseOver(): void {
if (this.props.calloutTrigger !== CalloutTriggers.Hover) {
return;
Expand All @@ -69,24 +69,24 @@ export default class PropertyFieldHeader extends React.Component<IPropertyFieldH
});
}
}

private _onInfoIconMouseOut(e: MouseEvent): void {
if (this.props.calloutTrigger !== CalloutTriggers.Hover) {
return;
}

if (e.relatedTarget) {

let relatedTarget: HTMLElement = (e.relatedTarget as HTMLElement);
if (relatedTarget && relatedTarget.closest('.ms-Callout-container')) {
return;
}
}

this.setState({
isCalloutVisible: false
});

}

private _onInfoIconClick(): void {
Expand All @@ -98,4 +98,4 @@ export default class PropertyFieldHeader extends React.Component<IPropertyFieldH
isCalloutVisible: !this.state.isCalloutVisible
});
}
}
}
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.10.0";
export const version: string = "1.11.0";
8 changes: 6 additions & 2 deletions src/loc/en-us.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
define([], function () {
return {
propertyFieldMultiSelectNoOptions: "No options to select",
InvalidUrlError: "The provided URL is not valid",
// Common field labels
'SaveButtonLabel': 'Save',
'CancelButtonLabel': 'Cancel',
Expand Down Expand Up @@ -74,11 +72,17 @@ define([], function () {
"TermPickerInLabel": "in",
"TermPickerTermSetLabel": "Term Set",

// Multi-select field
propertyFieldMultiSelectNoOptions: "No options to select",

// Collection data
"CollectionDataEmptyFields": "No fields were provided for the collection data.",
"CollectionDataEmptyValue": "No data in your collection.",
'CollectionAddRowButtonLabel': 'Add data to the collection',
'CollectionDeleteRowButtonLabel': 'Delete the current row',
'CollectionSaveAndAddButtonLabel': 'Add and save',
CollectionDataItemShowErrorsLabel: "Show row errors",
CollectionDataItemFieldRequiredLabel: "Field is required.",
InvalidUrlError: "The provided URL is not valid"
}
});
8 changes: 6 additions & 2 deletions src/loc/mystrings.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
declare interface IPropertyControlStrings {
propertyFieldMultiSelectNoOptions: string;
InvalidUrlError: string;
// PeoplePicker labels
PeoplePickerSuggestedContacts: string;
PeoplePickerSuggestedGroups: string;
Expand Down Expand Up @@ -73,12 +71,18 @@ declare interface IPropertyControlStrings {
TermPickerInLabel: string;
TermPickerTermSetLabel: string;

// Multi-select field
propertyFieldMultiSelectNoOptions: string;

// Collection data
CollectionDataEmptyFields: string;
CollectionDataEmptyValue: string;
CollectionAddRowButtonLabel: string;
CollectionDeleteRowButtonLabel: string;
CollectionSaveAndAddButtonLabel: string;
CollectionDataItemShowErrorsLabel: string;
CollectionDataItemFieldRequiredLabel: string;
InvalidUrlError: string;
}

declare module 'PropertyControlStrings' {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { IButtonProps } from 'office-ui-fabric-react';

import { IPlaceholderWithCalloutProps } from '../../common/placeholderWithCallout/IPlaceholderWithCallout';
import { IButtonProps } from 'office-ui-fabric-react/lib/components/Button';

/**
* PropertyFieldButtonWithCalloutHost properties interface
Expand Down
Loading

0 comments on commit 29921d3

Please sign in to comment.