Update react visio 1.6.0 (#637)

* Add new project files

* Add office-js package

* update strings

* add Visio service - still missing types

* Embed visio file

* remove non required package

* move import of officejs to web part file

* remove fixed width

* use delegate functions to pass values to component

* Display links on right panel

* Update property description and web part icon

* add comment

* load document when url is provided

* Add readme

* Fixed broken image

* Update files

* correct path to styles

* delete update report

* update readme

* remove wrong file

* delete old tslint file from config folder
This commit is contained in:
Joel Rodrigues 2018-10-08 08:57:28 +01:00 committed by Vesa Juvonen
parent 29b5a237b2
commit f8ffb0ddc9
11 changed files with 2260 additions and 2143 deletions

View File

@ -2,10 +2,10 @@
"@microsoft/generator-sharepoint": {
"isCreatingSolution": true,
"environment": "spo",
"version": "1.5.1",
"version": "1.6.0",
"libraryName": "react-visio",
"libraryId": "0ad401f1-b158-4626-8e71-cf27b1f4848d",
"packageManager": "npm",
"componentType": "webpart"
}
}
}

View File

@ -10,7 +10,7 @@ To test the web part, upload the sample file provided to a SharePoint document l
## Used SharePoint Framework Version
![drop](https://img.shields.io/badge/drop-1.5.1-green.svg)
![drop](https://img.shields.io/badge/drop-1.6.0-green.svg)
## Applies to
@ -32,6 +32,7 @@ react-visio|Joel Rodrigues
Version|Date|Comments
-------|----|--------
1.1|October 3, 2018|Update to SPFx 1.6.0
1.0|August 23, 2018|Initial release
## Disclaimer

View File

@ -1,45 +0,0 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/tslint.schema.json",
// Display errors as warnings
"displayAsWarning": true,
// The TSLint task may have been configured with several custom lint rules
// before this config file is read (for example lint rules from the tslint-microsoft-contrib
// project). If true, this flag will deactivate any of these rules.
"removeExistingRules": true,
// When true, the TSLint task is configured with some default TSLint "rules.":
"useDefaultConfigAsBase": false,
// Since removeExistingRules=true and useDefaultConfigAsBase=false, there will be no lint rules
// which are active, other than the list of rules below.
"lintConfig": {
// Opt-in to Lint rules which help to eliminate bugs in JavaScript
"rules": {
"class-name": false,
"export-name": false,
"forin": false,
"label-position": false,
"member-access": true,
"no-arg": false,
"no-console": false,
"no-construct": false,
"no-duplicate-case": true,
"no-duplicate-variable": true,
"no-eval": false,
"no-function-expression": true,
"no-internal-module": true,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-unnecessary-semicolons": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-with-statement": true,
"semicolon": true,
"trailing-comma": false,
"typedef": false,
"typedef-whitespace": false,
"use-named-parameter": true,
"valid-typeof": true,
"variable-name": false,
"whitespace": false
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -11,10 +11,10 @@
"test": "gulp test"
},
"dependencies": {
"@microsoft/sp-core-library": "1.5.1",
"@microsoft/sp-lodash-subset": "1.5.1",
"@microsoft/sp-office-ui-fabric-core": "1.5.1",
"@microsoft/sp-webpart-base": "1.5.1",
"@microsoft/sp-core-library": "1.6.0",
"@microsoft/sp-lodash-subset": "1.6.0",
"@microsoft/sp-office-ui-fabric-core": "1.6.0",
"@microsoft/sp-webpart-base": "1.6.0",
"@types/es6-promise": "0.0.33",
"@types/office-js": "0.0.101",
"@types/react": "15.6.6",
@ -24,12 +24,13 @@
"react-dom": "15.6.2"
},
"devDependencies": {
"@microsoft/sp-build-web": "1.5.1",
"@microsoft/sp-module-interfaces": "1.5.1",
"@microsoft/sp-webpart-workbench": "1.5.1",
"@microsoft/sp-build-web": "1.6.0",
"@microsoft/sp-module-interfaces": "1.6.0",
"@microsoft/sp-webpart-workbench": "1.6.0",
"@types/chai": "3.4.34",
"@types/mocha": "2.2.38",
"ajv": "~5.2.2",
"gulp": "~3.9.1"
"gulp": "~3.9.1",
"tslint-microsoft-contrib": "5.0.0"
}
}

View File

@ -0,0 +1,2 @@
// A file is required to be in the root of the /src directory by the TypeScript compiler

View File

@ -1,5 +1,5 @@
import * as React from 'react';
import styles from '../visioSample/VisioSample.module.scss';
import styles from './Hyperlink.module.scss';
import { IHyperlinkProps } from '.';
export class Hyperlink extends React.Component<IHyperlinkProps, {}> {

View File

@ -1,62 +0,0 @@
import * as React from 'react';
import styles from '../visioSample/VisioSample.module.scss';
import { IVisioSampleProps, IVisioSampleState } from '../visioSample';
export class VisioSample extends React.Component<IVisioSampleProps, IVisioSampleState> {
constructor(props: IVisioSampleProps) {
super(props);
// set delegate functions that will be used to pass the values from the Visio service to the component
this.props.visioService.onSelectionChanged = this._onSelectionChanged;
this.props.visioService.getAllShapes = this._getAllShapes;
this.state = {
selectedShape: null
};
}
public render(): React.ReactElement<IVisioSampleProps> {
return (
<div className={styles.visioSample}>
<div id='iframeHost' className={styles.iframeHost}></div>
<div className={styles.detailsPanel}>
{this.state.selectedShape &&
<h2>{this.state.selectedShape.name}</h2>
}
</div>
</div>
);
}
public componentDidMount() {
if (this.props.documentUrl) {
this.props.visioService.load(this.props.documentUrl);
}
}
/**
* method executed after a on selection change event is triggered
* @param selectedShape the shape selected by the user on the Visio diagram
*/
private _onSelectionChanged = (selectedShape: Visio.Shape): void => {
console.log("Selected shape: ", selectedShape);
console.log("Selected shape name: ", selectedShape.name);
this.setState({
selectedShape: selectedShape
});
}
/**
* method executed after the collection of shapes is retrieved - after Visio diagram page load
* @param shapes the collection of shapes on the Visio diagram
*/
private _getAllShapes = (shapes: Visio.Shape[]): void => {
console.log("Shapes: ", shapes);
}
}

View File

@ -1,5 +1,5 @@
import * as React from 'react';
import styles from '../hyperlink/VisioSample.module.scss';
import styles from './VisioSample.module.scss';
import { IVisioSampleProps, IVisioSampleState } from '.';
import { Hyperlink } from '../hyperlink';

View File

@ -9,6 +9,7 @@
"sourceMap": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"outDir": "lib",
"typeRoots": [
"./node_modules/@types",
"./node_modules/@microsoft"
@ -23,5 +24,12 @@
"dom",
"es2015.collection"
]
}
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules",
"lib"
]
}

View File

@ -1,3 +1,32 @@
{
"rulesDirectory": "./config"
}
"rulesDirectory": [
"tslint-microsoft-contrib"
],
"rules": {
"class-name": false,
"export-name": false,
"forin": false,
"label-position": false,
"member-access": true,
"no-arg": false,
"no-console": false,
"no-construct": false,
"no-duplicate-variable": true,
"no-eval": false,
"no-function-expression": true,
"no-internal-module": true,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-unnecessary-semicolons": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-with-statement": true,
"semicolon": true,
"trailing-comma": false,
"typedef": false,
"typedef-whitespace": false,
"use-named-parameter": true,
"variable-name": false,
"whitespace": false
}
}