Skip to content

Commit f9ce76f

Browse files
committed
2 parents 66f6173 + 2b628f2 commit f9ce76f

36 files changed

+480
-93
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/dist
55
/tmp
66
/out-tsc
7+
src/environments/secrets.ts
78

89
# dependencies
910
/node_modules
@@ -34,6 +35,7 @@ npm-debug.log
3435
yarn-error.log
3536
testem.log
3637
/typings
38+
.env
3739

3840
# System Files
3941
.DS_Store

.grenrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"dataSource": "commits",
3+
"template": {
4+
"commit": "- {{message}} ([→]({{url}}))",
5+
"issue": "- {{labels}} {{name}} [{{text}}]({{url}})",
6+
"label": "[**{{label}}**]",
7+
"noLabel": "closed",
8+
"group": "\n#### {{heading}}\n",
9+
"changelogTitle": "# Changelog\n\n",
10+
"release": "## {{release}} ({{date}})\n{{body}}",
11+
"releaseSeparator": "\n---\n\n"
12+
},
13+
"groupBy": {
14+
"Enhancements:": ["enhancement", "internal"],
15+
"Bug Fixes:": ["bug"],
16+
"Build Improvements":["view"]
17+
}
18+
}

CHANGELOG.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1-
<a name="1.0.0-beta.0"></a>
2-
# 1.0.0-beta.0 (2018-05-27)
3-
4-
5-
### Features
6-
7-
* added material CDK for color picker popup ([d02fd13](https://github.com/lokesh-coder/ink-bucket/commit/d02fd13))
8-
* added nedb for client side storage ([7929f75](https://github.com/lokesh-coder/ink-bucket/commit/7929f75))
9-
* added settings state and actions for test ([8152f65](https://github.com/lokesh-coder/ink-bucket/commit/8152f65))
10-
* Initial commit ([16e54d1](https://github.com/lokesh-coder/ink-bucket/commit/16e54d1))
11-
* store actions added ([8e50805](https://github.com/lokesh-coder/ink-bucket/commit/8e50805))
12-
* **delete:** added delete option in settings ([26fccd7](https://github.com/lokesh-coder/ink-bucket/commit/26fccd7))
13-
* updated store and added color picker ([df3ae6b](https://github.com/lokesh-coder/ink-bucket/commit/df3ae6b))
14-
* **electron:** basic electron setup ([c4e566e](https://github.com/lokesh-coder/ink-bucket/commit/c4e566e))
15-
* **export:** added database export option in settings ([78a27c0](https://github.com/lokesh-coder/ink-bucket/commit/78a27c0))
16-
* **pwa:** basic pwa setup ([32379e7](https://github.com/lokesh-coder/ink-bucket/commit/32379e7))
17-
* **wip:** design changes ([6fd994c](https://github.com/lokesh-coder/ink-bucket/commit/6fd994c))
18-
* **wip:** updated ink colors service ([41936ac](https://github.com/lokesh-coder/ink-bucket/commit/41936ac))
1+
# Changelog
192

3+
## v1.0.0-beta.1 (29/05/2018)
4+
- style(view): home page layout width ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/cae9800855d7f566154c0502a10e224a0c698a38))
5+
- fix(view): duplicate of colors and buckets on page revisits ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/2fe92cad531f638f730bae0c359dc12362be0c48))
6+
- style(view): add new thin color view ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/d90ca9f96c5e587d9dfc3b81f513fb03573da93d))
7+
- feat(view): add ink color view basic settings and state ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/ab39f30b2155b3075253a7122de616c4e57c9e0b))
8+
- build: add github release module ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/50093fc82316735fa0bbceaf0d3f09852994b2e7))
9+
- chore(changelog): added changelog ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/c6eeb8a6e24bd80e77911804fb1c23873ddf0da9))
2010

11+
---
2112

13+
## v1.0.0-beta.0 (28/05/2018)
14+
- feat(pwa): basic pwa setup ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/32379e79b8f497ee81e6430c20960f17c64e9e8b))
15+
- feat(electron): basic electron setup ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/c4e566eba0ff3c0346ca5d8a4bcb100ce2711508))
16+
- feat(wip): updated ink colors service ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/41936ac9d0bcd1b0b2a452936c23d036fa680b7b))
17+
- style(font): changed to default system font ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/d5b6d28f719bc5dae05a7a40f90f2d6de5e4f9b4))
18+
- feat(delete): added delete option in settings ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/26fccd794fd05d6a2f1e4131a8bc242d5b18d759))
19+
- feat(export): added database export option in settings ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/78a27c03763852f99aa023eb92c387b87c77b53f))
20+
- feat(wip): design changes ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/6fd994c74e5d868b5be0632164a095d38923bb3b))
21+
- refactor(wip): updated board and bucket data layer ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/339ba42e6e2f3e430a999711f6edd28539eb2540))
22+
- refactor(wip): change nedb to rxdb ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/dbbc7f7e921ba48e0c121a6f217e69d57b523df0))
23+
- style: app design update ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/56ac2b3c126d71b9a91954d070b40ad7bd5c0875))
24+
- feat: store actions added ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/8e5080513e1e178320c1396f052a45d6e5a8272f))
25+
- feat: added material CDK for color picker popup ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/d02fd13659b024b277b8e7b21a0a83373833f1c1))
26+
- feat: updated store and added color picker ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/df3ae6b7923b7dfd052dcdf7cf480fbc47c7b367))
27+
- feat: added settings state and actions for test ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/8152f65ecb15f2d79c2958e7b8e437bce8d5fae7))
28+
- feat: added nedb for client side storage ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/7929f750481be69664400175ccbb219d2b676b13))
29+
- feat: Initial commit ([](https://api.github.com/repos/lokesh-coder/ink-bucket/git/commits/16e54d15e82ef12da4dcf9621295b477ab7c910b))

config/env.secrets.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { writeFile } from 'fs';
2+
import { argv } from 'yargs';
3+
4+
require('dotenv').config();
5+
6+
const targetPath = `./src/environments/secrets.ts`;
7+
const envConfigFile = `
8+
export const githubClientSecret= '${process.env.GITHUB_CLIENT_SECRET}';
9+
export const githubClientID= '${process.env.GITHUB_CLIENT_ID}';
10+
`;
11+
writeFile(targetPath, envConfigFile, function(err) {
12+
if (err) {
13+
console.log(err);
14+
}
15+
16+
console.log(`secrets file generated at ${targetPath}`);
17+
});

config/proxy.conf.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"/ghtoken/*": {
3+
"target": "https://github.com/login/oauth/access_token",
4+
"secure": false,
5+
"logLevel": "debug",
6+
"changeOrigin": true,
7+
"pathRewrite": { "^/ghtoken": "" }
8+
}
9+
}

package-lock.json

Lines changed: 32 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"main": "main.js",
55
"scripts": {
66
"ng": "ng",
7-
"start": "ng serve",
7+
"config:secrets": "ts-node ./config/env.secrets.ts",
8+
"start":
9+
"npm run config:secrets && ng serve --proxy-config config/proxy.conf.json -o --host=0.0.0.0 --disable-host-check",
810
"build": "ng build",
911
"test": "ng test",
1012
"lint": "ng lint",
@@ -14,8 +16,8 @@
1416
"electron": "electron .",
1517
"electron-build": "ng build --prod && electron .",
1618
"server:prod": "http-server -p 1234 -s -o --cors",
17-
"generate:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
18-
"release": "gren release --token=TOKEN --override"
19+
"release": "gren release --token=TOKEN --data-source=commits --override",
20+
"generate:changelog": "gren changelog --token=TOKEN --data-source=commits --override"
1921
},
2022
"private": true,
2123
"dependencies": {
@@ -31,6 +33,8 @@
3133
"@angular/platform-browser-dynamic": "^6.0.0",
3234
"@angular/pwa": "^0.6.5",
3335
"@angular/router": "^6.0.0",
36+
"@angular/service-worker": "^6.0.0",
37+
"@auth0/angular-jwt": "^2.0.0",
3438
"@ctrl/tinycolor": "^2.0.0",
3539
"@ngxs/devtools-plugin": "^3.0.1",
3640
"@ngxs/store": "^3.0.1",
@@ -41,6 +45,7 @@
4145
"babel-polyfill": "^6.26.0",
4246
"bootstrap": "^4.1.1",
4347
"core-js": "^2.5.4",
48+
"deepmerge": "^2.1.1",
4449
"fuse.js": "^3.2.0",
4550
"gun": "^0.9.996",
4651
"keypress.js": "^2.1.5",
@@ -56,8 +61,7 @@
5661
"relational-pouch": "^3.0.1",
5762
"rxdb": "^7.6.0",
5863
"rxjs": "^6.0.0",
59-
"zone.js": "^0.8.26",
60-
"@angular/service-worker": "^6.0.0"
64+
"zone.js": "^0.8.26"
6165
},
6266
"devDependencies": {
6367
"@angular-devkit/build-angular": "~0.6.0",
@@ -72,6 +76,7 @@
7276
"@types/node": "~8.9.4",
7377
"@types/pouchdb": "^6.3.2",
7478
"codelyzer": "~4.2.1",
79+
"dotenv": "^5.0.1",
7580
"electron": "^2.0.2",
7681
"github-release-notes": "^0.15.0",
7782
"husky": "^0.14.3",

src/app/components/bucket/bucket.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<inkapp-magic-title [title]="bucketData.name" (changed)="onTitleChange($event)">
2-
#{{index}}
1+
<inkapp-magic-title [title]="bucketData.name" (changed)="onTitleChange($event)" [index]="index" (delete)="deleteBucket()">
32
</inkapp-magic-title>
43
<div class="d-flex flex-wrap">
54
<ng-container *ngFor="let color of ink|async">

src/app/components/bucket/bucket.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Observable } from 'rxjs';
55
import { filter, tap, map } from 'rxjs/operators';
66
import { AddInkColor, LoadInkColorsInBucket } from '../../store/actions/ink.action';
77
import { BucketService } from '../../services/bucket.service';
8-
import { RenameBucket } from '../../store/actions/bucket.action';
8+
import { RenameBucket, DeleteBucket } from '../../store/actions/bucket.action';
99
import { InkColorService } from '../../services/ink.service';
1010

1111
@Component({
@@ -43,4 +43,10 @@ export class BucketComponent implements OnInit {
4343
this._store.dispatch(new RenameBucket(this.bucketData._id, bucket.name));
4444
});
4545
}
46+
47+
deleteBucket() {
48+
this._bucketService.deleteBucket(this.bucketData._id).then(bucket => {
49+
this._store.dispatch(new DeleteBucket(this.bucketData._id));
50+
});
51+
}
4652
}
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
<ng-container *ngIf="!editable else editableTpl">
2-
<h5>
3-
<span>
4-
<ng-content></ng-content>
5-
</span> {{title}}</h5>
6-
</ng-container>
7-
<ng-template #editableTpl>
8-
<input type="text" class="form-control" [(ngModel)]="newTitle" (keyup.enter)="done()" (keyup.esc)="cancel()">
9-
</ng-template>
1+
<div class="inkapp--titlebar" [ngClass]="{'-has-prompt':editable}">
2+
<div class="title" (dblclick)="allowEditing()">
3+
<i class="prefix">#{{index}}</i> {{title}}
4+
</div>
5+
<div class="action">
6+
<button class="btn -is-plain -is-compact --only-on-parent-hover" (click)="delete.emit()">
7+
<i class="ink-icon icon-trash text-danger"></i>
8+
</button>
9+
</div>
10+
<div class="prompt">
11+
<input type="text" class="form-control -is-inline" [(ngModel)]="newTitle" (keyup.enter)="done()" (keyup.esc)="cancel()">
12+
</div>
13+
</div>

src/app/components/magic-title/magic-title.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { Component, OnInit, EventEmitter, Output, Input, HostListener } from '@a
77
export class MagicTitleComponent implements OnInit {
88
@Output() changed: EventEmitter<string> = new EventEmitter<string>();
99
@Input() title: string;
10+
@Input() index: number;
11+
@Output() delete: EventEmitter<string> = new EventEmitter();
1012
editable = false;
1113
newTitle: string;
1214
constructor() {}
@@ -15,8 +17,7 @@ export class MagicTitleComponent implements OnInit {
1517
this.newTitle = this.title;
1618
}
1719

18-
@HostListener('dblclick', ['$event.target'])
19-
onDblClick(e) {
20+
allowEditing(e) {
2021
this.editable = true;
2122
}
2223

src/app/ink.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, OnInit, NgZone } from '@angular/core';
22
import { Store } from '@ngxs/store';
3-
import { ChangeView, LoadSettings } from './store/actions/settings.action';
3+
import { LoadSettings } from './store/actions/settings.action';
44
import { InkAppView, InkDb } from './models';
55
import { DBService } from './services/db.service';
66
import { tap } from 'rxjs/operators';
@@ -21,7 +21,9 @@ export class InkApp implements OnInit {
2121
}
2222
ngOnInit() {
2323
this._settingsService.setDefaultSettings().then((doc: any) => {
24-
if (doc) { this._store.dispatch(new LoadSettings(doc)); }
24+
if (doc) {
25+
this._store.dispatch(new LoadSettings(doc));
26+
}
2527
});
2628
}
2729
}

0 commit comments

Comments
 (0)