Skip to content

Commit

Permalink
fix(linting): Make the demo page dependencies lint
Browse files Browse the repository at this point in the history
  • Loading branch information
szafranek committed Aug 29, 2017
1 parent a69f329 commit 0f1d544
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 58 deletions.
95 changes: 50 additions & 45 deletions demo/demo_app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint no-console: 'off' */
import {React, render} from '../src/imports';
import {WSHeader, WSDropdown, WSNotification, WSDatePicker, WSInlineEdit, WSWeekPicker, WSTilesChart} from '../src/index';
import {dashboardMockData} from './mockdata'
import {dashboardMockData} from './mockdata';
import './index.scss';

// Used to enable React Developer Tools
Expand All @@ -12,7 +13,7 @@ render(
appName="Demo Page"
clientId="stups_abba-frontend-release_180e00be-2b66-4e44-ac95-37f10068c015"
links={[
{label: 'Link', href: '#LinkValue', onClick: (value) => console.log(value)},
{label: 'Link', href: '#LinkValue', onClick: value => console.log(value)},
{
label: 'Link2',
href: '#2222',
Expand Down Expand Up @@ -40,72 +41,76 @@ render(
/>
<div className="container">
<br />
<WSDatePicker onChange={(date) => console.log('New Date:', date)} value={Date.now()}/>
<WSDatePicker onChange={date => console.log('New Date:', date)} value={Date.now()} />
<br />
<br />
<WSWeekPicker onChange={({year, week}) => console.log('New week selected:', week)}/>
<WSWeekPicker onChange={({week}) => console.log('New week selected:', week)} />
<br />
<br />
<WSDropdown text="Multiple" type="button" placeholder="Filter values.." filterable multiple items={[
'New',
'New From Template',
'Open',
'Test value 1',
'Open Recent',
'Save'
]}/>
<WSDropdown
text="Multiple" type="button" placeholder="Filter values.." filterable multiple items={[
'New',
'New From Template',
'Open',
'Test value 1',
'Open Recent',
'Save'
]}
/>
<br />
<WSDropdown text="Simple Wide" type="select" items={[
'New',
{
label: 'New From Template',
children: [
'item 2.1',
{
label: 'item 2.2',
children: [
'item 2.3.1',
'item 2.3.2',
'item 2.3.3',
'item 2.3.4'
]
}
]
},
'Open',
'Open Recent',
'Save'
]}/>
<WSDropdown
text="Simple Wide" type="select" items={[
'New',
{
label: 'New From Template',
children: [
'item 2.1',
{
label: 'item 2.2',
children: [
'item 2.3.1',
'item 2.3.2',
'item 2.3.3',
'item 2.3.4'
]
}
]
},
'Open',
'Open Recent',
'Save'
]}
/>
<br />
<WSDropdown text="Input" type="select" placeholder="tasd" value="222" inputOnly/>
<WSDropdown text="Input" type="select" placeholder="tasd" value="222" inputOnly />
<br />
<WSNotification />
<br />
<div style={{width: '60%'}}>
<WSInlineEdit text="Some text to check"/>
<WSInlineEdit text="Some text to check" />
</div>
<br />
<table style={{width: '50%'}}>
<tbody>
<tr>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)}/></td>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)}/></td>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)}/></td>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)}/></td>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)} /></td>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)} /></td>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)} /></td>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)} /></td>
</tr>
<tr>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)}/></td>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)}/></td>
<td colSpan="2"><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)}/></td>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)} /></td>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)} /></td>
<td colSpan="2"><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)} /></td>
</tr>
<tr>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)}/></td>
<td colSpan="3"><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)}/></td>
<td><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)} /></td>
<td colSpan="3"><WSInlineEdit text="Some text to check" onUpdate={text => console.log(text)} /></td>
</tr>
</tbody>
</table>
<br />
<WSTilesChart title="Chart title" data={dashboardMockData.data} width={100} height={100}/>
<WSTilesChart title="Chart title" data={dashboardMockData.data} width={100} height={100} />
</div>
</div>
, document.querySelector('#app-holder'));
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Preact Demo</title>
<title>Fabric Components Demo</title>
<script src="https://use.typekit.net/dpb6nzw.js"></script>
<script>try{Typekit.load({ async: true });}catch(e){}</script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion demo/mockdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export const dashboardMockData = {
moreThan1Day: ['t', 'r', 'g', 'l', '5', '6']
}
}
}
};
22 changes: 11 additions & 11 deletions webpack.config.preact.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ module.exports = {
entry: './demo/demo_app.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'demo'),
path: path.resolve(__dirname, 'demo')
},
module: {
rules: [{
test: /\.js$/,
use: [{
loader: 'babel-loader',
options: { babelrc: true },
options: {babelrc: true}
}],
exclude: [/node_modules/],
exclude: [/node_modules/]
},
{
test: /\.scss$/,
use: [{
loader: 'style-loader', // creates style nodes from JS strings
loader: 'style-loader' // creates style nodes from JS strings
}, {
loader: 'css-loader', // translates CSS into CommonJS
loader: 'css-loader' // translates CSS into CommonJS
}, {
loader: 'sass-loader', // compiles Sass to CSS
}],
loader: 'sass-loader' // compiles Sass to CSS
}]
},
{
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000',
}],
loader: 'url-loader?limit=100000'
}]
},
resolve: {
alias: {
Expand All @@ -39,6 +39,6 @@ module.exports = {
devServer: {
contentBase: path.join(__dirname, 'demo'),
compress: true,
port: 8080,
},
port: 8080
}
};

0 comments on commit 0f1d544

Please sign in to comment.