Skip to content

Commit

Permalink
New employee card webpart
Browse files Browse the repository at this point in the history
  • Loading branch information
agzertuche committed May 27, 2017
1 parent d81cbd0 commit d06a2dc
Show file tree
Hide file tree
Showing 70 changed files with 1,224 additions and 0 deletions.
25 changes: 25 additions & 0 deletions EmployeeCard-Webpart/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# change these settings to your own preference
indent_style = space
indent_size = 2

# we recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[{package,bower}.json]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions EmployeeCard-Webpart/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
32 changes: 32 additions & 0 deletions EmployeeCard-Webpart/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Logs
logs
*.log
npm-debug.log*

# Dependency directories
node_modules

# Build generated files
dist
lib
solution
temp
*.sppkg

# Coverage directory used by tools like istanbul
coverage

# OSX
.DS_Store

# Visual Studio files
.ntvs_analysis.dat
.vs
bin
obj

# Resx Generated Code
*.resx.ts

# Styles Generated Code
*.scss.ts
14 changes: 14 additions & 0 deletions EmployeeCard-Webpart/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Folders
.vscode
coverage
node_modules
sharepoint
src
temp

# Files
*.csproj
.git*
.yo-rc.json
gulpfile.js
tsconfig.json
3 changes: 3 additions & 0 deletions EmployeeCard-Webpart/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place your settings in this file to overwrite default and user settings.
{
}
8 changes: 8 additions & 0 deletions EmployeeCard-Webpart/.yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@microsoft/generator-sharepoint": {
"libraryName": "employee-card-webpart",
"framework": "react",
"version": "1.0.2",
"libraryId": "26366d93-5998-493a-8bbe-0c179bd0a3cb"
}
}
26 changes: 26 additions & 0 deletions EmployeeCard-Webpart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## employee-card-webpart

This is where you include your WebPart documentation.

### Building the code

```bash
git clone the repo
npm i
npm i -g gulp
gulp
```

This package produces the following:

* lib/* - intermediate-stage commonjs build artifacts
* dist/* - the bundled script, along with other resources
* deploy/* - all resources which should be uploaded to a CDN.

### Build options

gulp clean - TODO
gulp test - TODO
gulp serve - TODO
gulp bundle - TODO
gulp package-solution - TODO
13 changes: 13 additions & 0 deletions EmployeeCard-Webpart/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"entries": [
{
"entry": "./lib/webparts/employeeCardWebpart/EmployeeCardWebpartWebPart.js",
"manifest": "./src/webparts/employeeCardWebpart/EmployeeCardWebpartWebPart.manifest.json",
"outputPath": "./dist/employee-card-webpart.bundle.js"
}
],
"externals": {},
"localizedResources": {
"employeeCardWebpartStrings": "webparts/employeeCardWebpart/loc/{locale}.js"
}
}
3 changes: 3 additions & 0 deletions EmployeeCard-Webpart/config/copy-assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"deployCdnPath": "temp/deploy"
}
6 changes: 6 additions & 0 deletions EmployeeCard-Webpart/config/deploy-azure-storage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"workingDir": "./temp/deploy/",
"account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "employee-card-webpart",
"accessKey": "<!-- ACCESS KEY -->"
}
10 changes: 10 additions & 0 deletions EmployeeCard-Webpart/config/package-solution.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"solution": {
"name": "employee-card-webpart-client-side-solution",
"id": "26366d93-5998-493a-8bbe-0c179bd0a3cb",
"version": "1.0.0.0"
},
"paths": {
"zippedPackage": "solution/employee-card-webpart.sppkg"
}
}
9 changes: 9 additions & 0 deletions EmployeeCard-Webpart/config/serve.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"port": 4321,
"initialPage": "https://localhost:5432/workbench",
"https": true,
"api": {
"port": 5432,
"entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"
}
}
45 changes: 45 additions & 0 deletions EmployeeCard-Webpart/config/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
// 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-unused-imports": 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
}
}
}
3 changes: 3 additions & 0 deletions EmployeeCard-Webpart/config/write-manifests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cdnBasePath": "<!-- PATH TO CDN -->"
}
6 changes: 6 additions & 0 deletions EmployeeCard-Webpart/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');

build.initialize(gulp);
35 changes: 35 additions & 0 deletions EmployeeCard-Webpart/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "employee-card-webpart",
"version": "0.0.1",
"private": true,
"engines": {
"node": ">=0.10.0"
},
"dependencies": {
"@microsoft/sp-client-base": "~1.0.0",
"@microsoft/sp-core-library": "~1.0.0",
"@microsoft/sp-webpart-base": "~1.0.0",
"@types/react": "0.14.46",
"@types/react-addons-shallow-compare": "0.14.17",
"@types/react-addons-test-utils": "0.14.15",
"@types/react-addons-update": "0.14.14",
"@types/react-dom": "0.14.18",
"@types/webpack-env": ">=1.12.1 <1.14.0",
"office-ui-fabric-react": "^2.32.0",
"react": "15.4.2",
"react-dom": "15.4.2"
},
"devDependencies": {
"@microsoft/sp-build-web": "~1.0.1",
"@microsoft/sp-module-interfaces": "~1.0.0",
"@microsoft/sp-webpart-workbench": "~1.0.0",
"gulp": "~3.9.1",
"@types/chai": ">=3.4.34 <3.6.0",
"@types/mocha": ">=2.2.33 <2.6.0"
},
"scripts": {
"build": "gulp bundle",
"clean": "gulp clean",
"test": "gulp test"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "../../../node_modules/@microsoft/sp-module-interfaces/lib/manifestSchemas/jsonSchemas/clientSideComponentManifestSchema.json",

"id": "140c7329-cc92-4dbc-a730-7077088fb3ba",
"alias": "EmployeeCardWebpartWebPart",
"componentType": "WebPart",
"version": "0.0.1",
"manifestVersion": 2,

"preconfiguredEntries": [{
"groupId": "140c7329-cc92-4dbc-a730-7077088fb3ba",
"group": { "default": "Under Development" },
"title": { "default": "employee-card-webpart" },
"description": { "default": "employee-card-webpart description" },
"officeFabricIconFontName": "Page",
"properties": {
"description": "employee-card-webpart"
}
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import * as React from 'react';
import * as ReactDom from 'react-dom';
import { Version } from '@microsoft/sp-core-library';
import {
BaseClientSideWebPart,
IPropertyPaneConfiguration,
PropertyPaneTextField
} from '@microsoft/sp-webpart-base';

import * as strings from 'employeeCardWebpartStrings';
import Main from './components/Main';
import { IEmployeeCardWebpartWebPartProps } from './IEmployeeCardWebpartWebPartProps';

export default class EmployeeCardWebpartWebPart extends BaseClientSideWebPart<IEmployeeCardWebpartWebPartProps> {

public render(): void {
ReactDom.render(React.createElement(Main), this.domElement);
}

protected get dataVersion(): Version {
return Version.parse('1.0');
}

protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
return {
pages: [
{
header: {
description: strings.PropertyPaneDescription
},
groups: [
{
groupName: strings.BasicGroupName,
groupFields: [
PropertyPaneTextField('description', {
label: strings.DescriptionFieldLabel
})
]
}
]
}
]
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface IEmployeeCardWebpartWebPartProps {
description: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as React from 'react';
import styles from '../styles/app.module.scss';
import IconComponent from './IconComponent';

export interface IAchievementsProps {}

export default class Achievements extends React.Component<IAchievementsProps, void>{
public render(): any {
return(
<div className={styles.achievementsContainer}>
<div className="ms-Grid-row">
<div>
Achievements
</div>
<div className="ms-Grid-col ms-u-sm12 ms-u-md4">
<IconComponent icon={"Champion"} description={"blah blah blah"} />
</div>
<div className="ms-Grid-col ms-u-sm12 ms-u-md4">
<IconComponent icon={"Happy Customer"} description={"Blah Blah...."} />
</div>
<div className="ms-Grid-col ms-u-sm12 ms-u-md4">
<IconComponent icon={"Best Raiting"} description={"This that dot..."} />
</div>
</div>
</div>
);
}
}
Loading

0 comments on commit d06a2dc

Please sign in to comment.