Commit 2bbd17a0c84a7c62c0866b46e0c4120604b45f71

Authored by Rohan Rangray
1 parent 2bbfdb2bd8
Exists in master

Removed the arrows going into edgelabels. Prettified things.

Showing 29 changed files with 505 additions and 97 deletions Side-by-side Diff

node_modules/sqlt/.npmignore View file @ 2bbd17a
  1 +*.swp
  2 +.DS_Store
  3 +node_modules/
  4 +npm-debug.log
node_modules/sqlt/.travis.yml View file @ 2bbd17a
  1 +language: node_js
  2 +node_js:
  3 + - "0.10"
node_modules/sqlt/LICENSE View file @ 2bbd17a
  1 +Copyright (c) 2014, Eugene Ware
  2 +All rights reserved.
  3 +
  4 +Redistribution and use in source and binary forms, with or without
  5 +modification, are permitted provided that the following conditions are met:
  6 +
  7 +1. Redistributions of source code must retain the above copyright
  8 + notice, this list of conditions and the following disclaimer.
  9 +2. Redistributions in binary form must reproduce the above copyright
  10 + notice, this list of conditions and the following disclaimer in the
  11 + documentation and/or other materials provided with the distribution.
  12 +3. Neither the name of Eugene Ware nor the names of its contributors
  13 + may be used to endorse or promote products derived from this software
  14 + without specific prior written permission.
  15 +
  16 +THIS SOFTWARE IS PROVIDED BY EUGENE WARE ''AS IS'' AND ANY
  17 +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18 +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19 +DISCLAIMED. IN NO EVENT SHALL EUGENE WARE BE LIABLE FOR ANY
  20 +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21 +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22 +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23 +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25 +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
node_modules/sqlt/README.md View file @ 2bbd17a
  1 +# sqlt
  2 +
  3 +Simple SQL Templating helper inspired by [Yesql](https://github.com/krisajenkins/yesql)
  4 +
  5 +[![build status](https://secure.travis-ci.org/eugeneware/sqlt.png)](http://travis-ci.org/eugeneware/sqlt)
  6 +
  7 +Give this library the location of a SQL template file, and it will return a function that
  8 +you can call with a [mysql](https://www.npmjs.org/package/mysql) or [pg](https://www.npmjs.org/package/pg) connection, an optional array of parameters, and a callback.
  9 +
  10 +## Installation
  11 +
  12 +This module is installed via npm:
  13 +
  14 +``` bash
  15 +$ npm install sqlt
  16 +```
  17 +
  18 +## Example Usage
  19 +
  20 +### Simple SQL query with no params
  21 +
  22 +Given a SQL template file located in /path/to/queries/getUsers.sql
  23 +
  24 +``` sql
  25 +SELECT
  26 + *
  27 +FROM
  28 + users;
  29 +```
  30 +
  31 +You can get a function that is easily callable with a database connection
  32 +handle, and get a callback:
  33 +
  34 +``` js
  35 +var sqlt = require('sqlt'),
  36 + mysql = require('mysql');
  37 +
  38 +var conn = mysql.createConnection({
  39 + host: 'yourdatabase.com',
  40 + database: 'yourdbname',
  41 + user: 'yourdbusername',
  42 + password: 'yourpassword'
  43 +});
  44 +
  45 +var getUsers = sqlt('/path/to/queries/getUsers.sql');
  46 +getUsers(conn, function (err, results) {
  47 + if (err) throw err;
  48 + console.log(results);
  49 +});
  50 +```
  51 +
  52 +### SQL query with params
  53 +
  54 +Given a SQL template file located in /path/to/queries/getUsersByIdOrEmail.sql
  55 +
  56 +``` sql
  57 +SELECT
  58 + *
  59 +FROM
  60 + users
  61 +WHERE
  62 + id = ? OR email = ?;
  63 +```
  64 +
  65 +You can get a function that is easily callable with a database connection
  66 +handle, an array of parameters, and get a callback:
  67 +
  68 +``` js
  69 +var sqlt = require('sqlt'),
  70 + mysql = require('mysql');
  71 +
  72 +var conn = mysql.createConnection({
  73 + host: 'yourdatabase.com',
  74 + database: 'yourdbname',
  75 + user: 'yourdbusername',
  76 + password: 'yourpassword'
  77 +});
  78 +
  79 +var getUsersByIdOrEmail = sqlt('/path/to/queries/getUsersByIdOrEmail.sql');
  80 +getUsersByIdOrEmail(conn, [1234, 'bob@hotmail.com'], function (err, results) {
  81 + if (err) throw err;
  82 + console.log(results);
  83 +});
  84 +```
  85 +
  86 +### Load a directory full of queries
  87 +
  88 +Given a folder that contains a list of `.sql` files (say the `getUsers.sql` and
  89 +`getUsersByIdOrEmail.sql` file above:
  90 +
  91 +You can get a single object where each `.sql` file is turned into a query
  92 +helping function:
  93 +
  94 +``` js
  95 +var sqlt = require('sqlt'),
  96 + mysql = require('mysql');
  97 +
  98 +var conn = mysql.createConnection({
  99 + host: 'yourdatabase.com',
  100 + database: 'yourdbname',
  101 + user: 'yourdbusername',
  102 + password: 'yourpassword'
  103 +});
  104 +
  105 +var queries = sqlt.dir('/path/to/queries');
  106 +queries.getUsers(conn, function (err, results) {
  107 + if (err) throw err;
  108 + console.log(results);
  109 +});
  110 +queries.getUsersByIdOrEmail(conn, [1234, 'bob@hotmail.com'], function (err, results) {
  111 + if (err) throw err;
  112 + console.log(results);
  113 +});
  114 +```
  115 +
  116 +### Streaming support
  117 +
  118 +By not passing through a callback the query functions will return streams
  119 +(depends on the underlying database library - eg below is for [mysql](http://npmjs.org/mysql)).
  120 +
  121 +Given a SQL template file located in /path/to/queries/getUsersByIdOrEmail.sql
  122 +
  123 +``` sql
  124 +SELECT
  125 + *
  126 +FROM
  127 + users
  128 +WHERE
  129 + id = ? OR email = ?;
  130 +```
  131 +
  132 +You can get the stream by not passing through a callback:
  133 +
  134 +``` js
  135 +var sqlt = require('sqlt'),
  136 + mysql = require('mysql');
  137 +
  138 +var conn = mysql.createConnection({
  139 + host: 'yourdatabase.com',
  140 + database: 'yourdbname',
  141 + user: 'yourdbusername',
  142 + password: 'yourpassword'
  143 +});
  144 +
  145 +var getUsersByIdOrEmail = sqlt('/path/to/queries/getUsersByIdOrEmail.sql');
  146 +var stream = getUsersByIdOrEmail(conn, [1234, 'bob@hotmail.com']).stream();
  147 +stream.on('data', console.log);
  148 +// stream.pipe()
  149 +```
  150 +
  151 +
  152 +### Pull Requests Welcome!
node_modules/sqlt/index.js View file @ 2bbd17a
  1 +var fs = require('fs'),
  2 + path = require('path');
  3 +
  4 +function makeSql(stmt) {
  5 + return function (conn, params, cb) {
  6 + if (typeof cb === 'undefined' && typeof params === 'function') {
  7 + cb = params;
  8 + params = [];
  9 + }
  10 + if (typeof cb === 'undefined') {
  11 + // for piping
  12 + return conn.query(stmt, params);
  13 + } else {
  14 + conn.query(stmt, params, cb);
  15 + }
  16 + };
  17 +}
  18 +
  19 +module.exports = sqlt;
  20 +function sqlt(sqlFile) {
  21 + var stmt = fs.readFileSync(sqlFile, 'utf8');
  22 + return makeSql(stmt);
  23 +};
  24 +
  25 +module.exports.dir = sqltDir;
  26 +
  27 +function sqltDir(dir) {
  28 + var queries = {};
  29 + function isSql(name){
  30 + return name.slice(-4,name.length) === '.sql';
  31 + }
  32 + var files = fs.readdirSync(dir).filter(isSql);
  33 +
  34 + var contents = files.map(function(fileName){
  35 + return fs.readFileSync(path.join(dir,fileName)).toString();
  36 + });
  37 + files.forEach(function(fileName,i){
  38 + queries[fileName.slice(0,-4)] = makeSql(contents[i]);
  39 + });
  40 + return queries;
  41 +}
node_modules/sqlt/package.json View file @ 2bbd17a
  1 +{
  2 + "name": "sqlt",
  3 + "version": "1.1.1",
  4 + "description": "Simple SQL Templating helper inspired by Yesql",
  5 + "main": "index.js",
  6 + "scripts": {
  7 + "test": "mocha"
  8 + },
  9 + "repository": {
  10 + "type": "git",
  11 + "url": "https://github.com/eugeneware/sqlt"
  12 + },
  13 + "keywords": [
  14 + "sql",
  15 + "yesql",
  16 + "presql",
  17 + "template",
  18 + "file",
  19 + "database",
  20 + "mysql",
  21 + "pg",
  22 + "postgres",
  23 + "postgresql",
  24 + "mysql",
  25 + "orm"
  26 + ],
  27 + "author": {
  28 + "name": "Eugene Ware",
  29 + "email": "eugene@noblesamurai.com"
  30 + },
  31 + "license": "BSD-3-Clause",
  32 + "bugs": {
  33 + "url": "https://github.com/eugeneware/sqlt/issues"
  34 + },
  35 + "dependencies": {},
  36 + "devDependencies": {
  37 + "expect.js": "~0.2.0",
  38 + "mocha": "~1.17.0"
  39 + },
  40 + "homepage": "https://github.com/eugeneware/sqlt",
  41 + "_id": "sqlt@1.1.1",
  42 + "dist": {
  43 + "shasum": "5e3b48cec68b3b6a9b80d60e5dd5656009b246e6",
  44 + "tarball": "http://registry.npmjs.org/sqlt/-/sqlt-1.1.1.tgz"
  45 + },
  46 + "_from": "sqlt@*",
  47 + "_npmVersion": "1.4.3",
  48 + "_npmUser": {
  49 + "name": "eugeneware",
  50 + "email": "eugene@noblesamurai.com"
  51 + },
  52 + "maintainers": [
  53 + {
  54 + "name": "eugeneware",
  55 + "email": "eugene@noblesamurai.com"
  56 + }
  57 + ],
  58 + "directories": {},
  59 + "_shasum": "5e3b48cec68b3b6a9b80d60e5dd5656009b246e6",
  60 + "_resolved": "https://registry.npmjs.org/sqlt/-/sqlt-1.1.1.tgz"
  61 +}
node_modules/sqlt/test/fixtures/getUsers.sql View file @ 2bbd17a
  1 +SELECT
  2 + *
  3 +FROM
  4 + users;
node_modules/sqlt/test/fixtures/getUsersByIdOrEmail.sql View file @ 2bbd17a
  1 +SELECT
  2 + *
  3 +FROM
  4 + users
  5 +WHERE
  6 + id = ? OR email = ?;
node_modules/sqlt/test/index.js View file @ 2bbd17a
  1 +var expect = require('expect.js'),
  2 + path = require('path'),
  3 + sqlt = require('..');
  4 +
  5 +describe('sqlt', function() {
  6 + // simple mock
  7 + var conn = {
  8 + query: function (stmt, params, cb) {
  9 + if (typeof cb === 'undefined' && typeof params === 'function') {
  10 + cb = params;
  11 + params = [];
  12 + }
  13 + if (typeof cb === 'undefined') {
  14 + return {
  15 + pipe: function () {
  16 + return stmt;
  17 + }
  18 + };
  19 + } else {
  20 + cb(null, stmt);
  21 + }
  22 + }
  23 + };
  24 +
  25 + it('should be able to read a SQL statement', function(done) {
  26 + var getUsers = sqlt(path.join(__dirname, 'fixtures', 'getUsers.sql'));
  27 + getUsers(conn, function (err, res) {
  28 + if (err) return done(err);
  29 + var expected =
  30 + "SELECT\n" +
  31 + " *\n" +
  32 + "FROM\n" +
  33 + " users;\n"
  34 + expect(res).to.equal(expected);
  35 + done();
  36 + });
  37 + });
  38 +
  39 + it('should be able to read a parameterized statement', function(done) {
  40 + var getUsersByIdOrEmail = sqlt(path.join(__dirname, 'fixtures', 'getUsersByIdOrEmail.sql'));
  41 + getUsersByIdOrEmail(conn, [123, 'bob@hotmail.com'], function (err, res) {
  42 + if (err) return done(err);
  43 + var expected =
  44 + "SELECT\n" +
  45 + " *\n" +
  46 + "FROM\n" +
  47 + " users\n" +
  48 + "WHERE\n" +
  49 + " id = ? OR email = ?;\n";
  50 + expect(res).to.equal(expected);
  51 + done();
  52 + });
  53 + });
  54 +
  55 + it('should be able to read a directory of queries', function(done) {
  56 + var queries = sqlt.dir(path.join(__dirname, 'fixtures'));
  57 + expect(queries.getUsers).to.be.a('function');
  58 + expect(queries.getUsersByIdOrEmail).to.be.a('function');
  59 +
  60 + doUsers();
  61 +
  62 + function doUsers() {
  63 + queries.getUsers(conn, function (err, res) {
  64 + if (err) return done(err);
  65 + var expected =
  66 + "SELECT\n" +
  67 + " *\n" +
  68 + "FROM\n" +
  69 + " users;\n"
  70 + expect(res).to.equal(expected);
  71 + doParam();
  72 + });
  73 + }
  74 +
  75 + function doParam() {
  76 + queries.getUsersByIdOrEmail(conn, [123, 'bob@hotmail.com'], function (err, res) {
  77 + if (err) return done(err);
  78 + var expected =
  79 + "SELECT\n" +
  80 + " *\n" +
  81 + "FROM\n" +
  82 + " users\n" +
  83 + "WHERE\n" +
  84 + " id = ? OR email = ?;\n";
  85 + expect(res).to.equal(expected);
  86 + done();
  87 + });
  88 + }
  89 + });
  90 +
  91 + it('should allow streaming of results', function(done) {
  92 + var getUsersByIdOrEmail = sqlt(path.join(__dirname, 'fixtures', 'getUsersByIdOrEmail.sql'));
  93 + var stream = getUsersByIdOrEmail(conn, [123, 'bob@hotmail.com']);
  94 + expect(stream.pipe).to.be.a('function');
  95 + var expected =
  96 + "SELECT\n" +
  97 + " *\n" +
  98 + "FROM\n" +
  99 + " users\n" +
  100 + "WHERE\n" +
  101 + " id = ? OR email = ?;\n";
  102 + expect(stream.pipe()).to.equal(expected);
  103 + done();
  104 + });
  105 +});
screen_sequence_diagrams/add_class.dot View file @ 2bbd17a
... ... @@ -21,14 +21,14 @@
21 21 "Controller"[center=true, fillcolor="#aaaaff", style=filled, shape=diamond,
22 22 fixedsize=true, width=1.4, height=1.4];
23 23 "WhiteListCheck"[center=true, fillcolor="#aaaaff", style=filled, style=filled];
24   - "Sidebar Menu" -> "POST";
  24 + "Sidebar Menu" -> "POST"[dir=none];
25 25 "POST" -> "Controller";
26   - "Controller" -> "FAILURE";
  26 + "Controller" -> "FAILURE"[dir=none];
27 27 "FAILURE" -> "Sidebar Menu";
28   - "Controller" -> "SUCCESS";
  28 + "Controller" -> "SUCCESS"[dir=none];
29 29 "SUCCESS"->"WhiteListCheck";
30   - "WhiteListCheck" -> "Permission Denied: \n User cannot be enrolled in class";
31   - "WhiteListCheck" -> "Success! \n User is added to class";
  30 + "WhiteListCheck" -> "Permission Denied: \n User cannot be enrolled in class"[dir=none];
  31 + "WhiteListCheck" -> "Success! \n User is added to class"[dir=none];
32 32 "Success! \n User is added to class" -> "Sidebar Menu";
33 33 "Permission Denied: \n User cannot be enrolled in class" -> "Sidebar Menu";
34 34  
screen_sequence_diagrams/change_password.dot View file @ 2bbd17a
... ... @@ -14,14 +14,14 @@
14 14  
15 15 "Controller"[center=true, fillcolor="#aaaaff", style=filled, shape = diamond,
16 16 fixedsize=true, width=1.4, height=1.4];
17   - "Sidebar Menu/Settings" -> "POST";
  17 + "Sidebar Menu/Settings" -> "POST"[dir=none];
18 18 "POST" -> "Controller";
19 19 "Controller" -> "Email";
20 20 "Failure: User did not\nchange password"[shape=none];
21   - "Email" -> "Failure: User did not\nchange password";
  21 + "Email" -> "Failure: User did not\nchange password"[dir=none];
22 22 "Failure: User did not\nchange password" -> "Sidebar Menu";
23 23 "Success: User \nchanged password"[shape=none];
24   - "Email" -> "Success: User \nchanged password";
  24 + "Email" -> "Success: User \nchanged password"[dir=none];
25 25 "Success: User \nchanged password" -> "Sidebar Menu";
26 26 }
screen_sequence_diagrams/configure_account_notifications.dot View file @ 2bbd17a
... ... @@ -8,11 +8,11 @@
8 8 nodesep=2.5;
9 9 ranksep=0.45;
10 10 "Account Settings"[center=true, fillcolor="#aaaaff", style=filled,pos="0,0!"];
11   - "Account Settings" -> "PATCH /api/me/settings";
  11 + "Account Settings" -> "PATCH /api/me/settings"[dir=none];
12 12  
13 13 "views.update_settings" -> "New settings valid?";
14   - "New settings valid?" -> "Yes\nSUCCESS";
15   - "New settings valid?" -> "No\nFAILURE";
  14 + "New settings valid?" -> "Yes\nSUCCESS"[dir=none];
  15 + "New settings valid?" -> "No\nFAILURE"[dir=none];
16 16 "PATCH /api/me/settings" -> "views.update_settings";
17 17 "No\nFAILURE" -> "Account Settings";
18 18 "Yes\nSUCCESS" -> "Save settings";
screen_sequence_diagrams/contact_admin.dot View file @ 2bbd17a
... ... @@ -16,9 +16,9 @@
16 16 lp=100;
17 17  
18 18 // Graph
19   - "Instructor's Email Client" -> "EMAIL";
  19 + "Instructor's Email Client" -> "EMAIL"[dir=none];
20 20 "EMAIL" -> "Admin's Message Box";
21   - "Admin's Message Box" -> "MESSAGE";
  21 + "Admin's Message Box" -> "MESSAGE"[dir=none];
22 22 "MESSAGE" -> "Instructor's Email Client";
23 23 }
screen_sequence_diagrams/drop_class.dot View file @ 2bbd17a
... ... @@ -18,10 +18,10 @@
18 18 "Sidebar Menu" -> "Controller" [label=" DELETE"];
19 19 "Controller" -> "User Check";
20 20 "User did not\ndrop class"[shape=none];
21   - "User Check" -> "User did not\ndrop class";
  21 + "User Check" -> "User did not\ndrop class"[dir=none];
22 22 "User did not\ndrop class" -> "Sidebar Menu";
23 23 "User successfully\ndropped class"[shape=none];
24   - "User Check" -> "User successfully\ndropped class";
  24 + "User Check" -> "User successfully\ndropped class"[dir=none];
25 25 "User successfully\ndropped class" -> "Sidebar Menu";
26 26 }
screen_sequence_diagrams/edit_flashcard.dot View file @ 2bbd17a
... ... @@ -9,22 +9,23 @@
9 9 "View Deck"[center=true, fillcolor="#aaaaff", style=filled,pos="0,0!"];
10 10 "Controller"[center=true, fillcolor="#aaaaff", style=filled, shape = diamond,
11 11 fixedsize=true, width=1.4, height=1.4];
  12 + "POST"[shape=none];
12 13  
13 14 "View Deck" -> "Edit Flashcard Button";
14 15 "Edit Flashcard Button" -> "Flashcard Changes";
15   - "Flashcard Changes" -> "POST";
  16 + "Flashcard Changes" -> "POST"[dir=none];
16 17 "POST" -> "Controller";
17 18  
18 19 //Only blanks(mask) altered
19 20 "Only mask altered"[shape=none];
20 21 "Server creates New FlashcardMask object"[fillcolor="#aaaaff", style=filled,pos="0,0!"];
21   - "Controller" -> "Only mask altered";
  22 + "Controller" -> "Only mask altered"[dir=none];
22 23 "Only mask altered" -> "Server creates New FlashcardMask object";
23 24 "Server creates New FlashcardMask object" -> "View Deck";
24 25  
25 26 //Text changed
26 27 "Text or material date altered"[shape=none];
27   - "Controller" -> "Text or material date altered";
  28 + "Controller" -> "Text or material date altered"[dir=none];
28 29 "Text or material date altered" -> "Create New Flashcard";
29 30 "Create New Flashcard" -> "Push to Feed";
30 31 "Push to Feed"-> "Add to User Deck";
screen_sequence_diagrams/filter_cards.dot View file @ 2bbd17a
... ... @@ -16,9 +16,9 @@
16 16 "Controller"[center=true, fillcolor="#aaaaff", style=filled, shape = diamond,
17 17 fixedsize=true, width=1.4, height=1.4];
18 18  
19   - "Feed" -> "Filter";
  19 + "Feed" -> "Filter"[dir=none];
20 20 "Filter" -> "Controller";
21   - "Controller" -> "Filtered cards";
  21 + "Controller" -> "Filtered cards"[dir=none];
22 22 "Filtered cards" -> "Feed";
23 23  
24 24 }
screen_sequence_diagrams/fix_flashcard.dot View file @ 2bbd17a
... ... @@ -5,13 +5,14 @@
5 5 label="[F7] Fix Flashcard";
6 6 node[shape=box, style="rounded,filled,bold"];
7 7 splines=ortho;
8   - nodesep=1.0;
  8 + nodesep=0.4;
  9 + ranksep=0.1;
9 10 "View Deck"[center=true, fillcolor="#aaaaff", style=filled,pos="0,0!"];
10 11 "View Deck" -> "Edit Flashcard";
11   - "Edit Flashcard" -> "POST /api/flashcard/{pk}/edit";
  12 + "Edit Flashcard" -> "POST /api/flashcard/{pk}/edit"[dir=none];
12 13 "POST /api/flashcard/{pk}/edit" -> "FlashcardViewSet.edit";
13   - "FlashcardViewSet.edit" -> "Text or material date altered";
14   - "FlashcardViewSet.edit" -> "Only mask altered";
  14 + "FlashcardViewSet.edit" -> "Text or material date altered"[dir=none];
  15 + "FlashcardViewSet.edit" -> "Only mask altered"[dir=none];
15 16 "Only mask altered" -> "Update UserFlashcard object";
16 17 "Text or material date altered" -> "Create new Flashcard with prev pointer\nNotify all users who've pulled the card";
17 18 "Only mask altered"[shape=none];
18 19  
19 20  
20 21  
... ... @@ -22,12 +23,17 @@
22 23 labelfloat=true;
23 24 lp=100;
24 25 "FlashcardViewSet.edit"[center=true, fillcolor="#aaaaff", style=filled, shape = diamond, fixedsize=true, width=2.2, height=2.2];
  26 + "Sidebar Menu"[center=true, fillcolor="#aaaaff", style=filled,pos="0,0!"];
25 27 "WhiteListCheck"[center=true, fillcolor="#aaaaff", style=filled, style=filled];
26   - "Sidebar Menu" -> "POST";
  28 + "Controller"[center=true, fillcolor="#aaaaff", style=filled, shape = diamond, fixedsize=true, width=1.1, height=1.1];
  29 + "POST"[shape=none];
  30 + "FAILURE"[shape=none];
  31 + "SUCCESS"[shape=none];
  32 + "Sidebar Menu" -> "POST"[dir=none];
27 33 "POST" -> "Controller";
28   - "Controller" -> "FAILURE";
  34 + "Controller" -> "FAILURE"[dir=none];
29 35 "FAILURE" -> "Sidebar Menu";
30   - "Controller" -> "SUCCESS";
  36 + "Controller" -> "SUCCESS"[dir=none];
31 37 "SUCCESS"->"WhiteListCheck";
32 38 "WhiteListCheck" -> "Permission Denied: \n User cannot be enrolled in class";
33 39 "WhiteListCheck" -> "Success! \n User is added to class";
screen_sequence_diagrams/flag_inappropriate_cards.dot View file @ 2bbd17a
... ... @@ -5,7 +5,8 @@
5 5 label="[F4] Flag Inappropriate Cards";
6 6 node[shape=box, style="rounded,filled,bold"];
7 7 splines=ortho;
8   - nodesep=1.0;
  8 + nodesep=2.0;
  9 + ranksep=0.4;
9 10 "Live Feed"[center=true, fillcolor="#aaaaff", style=filled,pos="0,0!"];
10 11 "Controller"[center=true, fillcolor="#aaaaff", style=filled, shape = diamond,
11 12 fixedsize=true, width=1.4, height=1.4];
12 13  
13 14  
14 15  
... ... @@ -23,13 +24,13 @@
23 24 "Flashcard Hidden from Feed"[center=true, fillcolor="#aaaaff", style=filled];
24 25 "POST"[shape=none];
25 26 "Live Feed" -> "Flag as Inappropriate";
26   - "Flag as Inappropriate" -> "POST";
  27 + "Flag as Inappropriate" -> "POST"[dir=none];
27 28 "POST" -> "Controller";
28   - "Controller" -> "FAILURE";
  29 + "Controller" -> "FAILURE"[dir=none];
29 30 "FAILURE" -> "Live Feed";
30   - "Controller" -> "POST";
  31 + "Controller" -> "POST"[dir=none];
31 32 "POST" -> "Server";
32   - "Server"-> "SUCCESS";
  33 + "Server"-> "SUCCESS"[dir=none];
33 34 "SUCCESS" -> "Flashcard Hidden from Feed";
34 35 "Flashcard Hidden from Feed" -> "Server creates a FlashcardReport object";
35 36 "Server creates a FlashcardReport object" -> "Live Feed";
screen_sequence_diagrams/hide_card.dot View file @ 2bbd17a
... ... @@ -12,16 +12,16 @@
12 12 lp=100;
13 13  
14 14 "POST"[shape=none];
15   - "FAILURE: card no longer exists in database"[shape=none];
16   - "SUCCESS: card successfully hidden"[shape=none];
  15 + "FAILURE: card no longer\nexists in database"[shape=none];
  16 + "SUCCESS: card\nsuccessfully hidden"[shape=none];
17 17  
18 18 "Controller"[center=true, fillcolor="#aaaaff", style=filled, shape = diamond,
19 19 fixedsize=true, width=1.4, height=1.4];
20   - "Feed" -> "POST";
  20 + "Feed" -> "POST"[dir=none];
21 21 "POST" -> "Controller";
22   - "Controller" -> "FAILURE: card no longer exists in database";
23   - "Controller" -> "SUCCESS: card successfully hidden";
24   - "FAILURE: card no longer exists in database" -> "Feed";
25   - "SUCCESS: card successfully hidden" -> "Feed";
  22 + "Controller" -> "FAILURE: card no longer\nexists in database"[dir=none];
  23 + "Controller" -> "SUCCESS: card\nsuccessfully hidden"[dir=none];
  24 + "FAILURE: card no longer\nexists in database" -> "Feed";
  25 + "SUCCESS: card\nsuccessfully hidden" -> "Feed";
26 26 }
screen_sequence_diagrams/pull_flashcard.dot View file @ 2bbd17a
... ... @@ -23,16 +23,15 @@
23 23 fixedsize=true, width=1.4, height=1.4];
24 24 "Flashcard added to User's Deck"[center=true, fillcolor="#aaaaff", style=filled];
25 25 "POST"[shape=none];
26   - "Pull Flashcard Button" -> "POST";
  26 + "Pull Flashcard Button" -> "POST"[dir=none];
27 27 "POST" -> "Controller";
28   - "Controller" -> "FAILURE";
  28 + "Controller" -> "FAILURE"[dir=none];
29 29 "FAILURE" -> "Pull Flashcard Button";
30 30 "Controller" -> "Hide Flashcard from Feed";
31 31 "POST" -> "Server";
32   - "Server"-> "SUCCESS";
  32 + "Server"-> "SUCCESS"[dir=none];
33 33 "SUCCESS" -> "Flashcard added to User's Deck";
34   - "Flashcard added to User's Deck" -> "Update Card Rating"
  34 + "Flashcard added to User's Deck" -> "Update Card Rating"[dir=none];
35 35 "Update Card Rating" -> "Pull Flashcard Button";
36   -
37 36 }
screen_sequence_diagrams/push_flashcard.dot View file @ 2bbd17a
... ... @@ -23,15 +23,15 @@
23 23 fixedsize=true, width=1.4, height=1.4];
24 24 "Flashcard Record \n Created in Database"[center=true, fillcolor="#aaaaff", style=filled];
25 25 "POST"[shape=none];
26   - "Push Flashcard Button" -> "POST";
  26 + "Push Flashcard Button" -> "POST"[dir=none];
27 27 "POST" -> "Controller";
28   - "Controller" -> "FAILURE";
  28 + "Controller" -> "FAILURE"[dir=none];
29 29 "FAILURE" -> "Push Flashcard Button";
30   - "Controller" -> "POST";
  30 + "Controller" -> "POST"[dir=none];
31 31 "POST" -> "Server";
32   - "Server"-> "SUCCESS";
  32 + "Server"-> "SUCCESS"[dir=none];
33 33 "SUCCESS" -> "Flashcard Record \n Created in Database";
34   - "Flashcard Record \n Created in Database" -> "Card Published in Feed";
  34 + "Flashcard Record \n Created in Database" -> "Card Published in Feed"[dir=none];
35 35 "Card Published in Feed" -> "Push Flashcard Button";
36 36  
37 37 }
screen_sequence_diagrams/remove_card.dot View file @ 2bbd17a
... ... @@ -21,16 +21,16 @@
21 21 fixedsize=true, width=1.4, height=1.4];
22 22 "POST"[shape=none];
23 23 "Card Removed from Deck"[shape=none];
24   - "Flashcard Position Updated in Live Feed"[shape=none];
25   - "View Deck" -> "POST";
  24 + "Flashcard Position\nUpdated in Live Feed"[shape=none];
  25 + "View Deck" -> "POST"[dir=none];
26 26 "POST" -> "Controller";
27   - "Controller" -> "FAILURE";
  27 + "Controller" -> "FAILURE"[dir=none];
28 28 "FAILURE" -> "View Deck";
29 29 "Controller" -> "Remove Flashcard Button";
30   - "Remove Flashcard Button" -> "DELETE";
  30 + "Remove Flashcard Button" -> "DELETE"[dir=none];
31 31 "DELETE" -> "Server";
32   - "Server" -> "Card Removed from Deck";
33   - "Card Removed from Deck" -> "Flashcard Position Updated in Live Feed";
34   - "Flashcard Position Updated in Live Feed" -> "View Deck";
  32 + "Server" -> "Card Removed from Deck"[dir=none];
  33 + "Card Removed from Deck" -> "Flashcard Position\nUpdated in Live Feed"[dir=none];
  34 + "Flashcard Position\nUpdated in Live Feed" -> "View Deck";
35 35 }
screen_sequence_diagrams/review_notification.dot View file @ 2bbd17a
1 1 digraph G{
2 2 ratio=0.75;
3 3 //rankdir="LR";
4   - node[shape = box];
  4 + node[shape=box, style="rounded,filled,bold"];
5 5 splines=ortho;
6 6 nodesep=1.4;
7 7 "Sidebar Menu"[center=true, fillcolor="#aaaaff", style=filled,pos="0,0!"];
8 8  
... ... @@ -10,9 +10,9 @@
10 10 "Notification"[shape=none];
11 11 "UPDATE"[shape=none];
12 12  
13   - "Server" -> "Notification";
  13 + "Server" -> "Notification"[dir=none];
14 14 "Notification" -> "Controller";
15   - "Controller" -> "UPDATE";
  15 + "Controller" -> "UPDATE"[dir=none];
16 16 "UPDATE" -> "Sidebar Menu";
17 17  
18 18 }
screen_sequence_diagrams/section_limit_access.dot View file @ 2bbd17a
... ... @@ -8,7 +8,7 @@
8 8 node[shape=box, style="rounded,filled,bold"];
9 9 splines=ortho;
10 10 nodesep=1.4;
11   - "Instructor's Email Client"[center=true, fillcolor="#aaaaff", style=filled,pos="0,0!"];
  11 + "Instructor's\nEmail Client"[center=true, fillcolor="#aaaaff", style=filled,pos="0,0!"];
12 12 "Admins Page"[center=true, fillcolor="#aaaaff", style=filled];
13 13 "Controller"[center=true, fillcolor="#aaaaff", style=filled, shape=diamond,
14 14 fixedsize=true, width=1.8, height=1.8];
15 15  
16 16  
17 17  
... ... @@ -24,15 +24,15 @@
24 24 fixedsize=true, width=1.5, height=1.5];
25 25  
26 26 // Graph
27   - "Instructor's Email Client" -> "EMAIL";
  27 + "Instructor's\nEmail Client" -> "EMAIL"[dir=none];
28 28 "EMAIL" -> "Admins Page";
29   - "Admins Page" -> "POST";
  29 + "Admins Page" -> "POST"[dir=none];
30 30 "POST" -> "Controller";
31 31  
32   - "Controller" -> "SUCCESS";
33   - "SUCCESS" -> "Instructor's Email Client";
  32 + "Controller" -> "SUCCESS"[dir=none];
  33 + "SUCCESS" -> "Instructor's\nEmail Client";
34 34  
35   - "Controller" -> "FAILURE";
  35 + "Controller" -> "FAILURE"[dir=none];
36 36 "FAILURE" -> "Admins Page";
37 37 }
screen_sequence_diagrams/study_deck.dot View file @ 2bbd17a
... ... @@ -22,15 +22,15 @@
22 22 "FAILURE:\nUser has no card in the deck."[shape=none];
23 23  
24 24 "Sidebar Menu" -> "ClassView";
25   - "ClassView" -> "POST";
  25 + "ClassView" -> "POST"[dir=none];
26 26 "POST" -> "Controller";
27   - "Controller" -> "FAILURE:\nUser has no card in the deck.";
28   - "Controller" -> "SUCCESS\nUser has at least a card in the deck.";
  27 + "Controller" -> "FAILURE:\nUser has no card in the deck."[dir=none];
  28 + "Controller" -> "SUCCESS\nUser has at least a card in the deck."[dir=none];
29 29 "FAILURE:\nUser has no card in the deck." -> "Sidebar Menu";
30 30 "SUCCESS\nUser has at least a card in the deck." -> "StudyView Blank";
31   - "StudyView Blank" -> "POST";
  31 + "StudyView Blank" -> "POST"[dir=none];
32 32 "Controller" -> "StudyView Response";
33   - "StudyView Response" -> "POST";
  33 + "StudyView Response" -> "POST"[dir=none];
34 34 "Controller" -> "StudyView Blank";
35 35  
36 36 }
screen_sequence_diagrams/user_login_out.dot View file @ 2bbd17a
... ... @@ -28,19 +28,19 @@
28 28 fixedsize=true, width=1.8, height=1.8];
29 29  
30 30 // Graph
31   - "Sidebar Menu" -> "POST";
  31 + "Sidebar Menu" -> "POST"[dir=none];
32 32 "POST" -> "Logout Controller";
33   - "Logout Controller" -> "Logout FAILURE";
  33 + "Logout Controller" -> "Logout FAILURE"[dir=none];
34 34 "Logout FAILURE" -> "Sidebar Menu";
35 35  
36   - "Logout Controller" -> "SUCCESS:\n User logged out";
37   - "SUCCESS:\n User logged out" -> "Login/Register Page"
  36 + "Logout Controller" -> "SUCCESS:\n User logged out"[dir=none];
  37 + "SUCCESS:\n User logged out" -> "Login/Register Page";
38 38  
39   - "Login/Register Page" -> "Login Controller"
40   - "Login Controller" -> "SUCCESS:\n User logged in"
41   - "SUCCESS:\n User logged in" -> "Sidebar Menu"
  39 + "Login/Register Page" -> "Login Controller";
  40 + "Login Controller" -> "SUCCESS:\n User logged in"[dir=none];
  41 + "SUCCESS:\n User logged in" -> "Sidebar Menu";
42 42  
43   - "Login Controller" -> "Login FAILURE"
44   - "Login FAILURE" -> "Login/Register Page"
  43 + "Login Controller" -> "Login FAILURE"[dir=none];
  44 + "Login FAILURE" -> "Login/Register Page";
45 45 }
screen_sequence_diagrams/user_register.dot View file @ 2bbd17a
... ... @@ -27,19 +27,19 @@
27 27 fixedsize=true, width=1.5, height=1.5];
28 28  
29 29 // Graph
30   - "Login/Register Page" -> "POST";
  30 + "Login/Register Page" -> "POST"[dir=none];
31 31 "POST" -> "Controller";
32 32  
33   - "Controller" -> "FAILURE";
  33 + "Controller" -> "FAILURE"[dir=none];
34 34 "FAILURE" -> "Login/Register Page";
35 35  
36   - "Controller" -> "SUCCESS:\nValid, send JSON.";
  36 + "Controller" -> "SUCCESS:\nValid, send JSON."[dir=none];
37 37 "SUCCESS:\nValid, send JSON." -> "Server";
38 38  
39   - "Server" -> "FAILURE:\nData invalid";
  39 + "Server" -> "FAILURE:\nData invalid"[dir=none];
40 40 "FAILURE:\nData invalid" -> "Login/Register Page";
41 41  
42   - "Server" -> "SUCCESS:\nValid, unverified user created.\nEmail verification message displayed.";
  42 + "Server" -> "SUCCESS:\nValid, unverified user created.\nEmail verification message displayed."[dir=none];
43 43 "SUCCESS:\nValid, unverified user created.\nEmail verification message displayed." -> "Login/Register Page";
44 44 }
screen_sequence_diagrams/view_by_pull_time.dot View file @ 2bbd17a
... ... @@ -18,11 +18,11 @@
18 18 "Controller"[center=true, fillcolor="#aaaaff", style=filled, shape = diamond,
19 19 fixedsize=true, width=1.4, height=1.4];
20 20 "POST"[shape=none];
21   - "View Deck" -> "POST";
  21 + "View Deck" -> "POST"[dir=none];
22 22 "POST" -> "Controller";
23   - "Controller" -> "FAILURE";
  23 + "Controller" -> "FAILURE"[dir=none];
24 24 "FAILURE" -> "View Deck";
25   - "Controller" -> "Sort by Ascending/Descending Time";
26   - "Sort by Ascending/Descending Time" -> "View Deck";
  25 + "Controller" -> "Sort by Ascending\nor Descending Time";
  26 + "Sort by Ascending\nor Descending Time" -> "View Deck";
27 27 }
screen_sequence_diagrams/view_feed.dot View file @ 2bbd17a
... ... @@ -13,15 +13,15 @@
13 13  
14 14 "GET"[shape=none];
15 15 "SUCCESS"[shape=none];
16   - "FAILURE: no cards"[shape=none];
  16 + "FAILURE:\nno cards"[shape=none];
17 17  
18 18 "Controller"[center=true, fillcolor="#aaaaff", style=filled, shape = diamond,
19 19 fixedsize=true, width=1.4, height=1.4];
20   - "Root" -> "GET";
  20 + "Root" -> "GET"[dir=none];
21 21 "GET" -> "Controller";
22   - "Controller" -> "FAILURE: no cards";
23   - "Controller" -> "SUCCESS";
24   - "FAILURE: no cards" -> "Feed";
  22 + "Controller" -> "FAILURE:\nno cards"[dir=none];
  23 + "Controller" -> "SUCCESS"[dir=none];
  24 + "FAILURE:\nno cards" -> "Feed";
25 25 "SUCCESS" -> "Feed";
26 26 }