This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const dot = require(path.resolve(process.argv[2])); | |
const output = { | |
"type": "excalidraw", | |
"version": 2, | |
"source": "https://excalidraw.com", | |
"elements": [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Readable } = require('stream'); | |
const express = require('express'); | |
const createCounterReader = (delay) => { | |
let counter = 0; | |
const reader = new Readable({ | |
read() {}, | |
}); | |
setInterval(() => { | |
counter += 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const electronInstaller = require('electron-winstaller'); | |
(async () => { | |
try { | |
const options = JSON.parse(process.env.OPTIONS || process.argv[process.argv.length - 1]); | |
await electronInstaller.createWindowsInstaller(options); | |
} catch (e) { | |
console.error(e); | |
} | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/imports/api/tasks.tests.js b/imports/api/tasks.tests.js | |
index 1359e85..9b61c5a 100644 | |
--- a/imports/api/tasks.tests.js | |
+++ b/imports/api/tasks.tests.js | |
@@ -2,6 +2,7 @@ | |
import { Meteor } from 'meteor/meteor'; | |
import { Random } from 'meteor/random'; | |
+import { assert } from 'meteor/practicalmeteor:chai'; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/imports/api/tasks.tests.js b/imports/api/tasks.tests.js | |
index 05287ba..1359e85 100644 | |
--- a/imports/api/tasks.tests.js | |
+++ b/imports/api/tasks.tests.js | |
@@ -1,10 +1,26 @@ | |
/* eslint-env mocha */ | |
import { Meteor } from 'meteor/meteor'; | |
+import { Random } from 'meteor/random'; | |
+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/imports/api/tasks.js b/imports/api/tasks.js | |
index 441feee..9d5b56a 100644 | |
--- a/imports/api/tasks.js | |
+++ b/imports/api/tasks.js | |
@@ -36,12 +36,24 @@ Meteor.methods({ | |
'tasks.remove'(taskId) { | |
check(taskId, String); | |
+ const task = Tasks.findOne(taskId); | |
+ if (task.private && task.owner !== Meteor.userId()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/imports/api/tasks.js b/imports/api/tasks.js | |
index f1d2c92..441feee 100644 | |
--- a/imports/api/tasks.js | |
+++ b/imports/api/tasks.js | |
@@ -6,8 +6,14 @@ export const Tasks = new Mongo.Collection('tasks'); | |
if (Meteor.isServer) { | |
// This code only runs on the server | |
+ // Only publish tasks that are public or belong to the current user | |
Meteor.publish('tasks', function tasksPublication() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/imports/ui/Task.jsx b/imports/ui/Task.jsx | |
index db0999e..52450c3 100644 | |
--- a/imports/ui/Task.jsx | |
+++ b/imports/ui/Task.jsx | |
@@ -1,5 +1,6 @@ | |
import React, { Component, PropTypes } from 'react'; | |
import { Meteor } from 'meteor/meteor'; | |
+import classnames from 'classnames'; | |
// Task component - represents a single todo item |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/imports/ui/Task.jsx b/imports/ui/Task.jsx | |
index bec76ba..db0999e 100644 | |
--- a/imports/ui/Task.jsx | |
+++ b/imports/ui/Task.jsx | |
@@ -12,6 +12,10 @@ export default class Task extends Component { | |
Meteor.call('tasks.remove', this.props.task._id); | |
} | |
+ togglePrivate() { | |
+ Meteor.call('tasks.setPrivate', this.props.task._id, ! this.props.task.private); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/imports/ui/Task.jsx b/imports/ui/Task.jsx | |
index deba74a..bec76ba 100644 | |
--- a/imports/ui/Task.jsx | |
+++ b/imports/ui/Task.jsx | |
@@ -30,6 +30,12 @@ export default class Task extends Component { | |
onClick={this.toggleChecked.bind(this)} | |
/> | |
+ { this.props.showPrivateButton ? ( | |
+ <button className="toggle-private" onClick={this.togglePrivate.bind(this)}> |
NewerOlder