Skip to content

Commit

Permalink
Polymer 2.0 Upgrade (#35)
Browse files Browse the repository at this point in the history
* Initial upgrade attempt

* Remove old dependencies

* Fix a bunch of linter errors and imports

* Dynamic column creation for vaadin grid

* Partially fix dynamic column creation

* Fix columnrenderer, apply material design and add sorting

* Add sorting icon and selection column

* Fix webcomponents javascript and consumption dropdown

* Fix build

* Update build.sh for new build process

* Clean dependencies and structured root directory

* Add last style fixes and hide empty table
  • Loading branch information
Sille Kamoen authored and martijnjanssen committed Aug 15, 2017
1 parent 69b1402 commit 6c6b0dc
Show file tree
Hide file tree
Showing 29 changed files with 2,786 additions and 1,363 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ FROM nginx:alpine
WORKDIR /tmp/app
ADD . ./

COPY nginx_server.conf /etc/nginx/conf.d/default.conf
COPY ./docker/nginx_server.conf /etc/nginx/conf.d/default.conf

RUN sh ./build.sh
RUN sh ./docker/dockerbuild.sh
42 changes: 21 additions & 21 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
"description": "Admin panel for the LANcie API",
"main": "index.html",
"dependencies": {
"iron-elements": "PolymerElements/iron-elements#^1.0.10",
"paper-elements": "PolymerElements/paper-elements#^1.0.7",
"gold-elements": "PolymerElements/gold-elements#^1.0.1",
"neon-elements": "PolymerElements/neon-elements#^1.0.0",
"polymer": "polymer/polymer#^1.7.0",
"wisvch-footer": "wisvch/wisvch-footer#^1.0.1",
"app-layout": "PolymerElements/app-layout#^0.10.4",
"app-route": "polymerelements/app-route#^0.9.2",
"polymer": "polymer/polymer#^2.0.0",
"app-layout": "PolymerElements/app-layout#^2.0.1",
"app-route": "polymerelements/app-route#^2.0.1",
"webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0",
"web-animations-js": "web-animations/web-animations-js#^2.2.2",

"iron-lazy-pages": "TimvdLippe/iron-lazy-pages#2.0-preview",
"lancie-login-card": "AreaFiftyLAN/lancie-login-card#1.0.0",
"lancie-ajax": "AreaFiftyLAN/lancie-ajax#1.0.1",
"vaadin-grid": "^1.2.1"
"lancie-login-card": "AreaFiftyLAN/lancie-login-card#^2.0.0",
"lancie-ajax": "AreaFiftyLAN/lancie-ajax#^2.0.0",

"paper-listbox": "PolymerElements/paper-listbox#^2.0.0",
"paper-item": "PolymerElements/paper-item#^2.0.0",
"paper-toast": "PolymerElements/paper-toast#^2.0.0",
"paper-checkbox": "PolymerElements/paper-checkbox#^2.0.0",
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^2.0.0",

"iron-icon": "PolymerElements/iron-icon#^2.0.0",
"iron-input": "PolymerElements/iron-input#^2.0.0",
"iron-icons": "PolymerElements/iron-icons#^2.0.0",

"vaadin-grid": "vaadin/vaadin-grid#^3.0.0"
},
"devDependencies": {
"web-component-tester": "*",
"test-fixture": "PolymerElements/test-fixture#^1.0.0"
},
"resolutions": {
"polymer": "^1.7.0",
"iron-selector": "^2.0.0",
"iron-resizable-behavior": "^1.0.0",
"neon-animation": "^1.0.0",
"webcomponentsjs": "^0.7.20",
"iron-meta": "^1.0.0",
"test-fixture": "^3.0.0-rc.1"
"test-fixture": "PolymerElements/test-fixture#^3.0.0"
}
}
2 changes: 1 addition & 1 deletion build.sh → docker/dockerbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ bower --allow-root install
# Compress images and build
yarn run build optimize-images
yarn run build
cp -r ./build/bundled/. /srv/www
cp -r ./build/. /srv/www

# Uninstall installed build dependencies and remove cache
yarn cache clean
Expand Down
File renamed without changes.
22 changes: 0 additions & 22 deletions gulp-tasks/clean.js

This file was deleted.

142 changes: 0 additions & 142 deletions gulp-tasks/project.js

This file was deleted.

31 changes: 31 additions & 0 deletions gulp/ensure-lazy-fragments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict';

const Analyzer = require('polymer-analyzer').Analyzer;
const FSUrlLoader = require('polymer-analyzer/lib/url-loader/fs-url-loader').FSUrlLoader;
const PackageUrlResolver = require('polymer-analyzer/lib/url-loader/package-url-resolver').PackageUrlResolver;
const HtmlCustomElementReferenceScanner = require('polymer-analyzer/lib/html/html-element-reference-scanner').HtmlCustomElementReferenceScanner;
const dom5 = require('dom5');
const fragments = require('./polymer.json').fragments;

const analyzer = new Analyzer({
urlLoader: new FSUrlLoader('./'),
urlResolver: new PackageUrlResolver(),
scanners: new Map([['html', [new HtmlCustomElementReferenceScanner()]]])
});

module.exports = () => new Promise((resolve, reject) => {
analyzer.analyze('src/lancie-content.html')
.then((document) => {
for (const element of document.getByKind('element-reference')) {
const astNode = element.astNode;
if (astNode.parentNode.tagName === 'iron-lazy-pages') {
const childLocation = dom5.getAttribute(astNode, 'data-path');
if (!fragments.find(e => e === `src/${childLocation}`)) {
reject(`Could not find fragment "src/${childLocation}" in polymer.json!`);
return;
}
}
}
resolve();
});
});
7 changes: 5 additions & 2 deletions polymer.json → gulp/polymer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"manifest.json",
"favicon.ico",
"robots.txt",
"bower_components/webcomponentsjs/webcomponents-lite.min.js"
]
"bower_components/webcomponentsjs/webcomponents-loader.js"
],
"lint": {
"rules": ["polymer-2"]
}
}
Loading

0 comments on commit 6c6b0dc

Please sign in to comment.