Skip to content

Commit

Permalink
chore(all): linter fixes; gitignores; failing test warnings
Browse files Browse the repository at this point in the history
* remove unused tests in markdown sample
* various linter fixes
* gitignores updated to not include dist folders

Related isssues #4
#5
  • Loading branch information
zewa666 committed Feb 26, 2018
1 parent b11d925 commit aba7de7
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 100 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Examples for the [Aurelia-Store](https://github.com/zewa666/aurelia-store) plugi
> If `au run` does not work, make sure to install aurelia-cli globally via `npm install -g aurelia-cli` or respectively ` yarn global add aurelia-cli` if you're using Yarn.
## Markdown
A simple markdown with history support
A simple markdown editor with history support

* TypeScript with WebPack using the Aurelia CLI
* Aurelia-Store using a StateHistory<State>
Expand All @@ -34,6 +34,9 @@ A todo app showing the basics of the Store plugin from the perspective of a Vuex

> Originally from [https://github.com/Vheissu/aurelia-store-todo](https://github.com/Vheissu/aurelia-store-todo)
> There will be some warnings emitted by Webpack with regards to the css-loader, which are a known issue in the current
Aurelia-UX status.

## Vis
Minimal example of integrating [vis.js](http://visjs.org/index.html) with an Aurelia Store powered app and visualizing searched GitHub users.

Expand Down
2 changes: 1 addition & 1 deletion contacts/src/contact-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class ContactDetail {
constructor(api, store) {
this.api = api;
this.store = store;
this.store.state.subscribe( state => this.state = state );
this.store.state.subscribe(state => this.state = state);
}

activate(params, routeConfig) {
Expand Down
8 changes: 4 additions & 4 deletions contacts/src/resources/elements/loading-indicator.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as nprogress from 'nprogress';
import {bindable, noView} from 'aurelia-framework';
import { bindable, noView } from 'aurelia-framework';

@noView(['nprogress/nprogress.css'])
export class LoadingIndicator {
@bindable loading = false;

loadingChanged(newValue){
if(newValue){
loadingChanged(newValue) {
if (newValue) {
nprogress.start();
}else{
} else {
nprogress.done();
}
}
Expand Down
4 changes: 2 additions & 2 deletions contacts/src/utility.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function areEqual(obj1, obj2) {
return Object.keys(obj1).every((key) => obj2.hasOwnProperty(key) && (obj1[key] === obj2[key]));
};
return Object.keys(obj1).every((key) => obj2.hasOwnProperty(key) && (obj1[key] === obj2[key]));
};
78 changes: 40 additions & 38 deletions contacts/src/web-api.js
Original file line number Diff line number Diff line change
@@ -1,68 +1,70 @@
let latency = 200;
let id = 0;

function getId(){
function getId() {
return ++id;
}

let contacts = [
{
id:getId(),
firstName:'John',
lastName:'Tolkien',
email:'tolkien@inklings.com',
phoneNumber:'867-5309'
id: getId(),
firstName: 'John',
lastName: 'Tolkien',
email: 'tolkien@inklings.com',
phoneNumber: '867-5309'
},
{
id:getId(),
firstName:'Clive',
lastName:'Lewis',
email:'lewis@inklings.com',
phoneNumber:'867-5309'
id: getId(),
firstName: 'Clive',
lastName: 'Lewis',
email: 'lewis@inklings.com',
phoneNumber: '867-5309'
},
{
id:getId(),
firstName:'Owen',
lastName:'Barfield',
email:'barfield@inklings.com',
phoneNumber:'867-5309'
id: getId(),
firstName: 'Owen',
lastName: 'Barfield',
email: 'barfield@inklings.com',
phoneNumber: '867-5309'
},
{
id:getId(),
firstName:'Charles',
lastName:'Williams',
email:'williams@inklings.com',
phoneNumber:'867-5309'
id: getId(),
firstName: 'Charles',
lastName: 'Williams',
email: 'williams@inklings.com',
phoneNumber: '867-5309'
},
{
id:getId(),
firstName:'Roger',
lastName:'Green',
email:'green@inklings.com',
phoneNumber:'867-5309'
id: getId(),
firstName: 'Roger',
lastName: 'Green',
email: 'green@inklings.com',
phoneNumber: '867-5309'
}
];

export class WebAPI {
isRequesting = false;
getContactList(){

getContactList() {
this.isRequesting = true;
return new Promise(resolve => {
setTimeout(() => {
let results = contacts.map(x => { return {
id:x.id,
firstName:x.firstName,
lastName:x.lastName,
email:x.email
}});
let results = contacts.map(x => {
return {
id: x.id,
firstName: x.firstName,
lastName: x.lastName,
email: x.email
}
});
resolve(results);
this.isRequesting = false;
}, latency);
});
}

getContactDetails(id){
getContactDetails(id) {
this.isRequesting = true;
return new Promise(resolve => {
setTimeout(() => {
Expand All @@ -73,17 +75,17 @@ export class WebAPI {
});
}

saveContact(contact){
saveContact(contact) {
this.isRequesting = true;
return new Promise(resolve => {
setTimeout(() => {
let instance = JSON.parse(JSON.stringify(contact));
let found = contacts.filter(x => x.id == contact.id)[0];

if(found){
if (found) {
let index = contacts.indexOf(found);
contacts[index] = instance;
}else{
} else {
instance.id = getId();
contacts.push(instance);
}
Expand Down
2 changes: 2 additions & 0 deletions markdown/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ node_modules

# Compiled files
scripts

dist
30 changes: 15 additions & 15 deletions markdown/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions markdown/test/unit/app.spec.ts

This file was deleted.

2 changes: 2 additions & 0 deletions todo/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ node_modules

# Compiled files
scripts

dist
Loading

0 comments on commit aba7de7

Please sign in to comment.