From 1503892a3c408e58b2941e08a7cb28d3ecea40b9 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Tue, 28 Mar 2017 17:05:06 -0700 Subject: [PATCH 01/23] signup form and auth services complete, all components, and configs set and loaded --- lab-zachary/.babelrc | 3 + lab-zachary/.eslintrc | 21 +++ lab-zachary/.gitignore | 130 ++++++++++++++++++ lab-zachary/app/component/login/_login.scss | 0 lab-zachary/app/component/login/login.html | 0 lab-zachary/app/component/login/login.js | 14 ++ lab-zachary/app/component/signup/_signup.scss | 0 lab-zachary/app/component/signup/signup.html | 26 ++++ lab-zachary/app/component/signup/signup.js | 28 ++++ lab-zachary/app/config/router-config.js | 31 +++++ lab-zachary/app/entry.js | 43 ++++++ lab-zachary/app/index.html | 9 ++ lab-zachary/app/scss/main.scss | 0 lab-zachary/app/service/auth-service.js | 79 +++++++++++ lab-zachary/app/view/home/_home.scss | 0 lab-zachary/app/view/home/home-controller.js | 9 ++ lab-zachary/app/view/home/home.html | 3 + lab-zachary/app/view/landing/_landing.scss | 0 .../app/view/landing/landing-controller.js | 12 ++ lab-zachary/app/view/landing/landing.html | 0 lab-zachary/package.json | 44 ++++++ lab-zachary/webpack.config.js | 42 ++++++ 22 files changed, 494 insertions(+) create mode 100644 lab-zachary/.babelrc create mode 100644 lab-zachary/.eslintrc create mode 100644 lab-zachary/.gitignore create mode 100644 lab-zachary/app/component/login/_login.scss create mode 100644 lab-zachary/app/component/login/login.html create mode 100644 lab-zachary/app/component/login/login.js create mode 100644 lab-zachary/app/component/signup/_signup.scss create mode 100644 lab-zachary/app/component/signup/signup.html create mode 100644 lab-zachary/app/component/signup/signup.js create mode 100644 lab-zachary/app/config/router-config.js create mode 100644 lab-zachary/app/entry.js create mode 100644 lab-zachary/app/index.html create mode 100644 lab-zachary/app/scss/main.scss create mode 100644 lab-zachary/app/service/auth-service.js create mode 100644 lab-zachary/app/view/home/_home.scss create mode 100644 lab-zachary/app/view/home/home-controller.js create mode 100644 lab-zachary/app/view/home/home.html create mode 100644 lab-zachary/app/view/landing/_landing.scss create mode 100644 lab-zachary/app/view/landing/landing-controller.js create mode 100644 lab-zachary/app/view/landing/landing.html create mode 100644 lab-zachary/package.json create mode 100644 lab-zachary/webpack.config.js diff --git a/lab-zachary/.babelrc b/lab-zachary/.babelrc new file mode 100644 index 00000000..af0f0c3d --- /dev/null +++ b/lab-zachary/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} \ No newline at end of file diff --git a/lab-zachary/.eslintrc b/lab-zachary/.eslintrc new file mode 100644 index 00000000..8dc68078 --- /dev/null +++ b/lab-zachary/.eslintrc @@ -0,0 +1,21 @@ +{ + "rules": { + "no-console": "off", + "indent": [ "error", 2 ], + "quotes": [ "error", "single" ], + "semi": ["error", "always"], + "linebreak-style": [ "error", "unix" ] + }, + "env": { + "es6": true, + "node": true, + "mocha": true, + "jasmine": true + }, + "ecmaFeatures": { + "modules": true, + "experimentalObjectRestSpread": true, + "impliedStrict": true + }, + "extends": "eslint:recommended" +} diff --git a/lab-zachary/.gitignore b/lab-zachary/.gitignore new file mode 100644 index 00000000..59c0d065 --- /dev/null +++ b/lab-zachary/.gitignore @@ -0,0 +1,130 @@ +/build + +# Created by https://www.gitignore.io/api/node,osx,windows,linux + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + + +### OSX ### +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.gitignore.io/api/node,osx,windows,linux \ No newline at end of file diff --git a/lab-zachary/app/component/login/_login.scss b/lab-zachary/app/component/login/_login.scss new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/login/login.html b/lab-zachary/app/component/login/login.html new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/login/login.js b/lab-zachary/app/component/login/login.js new file mode 100644 index 00000000..fd9f2868 --- /dev/null +++ b/lab-zachary/app/component/login/login.js @@ -0,0 +1,14 @@ +'use strict'; + +require('./_login.scss'); + +module.exports = { + template: require('./login.html'), + controller: ['$log', LoginController], + controllerAs: 'loginCtrl' +}; + +function LoginController($log) { + $log.debug('LoginController'); + +} diff --git a/lab-zachary/app/component/signup/_signup.scss b/lab-zachary/app/component/signup/_signup.scss new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/signup/signup.html b/lab-zachary/app/component/signup/signup.html new file mode 100644 index 00000000..8de50557 --- /dev/null +++ b/lab-zachary/app/component/signup/signup.html @@ -0,0 +1,26 @@ +
+ +
\ No newline at end of file diff --git a/lab-zachary/app/component/signup/signup.js b/lab-zachary/app/component/signup/signup.js new file mode 100644 index 00000000..fa6e5161 --- /dev/null +++ b/lab-zachary/app/component/signup/signup.js @@ -0,0 +1,28 @@ +'use strict'; + +require('./_signup.scss'); + +module.exports = { + template: require('./signup.html'), + controller: ['$log', '$location', 'authService', SignupController], + controllerAs: 'signupCtrl' +}; + +function SignupController($log, $location, authService) { + $log.debug('SignupController'); + + authService.getToken() + .then( token => { + $log.debug('authService: ', token); + $location.url('/home'); + }); + + this.signup = function(user) { + $log.debug('SignupController.signup'); + + authService.signup(user) + .then( () => { + $location.url('/home'); + }); + }; +} \ No newline at end of file diff --git a/lab-zachary/app/config/router-config.js b/lab-zachary/app/config/router-config.js new file mode 100644 index 00000000..66ca4da5 --- /dev/null +++ b/lab-zachary/app/config/router-config.js @@ -0,0 +1,31 @@ +'use strict'; + +module.exports = ['$stateProvider', '$urlRouterProvider', routerConfig]; + +function routerConfig($stateProvider, $urlRouterProvider) { + $urlRouterProvider.when('', '/join#signup'); + $urlRouterProvider.when('/', '/join#signup'); + $urlRouterProvider.when('/signup', '/join#signup'); + $urlRouterProvider.when('/login', '/join#login'); + + let states = [ + { + name: 'home', + url: '/home', + template: require('../view/home/home.html'), + controller: 'HomeController', + controllerAs: 'homeCtrl' + }, + { + name: 'landing', + url: '/join', + template: require('../view/landing/landing.html'), + controller: 'LandingController', + controllerAs: 'landingCtrl' + } + ]; + + states.forEach( state => { + $stateProvider.state(state); + }); +} \ No newline at end of file diff --git a/lab-zachary/app/entry.js b/lab-zachary/app/entry.js new file mode 100644 index 00000000..8f6281c2 --- /dev/null +++ b/lab-zachary/app/entry.js @@ -0,0 +1,43 @@ +'use strict'; + +const angular = require('angular'); +const camelcase = require('camelcase'); +const pascalcase = require('pascalcase'); +const path = require('path'); +const uiRouter = require('angular-ui-router'); +const ngTouch = require('angular-touch'); +const ngAnimate = require('angular-animate'); + +require('./scss/main.scss'); + +const cfgram = angular.module('cfgram', [ngTouch, ngAnimate, uiRouter]); + +let context = require.context('./config/', true, /\.js$/); +context.keys().forEach( key => { + cfgram.config(context(key)); +}); + +context = require.context('./view/', true, /\.js$/); +context.keys().forEach( key => { + let name = pascalcase(path.basename(key, '.js')); + let module = context(key); + console.log('view:', key, name, module); + cfgram.controller(name, module); +}); + +context = require.context('./service/', true, /\.js$/); +context.keys().forEach( key => { + console.log('service:', key); + let name = camelcase(path.basename(key, '.js')); + let module = context(key); + console.log('service', key, name, module); + cfgram.service(name, module); +}); + +context = require.context('./component/', true, /\.js$/); +context.keys().forEach( key => { + let name = camelcase(path.basename(key, '.js')); + let module = context(key); + console.log('component:', key, name, module); + cfgram.component(name, module); +}); diff --git a/lab-zachary/app/index.html b/lab-zachary/app/index.html new file mode 100644 index 00000000..3340dd1d --- /dev/null +++ b/lab-zachary/app/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/lab-zachary/app/scss/main.scss b/lab-zachary/app/scss/main.scss new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/service/auth-service.js b/lab-zachary/app/service/auth-service.js new file mode 100644 index 00000000..38ecd4e4 --- /dev/null +++ b/lab-zachary/app/service/auth-service.js @@ -0,0 +1,79 @@ +'use strict'; + +module.exports = ['$q', '$log', '$http', '$window', authService]; + +function authService($q, $log, $http, $window) { + $log.debug('authService'); + + let service = {}; + let token = null; + + function setToken(_token){ + $log.debug('setToken', _token); + + if(!_token) return $q.reject(new Error('need a token')); + + $window.localStorage.setItem('token', _token); + token = _token; + return $q.resolve(token); + } + + service.getToken = function() { + $log.debug('authService.getToken'); + if (token) { + return $q.resolve(token); + } + + token = $window.localStorage.getItem('token'); + if (token) return $q.resolve(token); + return $q.reject(new Error('token not found')); + }; + + service.signup = function(user) { + $log.debug('authService.signup'); + + let url = `${__API_URL__}/api/signup`; + let config = { + headers: { + 'Content-Type' : 'application/json', + 'Accept': 'application/json' + } + }; + return $http.post(url, user, config) + .then( res => { + $log.log('success:', res.data); + return setToken(res.data); + }); + + }; + + service.login = function(user) { + $log.debug('authService.login'); + + let url = `${__API_URL__}/api/login`; + let base64 = $window.btoa(`${user.username}:${user.password}`); + let config = { + headers: { + Accept: 'application/json', + Authorization: `Basic ${base64}` + } + }; + return $http.get(url, config) + .then( res => { + $log.debug('success: ', res.data); + return setToken(res.data); + }); + + }; + + service.logout = function() { + $log.debug('authService.logout'); + + $window.localStorage.removeItem('token'); + token = null; + return $q.resolve(); + }; + + + return service; +} \ No newline at end of file diff --git a/lab-zachary/app/view/home/_home.scss b/lab-zachary/app/view/home/_home.scss new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/view/home/home-controller.js b/lab-zachary/app/view/home/home-controller.js new file mode 100644 index 00000000..e4c19f59 --- /dev/null +++ b/lab-zachary/app/view/home/home-controller.js @@ -0,0 +1,9 @@ +'use strict'; + +require('./_home.scss'); + +module.exports = ['$log', HomeController]; + +function HomeController($log){ + $log.debug('HomeController'); +} \ No newline at end of file diff --git a/lab-zachary/app/view/home/home.html b/lab-zachary/app/view/home/home.html new file mode 100644 index 00000000..2b4db79c --- /dev/null +++ b/lab-zachary/app/view/home/home.html @@ -0,0 +1,3 @@ +
+

Welcome Home

+
\ No newline at end of file diff --git a/lab-zachary/app/view/landing/_landing.scss b/lab-zachary/app/view/landing/_landing.scss new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/view/landing/landing-controller.js b/lab-zachary/app/view/landing/landing-controller.js new file mode 100644 index 00000000..14fe085b --- /dev/null +++ b/lab-zachary/app/view/landing/landing-controller.js @@ -0,0 +1,12 @@ +'use strict'; + +require('./_landing.scss'); + +module.exports = ['$log', '$location', '$rootScope', 'authService', LandingController]; + +function LandingController($log, $location, authService) { + $log.debug('LandingController'); + + let url = $location.url(); + this.showSignup = url === '/join#signup' || url === '/join'; +} \ No newline at end of file diff --git a/lab-zachary/app/view/landing/landing.html b/lab-zachary/app/view/landing/landing.html new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/package.json b/lab-zachary/package.json new file mode 100644 index 00000000..1ac6ef3e --- /dev/null +++ b/lab-zachary/package.json @@ -0,0 +1,44 @@ +{ + "name": "lab-zachary", + "version": "1.0.0", + "description": "", + "main": "webpack.config.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "watch": "./node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot", + "build": "./node_modules/webpack/bin/webpack.js", + "lint": "eslint ." + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "angular": "^1.6.3", + "angular-animate": "^1.6.3", + "angular-route": "^1.6.3", + "angular-touch": "^1.6.3", + "angular-ui-router": "^0.4.2", + "babel-core": "^6.24.0", + "babel-loader": "^6.4.1", + "babel-preset-es2015": "^6.24.0", + "camelcase": "^4.0.0", + "clean-webpack-plugin": "^0.1.16", + "css-loader": "^0.27.3", + "dotenv": "^4.0.0", + "extract-text-webpack-plugin": "^2.1.0", + "file-loader": "^0.10.1", + "html-loader": "^0.4.5", + "html-webpack-plugin": "^2.28.0", + "node-sass": "^4.5.1", + "pascalcase": "^0.1.1", + "resolve-url-loader": "^2.0.2", + "sass-loader": "^6.0.3", + "style-loader": "^0.16.1", + "ui-router": "^1.0.0-alpha.3", + "url-loader": "^0.5.8", + "webpack": "^2.3.2" + }, + "devDependencies": { + "webpack-dev-server": "^2.4.2" + } +} diff --git a/lab-zachary/webpack.config.js b/lab-zachary/webpack.config.js new file mode 100644 index 00000000..e0fa6527 --- /dev/null +++ b/lab-zachary/webpack.config.js @@ -0,0 +1,42 @@ +'use strict'; + +require('dotenv').load(); + +const HTMLPlugin = require('html-webpack-plugin'); +const ExtractTextPlugin = require('extract-text-webpack-plugin'); +const webpack = require('webpack'); + +module.exports = { + devtool: 'eval', + entry: `${__dirname}/app/entry.js`, + output: { + filename: 'bundle.js', + path: `${__dirname}/build` + }, + plugins: [ + new HTMLPlugin({ + template: `${__dirname}/app/index.html` + }), + new ExtractTextPlugin('bundle.css'), + new webpack.DefinePlugin({ + __API_URL__: JSON.stringify(process.env.API_URL) + }) + ], + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + loader: 'babel-loader' + }, + { + test: /\.html$/, + loader: 'html-loader' + }, + { + test: /\.scss$/, + loader: ExtractTextPlugin.extract(['css-loader', 'sass-loader']) + } + ] + } +}; \ No newline at end of file From 6abc4b5998224771d04ff06a34cab6983d0cacd0 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Tue, 28 Mar 2017 20:37:43 -0700 Subject: [PATCH 02/23] functionality complete --- lab-zachary/app/component/login/login.html | 30 +++++++++++ lab-zachary/app/component/login/login.js | 19 +++++-- lab-zachary/app/index.html | 13 +++-- lab-zachary/app/scss/lib/base/_base.scss | 0 .../app/scss/lib/base/_global-vars.scss | 0 lab-zachary/app/scss/lib/reset/_reset.scss | 48 ++++++++++++++++++ lab-zachary/app/scss/main.scss | 3 ++ lab-zachary/app/view/home/home-controller.js | 13 ++++- .../app/view/landing/landing-controller.js | 2 + lab-zachary/app/view/landing/landing.html | 27 ++++++++++ lab-zachary/assets/cf-logo.png | Bin 0 -> 6821 bytes 11 files changed, 146 insertions(+), 9 deletions(-) create mode 100644 lab-zachary/app/scss/lib/base/_base.scss create mode 100644 lab-zachary/app/scss/lib/base/_global-vars.scss create mode 100644 lab-zachary/app/scss/lib/reset/_reset.scss create mode 100644 lab-zachary/assets/cf-logo.png diff --git a/lab-zachary/app/component/login/login.html b/lab-zachary/app/component/login/login.html index e69de29b..78ad31cf 100644 --- a/lab-zachary/app/component/login/login.html +++ b/lab-zachary/app/component/login/login.html @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/lab-zachary/app/component/login/login.js b/lab-zachary/app/component/login/login.js index fd9f2868..5451929e 100644 --- a/lab-zachary/app/component/login/login.js +++ b/lab-zachary/app/component/login/login.js @@ -4,11 +4,24 @@ require('./_login.scss'); module.exports = { template: require('./login.html'), - controller: ['$log', LoginController], + controller: ['$log', '$location', 'authService', LoginController], controllerAs: 'loginCtrl' }; -function LoginController($log) { +function LoginController($log, $location, authService) { $log.debug('LoginController'); -} + authService.getToken() + .then( () => { + $location.url('/home'); + }); + + this.login = function() { + $log.debug('loginCtrl.login'); + + authService.login(this.user) + .then( () => { + $location.url('/home'); + }); + }; +}; \ No newline at end of file diff --git a/lab-zachary/app/index.html b/lab-zachary/app/index.html index 3340dd1d..17dd47bf 100644 --- a/lab-zachary/app/index.html +++ b/lab-zachary/app/index.html @@ -1,9 +1,14 @@ - + + + CFgram - - - + + + + \ No newline at end of file diff --git a/lab-zachary/app/scss/lib/base/_base.scss b/lab-zachary/app/scss/lib/base/_base.scss new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/scss/lib/base/_global-vars.scss b/lab-zachary/app/scss/lib/base/_global-vars.scss new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/scss/lib/reset/_reset.scss b/lab-zachary/app/scss/lib/reset/_reset.scss new file mode 100644 index 00000000..d9f27b5a --- /dev/null +++ b/lab-zachary/app/scss/lib/reset/_reset.scss @@ -0,0 +1,48 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/lab-zachary/app/scss/main.scss b/lab-zachary/app/scss/main.scss index e69de29b..76187b60 100644 --- a/lab-zachary/app/scss/main.scss +++ b/lab-zachary/app/scss/main.scss @@ -0,0 +1,3 @@ +@import 'lib/reset/reset'; +@import 'lib/base/global-vars'; +@import 'lib/base/base'; \ No newline at end of file diff --git a/lab-zachary/app/view/home/home-controller.js b/lab-zachary/app/view/home/home-controller.js index e4c19f59..2f0cc6ce 100644 --- a/lab-zachary/app/view/home/home-controller.js +++ b/lab-zachary/app/view/home/home-controller.js @@ -2,8 +2,17 @@ require('./_home.scss'); -module.exports = ['$log', HomeController]; +module.exports = ['$log','$location', 'authService', HomeController]; -function HomeController($log){ +function HomeController($log, $location, authService) { $log.debug('HomeController'); + + + authService.getToken() + .then( () => { + }) + .catch( err => { + $log.error('HomeController: ', err); + $location.url(''); + }); } \ No newline at end of file diff --git a/lab-zachary/app/view/landing/landing-controller.js b/lab-zachary/app/view/landing/landing-controller.js index 14fe085b..c490d13a 100644 --- a/lab-zachary/app/view/landing/landing-controller.js +++ b/lab-zachary/app/view/landing/landing-controller.js @@ -8,5 +8,7 @@ function LandingController($log, $location, authService) { $log.debug('LandingController'); let url = $location.url(); + $log.debug('/join#signup:',url === '/join#signup', '/join:', url === '/join'); + this.showSignup = url === '/join#signup' || url === '/join'; } \ No newline at end of file diff --git a/lab-zachary/app/view/landing/landing.html b/lab-zachary/app/view/landing/landing.html index e69de29b..4e4ab584 100644 --- a/lab-zachary/app/view/landing/landing.html +++ b/lab-zachary/app/view/landing/landing.html @@ -0,0 +1,27 @@ +
+

Show signup:{{ landingCtrl.showSignup }}

+ +
+
+ +

already a member?

+ + login here + +
+
+ +
+
+ +

want to sign up?

+ + sign up here + +
+
+
\ No newline at end of file diff --git a/lab-zachary/assets/cf-logo.png b/lab-zachary/assets/cf-logo.png new file mode 100644 index 0000000000000000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tue, 28 Mar 2017 21:54:54 -0700 Subject: [PATCH 03/23] initial styling complete --- lab-zachary/app/component/login/_login.scss | 2 + lab-zachary/app/component/login/login.html | 3 +- lab-zachary/app/component/signup/_signup.scss | 6 ++ lab-zachary/app/component/signup/signup.html | 3 +- lab-zachary/app/index.html | 8 ++- lab-zachary/app/scss/lib/base/_base.scss | 67 +++++++++++++++++++ .../app/scss/lib/base/_global-vars.scss | 18 +++++ lab-zachary/app/view/landing/_landing.scss | 9 +++ lab-zachary/app/view/landing/landing.html | 6 +- 9 files changed, 116 insertions(+), 6 deletions(-) diff --git a/lab-zachary/app/component/login/_login.scss b/lab-zachary/app/component/login/_login.scss index e69de29b..69efa187 100644 --- a/lab-zachary/app/component/login/_login.scss +++ b/lab-zachary/app/component/login/_login.scss @@ -0,0 +1,2 @@ +.login-form{ +} \ No newline at end of file diff --git a/lab-zachary/app/component/login/login.html b/lab-zachary/app/component/login/login.html index 78ad31cf..aadabe3e 100644 --- a/lab-zachary/app/component/login/login.html +++ b/lab-zachary/app/component/login/login.html @@ -27,4 +27,5 @@ - \ No newline at end of file + +
\ No newline at end of file diff --git a/lab-zachary/app/component/signup/_signup.scss b/lab-zachary/app/component/signup/_signup.scss index e69de29b..b1c41d43 100644 --- a/lab-zachary/app/component/signup/_signup.scss +++ b/lab-zachary/app/component/signup/_signup.scss @@ -0,0 +1,6 @@ +.signup-form { + background-color:orange + button { + float:right; + } +} \ No newline at end of file diff --git a/lab-zachary/app/component/signup/signup.html b/lab-zachary/app/component/signup/signup.html index 8de50557..92988969 100644 --- a/lab-zachary/app/component/signup/signup.html +++ b/lab-zachary/app/component/signup/signup.html @@ -23,4 +23,5 @@ - \ No newline at end of file + +
\ No newline at end of file diff --git a/lab-zachary/app/index.html b/lab-zachary/app/index.html index 17dd47bf..12a8fd46 100644 --- a/lab-zachary/app/index.html +++ b/lab-zachary/app/index.html @@ -3,12 +3,16 @@ - CFgram + cfgram +
+
+
\ No newline at end of file diff --git a/lab-zachary/app/scss/lib/base/_base.scss b/lab-zachary/app/scss/lib/base/_base.scss index e69de29b..ffb58a10 100644 --- a/lab-zachary/app/scss/lib/base/_base.scss +++ b/lab-zachary/app/scss/lib/base/_base.scss @@ -0,0 +1,67 @@ + +body{ + background-color: $primaryColor; + font-family: $fontStack; + display: relative; + + a{ + text-decoration: none; + font-weight: bold; + color: $secondaryColor; + } + .clearfix{ + clear: both; + } + nav { + background-color: $secondaryColor; + color: $white; + height:90px; + img{ + max-height: 70%; + width: auto; + margin: $gutter/2 $gutter; + display: inline-block; + vertical-align: middle; + } + h1{ + display: inline-block; + font-size: $primaryTextSize; + vertical-align: middle; + } + } + main { + margin:$gutter; + } + form{ + width:100%; + } + input{ + width: 100%; + box-sizing:border-box; + border: 1px solid $tertiaryColor; + margin: $gutter 0; + font-size: 16px; + height: 40px; + padding:5px; + @include rounded(3px); + } + + .btn-std{ + @extend input; + width: unset; + padding: $gutter/2 $gutter*2.5; + background-color: $secondaryColor; + color: $white; + font-weight: 300; + float:right; + } + + footer{ + background-color: $tertiaryColor; + height:70px; + width: 100%; + position: absolute; + bottom: 0px; + } +} + diff --git a/lab-zachary/app/scss/lib/base/_global-vars.scss b/lab-zachary/app/scss/lib/base/_global-vars.scss index e69de29b..b6dbdd49 100644 --- a/lab-zachary/app/scss/lib/base/_global-vars.scss +++ b/lab-zachary/app/scss/lib/base/_global-vars.scss @@ -0,0 +1,18 @@ +@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,700'); + +$primaryColor: #D8D8D8; +$secondaryColor: #4A4A4A; +$tertiaryColor: #9B9B9B; +$white: #fff; +$black: #000; + +$gutter: 3%; + +$fontStack: 'Open Sans', Helvetica, sans-serif; +$primaryTextSize: 4.4vw; + +@mixin rounded($radius: 0.5em) { + -webkit-border-radius: $radius; + -moz-border-radius: $radius; + border-radius: $radius; +} \ No newline at end of file diff --git a/lab-zachary/app/view/landing/_landing.scss b/lab-zachary/app/view/landing/_landing.scss index e69de29b..be212af7 100644 --- a/lab-zachary/app/view/landing/_landing.scss +++ b/lab-zachary/app/view/landing/_landing.scss @@ -0,0 +1,9 @@ +.join-container{ + text-align:right; + h2{ + text-align: left + } + p { + display: inline-block; + } +} \ No newline at end of file diff --git a/lab-zachary/app/view/landing/landing.html b/lab-zachary/app/view/landing/landing.html index 4e4ab584..88a258a3 100644 --- a/lab-zachary/app/view/landing/landing.html +++ b/lab-zachary/app/view/landing/landing.html @@ -1,20 +1,22 @@
-

Show signup:{{ landingCtrl.showSignup }}

+

sign up.

+

sign in.

+

want to sign up?

From f2cc2349d694bf9a4ce9cce5fd46d5f1c13811c4 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Wed, 29 Mar 2017 09:07:20 -0700 Subject: [PATCH 04/23] updated styles --- lab-zachary/app/scss/lib/base/_base.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lab-zachary/app/scss/lib/base/_base.scss b/lab-zachary/app/scss/lib/base/_base.scss index ffb58a10..7c27dc9c 100644 --- a/lab-zachary/app/scss/lib/base/_base.scss +++ b/lab-zachary/app/scss/lib/base/_base.scss @@ -17,7 +17,7 @@ body{ color: $white; height:90px; img{ - max-height: 70%; + height: 70px; width: auto; margin: $gutter/2 $gutter; display: inline-block; @@ -49,7 +49,7 @@ body{ .btn-std{ @extend input; width: unset; - padding: $gutter/2 $gutter*2.5; + padding: 0 $gutter*2.5; background-color: $secondaryColor; color: $white; font-weight: 300; From 6da2a3737158ea6bb1b0b4991456453e0d2e916f Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Wed, 29 Mar 2017 10:08:45 -0700 Subject: [PATCH 05/23] tweaked styles and changed img src to ng-src --- lab-zachary/app/index.html | 5 ++++- lab-zachary/app/scss/lib/base/_base.scss | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lab-zachary/app/index.html b/lab-zachary/app/index.html index 12a8fd46..dfe28051 100644 --- a/lab-zachary/app/index.html +++ b/lab-zachary/app/index.html @@ -7,7 +7,10 @@
diff --git a/lab-zachary/app/scss/lib/base/_base.scss b/lab-zachary/app/scss/lib/base/_base.scss index 7c27dc9c..905421ae 100644 --- a/lab-zachary/app/scss/lib/base/_base.scss +++ b/lab-zachary/app/scss/lib/base/_base.scss @@ -60,8 +60,8 @@ body{ background-color: $tertiaryColor; height:70px; width: 100%; - position: absolute; - bottom: 0px; + // position: absolute; + // bottom: 0px; } } From 7e6327b10fa263a772735fc0b5a931fffcb46d65 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Wed, 29 Mar 2017 13:06:05 -0700 Subject: [PATCH 06/23] added a few straggler files. karma etc. --- lab-zachary/app/config/log-config.js | 7 +++++++ lab-zachary/karma.config.js | 26 ++++++++++++++++++++++++++ lab-zachary/package.json | 3 ++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 lab-zachary/app/config/log-config.js create mode 100644 lab-zachary/karma.config.js diff --git a/lab-zachary/app/config/log-config.js b/lab-zachary/app/config/log-config.js new file mode 100644 index 00000000..c3e44011 --- /dev/null +++ b/lab-zachary/app/config/log-config.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = ['$logProvider', logConfig]; + +function logConfig($logProvider) { + $logProvider.debugEnabled(__DEBUG__); +} \ No newline at end of file diff --git a/lab-zachary/karma.config.js b/lab-zachary/karma.config.js new file mode 100644 index 00000000..dfbc6e34 --- /dev/null +++ b/lab-zachary/karma.config.js @@ -0,0 +1,26 @@ +const webpackConfig = require('./webpack.config.js'); + +module.exports = function(config) { + config.set({ + webpack: webpackConfig, + basePath: '', + frameworks: ['jasmine'], + files: [ + 'test/**/*-test.js' + ], + exclude: [ + ], + preprocessors: { + 'test/**/*-test.js': ['webpack'] + }, + + reporters: ['mocha'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['PhantomJS'], + singleRun: false, + concurrency: Infinity + }); +}; \ No newline at end of file diff --git a/lab-zachary/package.json b/lab-zachary/package.json index 1ac6ef3e..ad674db1 100644 --- a/lab-zachary/package.json +++ b/lab-zachary/package.json @@ -4,7 +4,8 @@ "description": "", "main": "webpack.config.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "./node_modules/karma/bin/karma start --single-run", + "test-watch": "./node_modules/karma/bin/karma start", "watch": "./node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot", "build": "./node_modules/webpack/bin/webpack.js", "lint": "eslint ." From fd5f06110baadd65b50cdcfc68735954616949bd Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Wed, 29 Mar 2017 13:22:33 -0700 Subject: [PATCH 07/23] setup directory and fix env issues --- .../gallery/create-gallery/_create-gallery.scss | 0 .../gallery/create-gallery/create-gallery.html | 0 .../component/gallery/create-gallery/create-gallery.js | 0 .../app/component/{ => landing}/login/_login.scss | 0 .../app/component/{ => landing}/login/login.html | 0 lab-zachary/app/component/{ => landing}/login/login.js | 0 .../app/component/{ => landing}/signup/_signup.scss | 0 .../app/component/{ => landing}/signup/signup.html | 0 .../app/component/{ => landing}/signup/signup.js | 0 lab-zachary/app/component/navbar/_navbar.scss | 0 lab-zachary/app/component/navbar/navbar.html | 0 lab-zachary/app/component/navbar/navbar.js | 0 lab-zachary/webpack.config.js | 10 +++++++--- 13 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 lab-zachary/app/component/gallery/create-gallery/_create-gallery.scss create mode 100644 lab-zachary/app/component/gallery/create-gallery/create-gallery.html create mode 100644 lab-zachary/app/component/gallery/create-gallery/create-gallery.js rename lab-zachary/app/component/{ => landing}/login/_login.scss (100%) rename lab-zachary/app/component/{ => landing}/login/login.html (100%) rename lab-zachary/app/component/{ => landing}/login/login.js (100%) rename lab-zachary/app/component/{ => landing}/signup/_signup.scss (100%) rename lab-zachary/app/component/{ => landing}/signup/signup.html (100%) rename lab-zachary/app/component/{ => landing}/signup/signup.js (100%) create mode 100644 lab-zachary/app/component/navbar/_navbar.scss create mode 100644 lab-zachary/app/component/navbar/navbar.html create mode 100644 lab-zachary/app/component/navbar/navbar.js diff --git a/lab-zachary/app/component/gallery/create-gallery/_create-gallery.scss b/lab-zachary/app/component/gallery/create-gallery/_create-gallery.scss new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/gallery/create-gallery/create-gallery.html b/lab-zachary/app/component/gallery/create-gallery/create-gallery.html new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/gallery/create-gallery/create-gallery.js b/lab-zachary/app/component/gallery/create-gallery/create-gallery.js new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/login/_login.scss b/lab-zachary/app/component/landing/login/_login.scss similarity index 100% rename from lab-zachary/app/component/login/_login.scss rename to lab-zachary/app/component/landing/login/_login.scss diff --git a/lab-zachary/app/component/login/login.html b/lab-zachary/app/component/landing/login/login.html similarity index 100% rename from lab-zachary/app/component/login/login.html rename to lab-zachary/app/component/landing/login/login.html diff --git a/lab-zachary/app/component/login/login.js b/lab-zachary/app/component/landing/login/login.js similarity index 100% rename from lab-zachary/app/component/login/login.js rename to lab-zachary/app/component/landing/login/login.js diff --git a/lab-zachary/app/component/signup/_signup.scss b/lab-zachary/app/component/landing/signup/_signup.scss similarity index 100% rename from lab-zachary/app/component/signup/_signup.scss rename to lab-zachary/app/component/landing/signup/_signup.scss diff --git a/lab-zachary/app/component/signup/signup.html b/lab-zachary/app/component/landing/signup/signup.html similarity index 100% rename from lab-zachary/app/component/signup/signup.html rename to lab-zachary/app/component/landing/signup/signup.html diff --git a/lab-zachary/app/component/signup/signup.js b/lab-zachary/app/component/landing/signup/signup.js similarity index 100% rename from lab-zachary/app/component/signup/signup.js rename to lab-zachary/app/component/landing/signup/signup.js diff --git a/lab-zachary/app/component/navbar/_navbar.scss b/lab-zachary/app/component/navbar/_navbar.scss new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/navbar/navbar.html b/lab-zachary/app/component/navbar/navbar.html new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/navbar/navbar.js b/lab-zachary/app/component/navbar/navbar.js new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/webpack.config.js b/lab-zachary/webpack.config.js index e0fa6527..ada37bf7 100644 --- a/lab-zachary/webpack.config.js +++ b/lab-zachary/webpack.config.js @@ -1,11 +1,14 @@ 'use strict'; -require('dotenv').load(); - +const dotenv = require('dotenv'); const HTMLPlugin = require('html-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const webpack = require('webpack'); +const production = process.env.NODE_ENV === 'production'; + +dotenv.load(); + module.exports = { devtool: 'eval', entry: `${__dirname}/app/entry.js`, @@ -19,7 +22,8 @@ module.exports = { }), new ExtractTextPlugin('bundle.css'), new webpack.DefinePlugin({ - __API_URL__: JSON.stringify(process.env.API_URL) + __API_URL__: JSON.stringify(process.env.API_URL), + __DEBUG__: JSON.stringify(!production) }) ], module: { From ae6514497bf7d8ede80f80411eac1d39332b5827 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Wed, 29 Mar 2017 18:57:45 -0700 Subject: [PATCH 08/23] base functionality completed --- .../create-gallery/create-gallery.html | 23 ++++++ .../gallery/create-gallery/create-gallery.js | 21 ++++++ .../app/component/landing/login/_login.scss | 1 + .../app/component/landing/signup/_signup.scss | 1 - lab-zachary/app/component/navbar/_navbar.scss | 30 ++++++++ lab-zachary/app/component/navbar/navbar.html | 11 +++ lab-zachary/app/component/navbar/navbar.js | 44 +++++++++++ lab-zachary/app/index.html | 10 +-- lab-zachary/app/scss/lib/base/_base.scss | 18 +---- .../app/scss/lib/base/_global-vars.scss | 2 +- lab-zachary/app/service/gallery-service.js | 74 +++++++++++++++++++ lab-zachary/app/view/home/_home.scss | 26 +++++++ lab-zachary/app/view/home/home-controller.js | 25 ++++--- lab-zachary/app/view/home/home.html | 10 ++- 14 files changed, 260 insertions(+), 36 deletions(-) create mode 100644 lab-zachary/app/service/gallery-service.js diff --git a/lab-zachary/app/component/gallery/create-gallery/create-gallery.html b/lab-zachary/app/component/gallery/create-gallery/create-gallery.html index e69de29b..a4a1806b 100644 --- a/lab-zachary/app/component/gallery/create-gallery/create-gallery.html +++ b/lab-zachary/app/component/gallery/create-gallery/create-gallery.html @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/lab-zachary/app/component/gallery/create-gallery/create-gallery.js b/lab-zachary/app/component/gallery/create-gallery/create-gallery.js index e69de29b..5800024e 100644 --- a/lab-zachary/app/component/gallery/create-gallery/create-gallery.js +++ b/lab-zachary/app/component/gallery/create-gallery/create-gallery.js @@ -0,0 +1,21 @@ +'use strict'; + +module.exports = { + template: require('./create-gallery.html'), + controller: ['$log', 'galleryService', CreateGalleryController], + controllerAs: 'createGalleryCtrl' +}; + +function CreateGalleryController($log, galleryService) { + $log.debug('CreateGalleryController'); + + this.gallery = {}; + + this.createGallery = function() { + galleryService.createGallery(this.gallery) + .then( () => { + this.gallery.name = null; + this.gallery.desc = null; + }); + }; +} \ No newline at end of file diff --git a/lab-zachary/app/component/landing/login/_login.scss b/lab-zachary/app/component/landing/login/_login.scss index 69efa187..a1c18930 100644 --- a/lab-zachary/app/component/landing/login/_login.scss +++ b/lab-zachary/app/component/landing/login/_login.scss @@ -1,2 +1,3 @@ .login-form{ + //background-color: $white; } \ No newline at end of file diff --git a/lab-zachary/app/component/landing/signup/_signup.scss b/lab-zachary/app/component/landing/signup/_signup.scss index b1c41d43..bdef2cb9 100644 --- a/lab-zachary/app/component/landing/signup/_signup.scss +++ b/lab-zachary/app/component/landing/signup/_signup.scss @@ -1,5 +1,4 @@ .signup-form { - background-color:orange button { float:right; } diff --git a/lab-zachary/app/component/navbar/_navbar.scss b/lab-zachary/app/component/navbar/_navbar.scss index e69de29b..aae7a78a 100644 --- a/lab-zachary/app/component/navbar/_navbar.scss +++ b/lab-zachary/app/component/navbar/_navbar.scss @@ -0,0 +1,30 @@ +@import '../../scss/lib/base/global-vars'; + +nav { + background-color: $secondaryColor; + color: $white; + img{ + height: 70px; + width: auto; + margin: $gutter/2 $gutter; + display: inline-block; + vertical-align: middle; + } + h1{ + display: inline-block; + font-size: $primaryTextSize; + vertical-align: middle; + } + div{ + float: right; + margin: $gutter; + min-width: 150px; + + .btn-std { + background-color: $primaryColor; + color: $secondaryColor; + padding: 0 $gutter*5; + //min-width: 85px; + } + } + } \ No newline at end of file diff --git a/lab-zachary/app/component/navbar/navbar.html b/lab-zachary/app/component/navbar/navbar.html index e69de29b..bdef69fa 100644 --- a/lab-zachary/app/component/navbar/navbar.html +++ b/lab-zachary/app/component/navbar/navbar.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/lab-zachary/app/component/navbar/navbar.js b/lab-zachary/app/component/navbar/navbar.js index e69de29b..69dcb7fb 100644 --- a/lab-zachary/app/component/navbar/navbar.js +++ b/lab-zachary/app/component/navbar/navbar.js @@ -0,0 +1,44 @@ +'use strict'; + +require('./_navbar.scss'); +module.exports = { + template: require('./navbar.html'), + controller: ['$log', '$location', '$rootScope', 'authService', NavbarController], + controllerAs: 'navbarCtrl' +}; + +function NavbarController($log, $location, $rootScope, authService) { + $log.debug('NavbarController'); + + this.checkPath = function() { + let path = ($location.path() === '/join') + + //$log.debug($location.path); + + if(path) this.hideButtons = true; + + if (!path) { + this.hideButtons = false; + authService.getToken() + .catch( () => { + $location.url('/join#login'); + }); + } + }; + + this.checkPath(); + + $rootScope.$on('$locationChangeSuccess', () => { + this.checkPath(); + }); + + this.logout = function() { + $log.log('authService.logout'); + + this.hideButtons = true; + authService.logout() + .then( () => { + $location.url('/'); + }); + }; +} \ No newline at end of file diff --git a/lab-zachary/app/index.html b/lab-zachary/app/index.html index dfe28051..ee6143d5 100644 --- a/lab-zachary/app/index.html +++ b/lab-zachary/app/index.html @@ -6,13 +6,9 @@ cfgram - +
+ +
diff --git a/lab-zachary/app/scss/lib/base/_base.scss b/lab-zachary/app/scss/lib/base/_base.scss index 905421ae..7a4e02ce 100644 --- a/lab-zachary/app/scss/lib/base/_base.scss +++ b/lab-zachary/app/scss/lib/base/_base.scss @@ -12,23 +12,7 @@ body{ .clearfix{ clear: both; } - nav { - background-color: $secondaryColor; - color: $white; - height:90px; - img{ - height: 70px; - width: auto; - margin: $gutter/2 $gutter; - display: inline-block; - vertical-align: middle; - } - h1{ - display: inline-block; - font-size: $primaryTextSize; - vertical-align: middle; - } - } + main { margin:$gutter; } diff --git a/lab-zachary/app/scss/lib/base/_global-vars.scss b/lab-zachary/app/scss/lib/base/_global-vars.scss index b6dbdd49..f4241a7d 100644 --- a/lab-zachary/app/scss/lib/base/_global-vars.scss +++ b/lab-zachary/app/scss/lib/base/_global-vars.scss @@ -14,5 +14,5 @@ $primaryTextSize: 4.4vw; @mixin rounded($radius: 0.5em) { -webkit-border-radius: $radius; -moz-border-radius: $radius; - border-radius: $radius; + border-radius: $radius*2; } \ No newline at end of file diff --git a/lab-zachary/app/service/gallery-service.js b/lab-zachary/app/service/gallery-service.js new file mode 100644 index 00000000..417d1a15 --- /dev/null +++ b/lab-zachary/app/service/gallery-service.js @@ -0,0 +1,74 @@ +'use strict'; + +module.exports = ['$log', '$q', '$http', 'authService', galleryService]; + +function galleryService($log, $q, $http, authService) { + $log.debug('galleryService'); + + let service = {}; + service.galleries = []; + let url = `${__API_URL__}`; + + service.fetchGalleries = function(){ + $log.debug('authService.fetchGallery'); + + return authService.getToken() + .then( token => { + let config = { + headers: { + Authorization: `Bearer ${token}`, + 'Content-Type': 'application/json', + Accept: 'application/json' + } + }; + return $http.get(`${url}/api/gallery`, config) + .then( res => { + $log.debug('galleries retrieved', res.data); + + service.galleries = res.data; + return service.galleries; + }) + .catch( err => { + return $q.reject(err); + }); + }); + + + }; + + service.createGallery = function(gallery) { + $log.debug('authService.createGallery'); + + authService.getToken() + .then( token => { + let config = { + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + Authorization: `Bearer ${token}`, + } + }; + return $http.post(`${url}/api/gallery`, gallery, config); + }) + .then( res => { + $log.debug('gallery created'); + + service.galleries.unshift(res.data); + return res.data; + }) + .catch( err => { + $log.error(err); + return $q.reject(err); + }); + }; + + service.deleteGallery = function() { + + }; + + service.updateGallery = function() { + + }; + + return service; +} \ No newline at end of file diff --git a/lab-zachary/app/view/home/_home.scss b/lab-zachary/app/view/home/_home.scss index e69de29b..1e239ecc 100644 --- a/lab-zachary/app/view/home/_home.scss +++ b/lab-zachary/app/view/home/_home.scss @@ -0,0 +1,26 @@ +@import '../../scss/lib/base/global-vars'; + +.home-content { + h2 { + font-size: $primaryTextSize * .6; + margin-bottom: $gutter; + } + li { + background-color: $tertiaryColor; + color: $secondaryColor; + padding: $gutter; + @include rounded; + div { + margin-bottom: $gutter ; + + span:first-child { + font-weight: bold; + } + span:last-child { + } + } + div:last-child { + margin-bottom:0; + } + } +} \ No newline at end of file diff --git a/lab-zachary/app/view/home/home-controller.js b/lab-zachary/app/view/home/home-controller.js index 2f0cc6ce..66495a44 100644 --- a/lab-zachary/app/view/home/home-controller.js +++ b/lab-zachary/app/view/home/home-controller.js @@ -2,17 +2,24 @@ require('./_home.scss'); -module.exports = ['$log','$location', 'authService', HomeController]; +module.exports = ['$log','$rootScope', 'galleryService', HomeController]; -function HomeController($log, $location, authService) { - $log.debug('HomeController'); +function HomeController($log, $rootScope, galleryService) { + $log.debug('HomeController', galleryService.fetchGalleries); + this.galleries = []; - authService.getToken() - .then( () => { - }) - .catch( err => { - $log.error('HomeController: ', err); - $location.url(''); + this.fetchGalleries = function() { + galleryService.fetchGalleries() + .then( galleries => { + this.galleries = galleries; + console.log('test',galleries) + }); + }; + + this.fetchGalleries(); + + $rootScope.$on('$locationChangeSuccess', () => { + this.fetchGalleries(); }); } \ No newline at end of file diff --git a/lab-zachary/app/view/home/home.html b/lab-zachary/app/view/home/home.html index 2b4db79c..b2b8931e 100644 --- a/lab-zachary/app/view/home/home.html +++ b/lab-zachary/app/view/home/home.html @@ -1,3 +1,11 @@
-

Welcome Home

+ +

Galleries

+
    +
  • +
    name: {{ gallery.name }}
    +
    description: {{ gallery.desc }}
    +
    id: {{ gallery._id }}
    +
  • +
\ No newline at end of file From 9b7df961d41f5641f9487946f4f436d9a094afd0 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Wed, 29 Mar 2017 20:53:28 -0700 Subject: [PATCH 09/23] completed delete route and styled delete buttons --- .../gallery/create-gallery/create-gallery.js | 1 + lab-zachary/app/scss/lib/base/_base.scss | 3 ++ lab-zachary/app/service/gallery-service.js | 35 +++++++++++++++---- lab-zachary/app/view/home/_home.scss | 10 +++++- lab-zachary/app/view/home/home-controller.js | 13 +++++-- lab-zachary/app/view/home/home.html | 1 + 6 files changed, 54 insertions(+), 9 deletions(-) diff --git a/lab-zachary/app/component/gallery/create-gallery/create-gallery.js b/lab-zachary/app/component/gallery/create-gallery/create-gallery.js index 5800024e..4e235a4b 100644 --- a/lab-zachary/app/component/gallery/create-gallery/create-gallery.js +++ b/lab-zachary/app/component/gallery/create-gallery/create-gallery.js @@ -12,6 +12,7 @@ function CreateGalleryController($log, galleryService) { this.gallery = {}; this.createGallery = function() { + $log.debug('test', this.gallery); galleryService.createGallery(this.gallery) .then( () => { this.gallery.name = null; diff --git a/lab-zachary/app/scss/lib/base/_base.scss b/lab-zachary/app/scss/lib/base/_base.scss index 7a4e02ce..ee621020 100644 --- a/lab-zachary/app/scss/lib/base/_base.scss +++ b/lab-zachary/app/scss/lib/base/_base.scss @@ -15,6 +15,9 @@ body{ main { margin:$gutter; + + min-height: calc(100vh - 70px); + } form{ width:100%; diff --git a/lab-zachary/app/service/gallery-service.js b/lab-zachary/app/service/gallery-service.js index 417d1a15..39a3a41f 100644 --- a/lab-zachary/app/service/gallery-service.js +++ b/lab-zachary/app/service/gallery-service.js @@ -39,7 +39,7 @@ function galleryService($log, $q, $http, authService) { service.createGallery = function(gallery) { $log.debug('authService.createGallery'); - authService.getToken() + return authService.getToken() .then( token => { let config = { headers: { @@ -51,10 +51,10 @@ function galleryService($log, $q, $http, authService) { return $http.post(`${url}/api/gallery`, gallery, config); }) .then( res => { - $log.debug('gallery created'); - - service.galleries.unshift(res.data); - return res.data; + $log.log('gallery created'); + let gallery = res.data; + service.galleries.unshift(gallery); + return gallery; }) .catch( err => { $log.error(err); @@ -62,8 +62,31 @@ function galleryService($log, $q, $http, authService) { }); }; - service.deleteGallery = function() { + service.deleteGallery = function(gallery) { + $log.debug('authService.deleteGallery'); + return authService.getToken() + .then( token => { + let config = { + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + Authorization: `Bearer ${token}`, + } + }; + return $http.delete(`${url}/api/gallery/${gallery}`, config); + }) + .then( res => { + $log.debug('gallery deleted'); + service.galleries.forEach( (_gallery, index) => { + if (_gallery._id === gallery) service.galleries.splice(index,1); + }); + return res.data; + }) + .catch( err => { + $log.error(err); + return $q.reject(err); + }); }; service.updateGallery = function() { diff --git a/lab-zachary/app/view/home/_home.scss b/lab-zachary/app/view/home/_home.scss index 1e239ecc..5258fced 100644 --- a/lab-zachary/app/view/home/_home.scss +++ b/lab-zachary/app/view/home/_home.scss @@ -2,13 +2,14 @@ .home-content { h2 { - font-size: $primaryTextSize * .6; + font-size: $primaryTextSize * .9; margin-bottom: $gutter; } li { background-color: $tertiaryColor; color: $secondaryColor; padding: $gutter; + margin-bottom: $gutter; @include rounded; div { margin-bottom: $gutter ; @@ -22,5 +23,12 @@ div:last-child { margin-bottom:0; } + .btn-del{ + float: right; + margin-top: 0; + padding: $gutter/3; + background-color:$secondaryColor; + color:$primaryColor; + } } } \ No newline at end of file diff --git a/lab-zachary/app/view/home/home-controller.js b/lab-zachary/app/view/home/home-controller.js index 66495a44..fd6ae45b 100644 --- a/lab-zachary/app/view/home/home-controller.js +++ b/lab-zachary/app/view/home/home-controller.js @@ -5,7 +5,7 @@ require('./_home.scss'); module.exports = ['$log','$rootScope', 'galleryService', HomeController]; function HomeController($log, $rootScope, galleryService) { - $log.debug('HomeController', galleryService.fetchGalleries); + $log.debug('HomeController'); this.galleries = []; @@ -13,7 +13,16 @@ function HomeController($log, $rootScope, galleryService) { galleryService.fetchGalleries() .then( galleries => { this.galleries = galleries; - console.log('test',galleries) + }); + }; + + this.deleteGallery = function(gallery) { + galleryService.deleteGallery(gallery) + .then( _gallery => { + $log.debug('gallery deleted:', _gallery ); + }) + .catch( err => { + $log.error( err); }); }; diff --git a/lab-zachary/app/view/home/home.html b/lab-zachary/app/view/home/home.html index b2b8931e..b520824c 100644 --- a/lab-zachary/app/view/home/home.html +++ b/lab-zachary/app/view/home/home.html @@ -3,6 +3,7 @@

Galleries

  • +
    name: {{ gallery.name }}
    description: {{ gallery.desc }}
    id: {{ gallery._id }}
    From 930c6fdc203a75aabf6b96852f9bc3e798229602 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Thu, 30 Mar 2017 11:09:48 -0700 Subject: [PATCH 10/23] initial put route work --- lab-zachary/app/service/gallery-service.js | 28 +++++++++++++++++--- lab-zachary/app/view/home/home-controller.js | 15 +++++++++++ lab-zachary/app/view/home/home.html | 17 +++++++++--- 3 files changed, 52 insertions(+), 8 deletions(-) diff --git a/lab-zachary/app/service/gallery-service.js b/lab-zachary/app/service/gallery-service.js index 39a3a41f..6ecdb039 100644 --- a/lab-zachary/app/service/gallery-service.js +++ b/lab-zachary/app/service/gallery-service.js @@ -62,6 +62,30 @@ function galleryService($log, $q, $http, authService) { }); }; + service.updateGallery = function(gallery) { + $log.debug('galleryService.updateGallery', gallery); + + return authService.getToken() + .then( token => { + let config = { + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + Authorization: `Bearer ${token}`, + } + }; + return $http.put(`${url}/api/gallery/${gallery._id}`, gallery, config); + }) + .then( res => { + $log.log('gallery updated:', res.data); + return res.data; + }) + .catch( err => { + $log.error(err); + return $q.reject(err); + }); + }; + service.deleteGallery = function(gallery) { $log.debug('authService.deleteGallery'); @@ -89,9 +113,5 @@ function galleryService($log, $q, $http, authService) { }); }; - service.updateGallery = function() { - - }; - return service; } \ No newline at end of file diff --git a/lab-zachary/app/view/home/home-controller.js b/lab-zachary/app/view/home/home-controller.js index fd6ae45b..93584dc8 100644 --- a/lab-zachary/app/view/home/home-controller.js +++ b/lab-zachary/app/view/home/home-controller.js @@ -8,6 +8,7 @@ function HomeController($log, $rootScope, galleryService) { $log.debug('HomeController'); this.galleries = []; + this.editor = false; this.fetchGalleries = function() { galleryService.fetchGalleries() @@ -26,6 +27,20 @@ function HomeController($log, $rootScope, galleryService) { }); }; + this.updateGallery = function(gallery) { + galleryService.updateGallery(gallery) + .then( _gallery => { + $log.debug('gallery updated',_gallery); + }) + .catch( err => { + $log.error( err ); + }); + }; + + this.edit = () => { + this.editor = true; + }; + this.fetchGalleries(); $rootScope.$on('$locationChangeSuccess', () => { diff --git a/lab-zachary/app/view/home/home.html b/lab-zachary/app/view/home/home.html index b520824c..20de65a3 100644 --- a/lab-zachary/app/view/home/home.html +++ b/lab-zachary/app/view/home/home.html @@ -1,11 +1,20 @@ -
    +
    {{ homeCtrl.editor }}

    Galleries

    • - -
      name: {{ gallery.name }}
      -
      description: {{ gallery.desc }}
      + + + + +
      name: + {{ gallery.name }} + +
      +
      description: + {{ gallery.desc }} + +
      id: {{ gallery._id }}
    From 8b22599140a7d75db5c9c30884ece0ff8cffabe7 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Thu, 30 Mar 2017 18:42:20 -0700 Subject: [PATCH 11/23] added full put functionality and updated styles to scale better --- .../create-gallery/create-gallery.html | 1 + .../gallery/gallery-edit/_gallery-edit.scss | 15 +++++++ .../gallery/gallery-edit/gallery-edit.html | 20 +++++++++ .../gallery/gallery-edit/gallery-edit.js | 27 +++++++++++ .../gallery/gallery-item/_gallery-item.scss | 45 +++++++++++++++++++ .../gallery/gallery-item/gallery-item.html | 21 +++++++++ .../gallery/gallery-item/gallery-item.js | 30 +++++++++++++ .../app/component/landing/login/login.js | 2 +- lab-zachary/app/component/navbar/_navbar.scss | 15 +++---- lab-zachary/app/component/navbar/navbar.html | 3 +- lab-zachary/app/component/navbar/navbar.js | 2 +- lab-zachary/app/scss/lib/base/_base.scss | 9 ++-- .../app/scss/lib/base/_global-vars.scss | 3 +- lab-zachary/app/service/gallery-service.js | 9 ++-- lab-zachary/app/view/home/_home.scss | 26 ----------- lab-zachary/app/view/home/home-controller.js | 15 +------ lab-zachary/app/view/home/home.html | 20 ++------- 17 files changed, 186 insertions(+), 77 deletions(-) create mode 100644 lab-zachary/app/component/gallery/gallery-edit/_gallery-edit.scss create mode 100644 lab-zachary/app/component/gallery/gallery-edit/gallery-edit.html create mode 100644 lab-zachary/app/component/gallery/gallery-edit/gallery-edit.js create mode 100644 lab-zachary/app/component/gallery/gallery-item/_gallery-item.scss create mode 100644 lab-zachary/app/component/gallery/gallery-item/gallery-item.html create mode 100644 lab-zachary/app/component/gallery/gallery-item/gallery-item.js diff --git a/lab-zachary/app/component/gallery/create-gallery/create-gallery.html b/lab-zachary/app/component/gallery/create-gallery/create-gallery.html index a4a1806b..90e811f8 100644 --- a/lab-zachary/app/component/gallery/create-gallery/create-gallery.html +++ b/lab-zachary/app/component/gallery/create-gallery/create-gallery.html @@ -1,4 +1,5 @@
@@ -18,4 +19,5 @@
+
\ No newline at end of file diff --git a/lab-zachary/app/component/gallery/gallery-item/gallery-item.js b/lab-zachary/app/component/gallery/gallery-item/gallery-item.js index d091204e..6a5b299f 100644 --- a/lab-zachary/app/component/gallery/gallery-item/gallery-item.js +++ b/lab-zachary/app/component/gallery/gallery-item/gallery-item.js @@ -7,7 +7,7 @@ module.exports = { controller: ['$log', 'galleryService', GalleryItemController], controllerAs: 'galleryItemCtrl', bindings: { - gallery: '<' + gallery: '<', } }; diff --git a/lab-zachary/app/scss/lib/base/_base.scss b/lab-zachary/app/scss/lib/base/_base.scss index 46846a59..e6c7a7c0 100644 --- a/lab-zachary/app/scss/lib/base/_base.scss +++ b/lab-zachary/app/scss/lib/base/_base.scss @@ -49,5 +49,10 @@ body{ // position: absolute; // bottom: 0px; } + pre{ + max-width:100%; + font-style: monospace; + overflow: auto; + } } diff --git a/lab-zachary/app/service/gallery-service.js b/lab-zachary/app/service/gallery-service.js index 911b3c16..e4212f7c 100644 --- a/lab-zachary/app/service/gallery-service.js +++ b/lab-zachary/app/service/gallery-service.js @@ -77,10 +77,10 @@ function galleryService($log, $q, $http, authService) { return $http.put(`${url}/api/gallery/${galleryID}`, galleryData, config); }) .then( res => { - $log.log('gallery updated:', res.data); - service.galleries.forEach( (_gallery, index) => { - if (_gallery._id === galleryID) service.galleries[index] = res.data; - }); + $log.log('gallery updated:'); + // service.galleries.forEach( (_gallery, index) => { + // if (_gallery._id === galleryID) service.galleries[index] = res.data; + // }); return res.data; }) .catch( err => { diff --git a/lab-zachary/app/view/home/home-controller.js b/lab-zachary/app/view/home/home-controller.js index 85d88892..bcc10d2d 100644 --- a/lab-zachary/app/view/home/home-controller.js +++ b/lab-zachary/app/view/home/home-controller.js @@ -18,16 +18,6 @@ function HomeController($log, $rootScope, galleryService) { - this.updateGallery = function(gallery) { - galleryService.updateGallery(gallery) - .then( _gallery => { - $log.debug('gallery updated',_gallery); - }) - .catch( err => { - $log.error( err ); - }); - }; - this.fetchGalleries(); diff --git a/lab-zachary/app/view/home/home.html b/lab-zachary/app/view/home/home.html index fb6c89f7..adb3259a 100644 --- a/lab-zachary/app/view/home/home.html +++ b/lab-zachary/app/view/home/home.html @@ -2,6 +2,6 @@

Galleries

    - +
\ No newline at end of file From 2e9336cabd12a23461fda36244c4b32ac0ceb3dd Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Mon, 3 Apr 2017 11:00:43 -0700 Subject: [PATCH 13/23] finally got cancel functioning correctl --- .../gallery/gallery-edit/gallery-edit.js | 23 +++++++++---------- .../gallery/gallery-item/gallery-item.html | 3 ++- .../gallery/gallery-item/gallery-item.js | 7 +++++- lab-zachary/app/service/gallery-service.js | 5 ++-- lab-zachary/app/view/home/home.html | 4 ++-- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/lab-zachary/app/component/gallery/gallery-edit/gallery-edit.js b/lab-zachary/app/component/gallery/gallery-edit/gallery-edit.js index b88b7b17..5d231dc8 100644 --- a/lab-zachary/app/component/gallery/gallery-edit/gallery-edit.js +++ b/lab-zachary/app/component/gallery/gallery-edit/gallery-edit.js @@ -7,26 +7,25 @@ module.exports = { controller: ['$log', 'galleryService', GalleryEditController], controllerAs: 'galleryEditCtrl', bindings: { - gallery: '<', - showEditGallery: '=' + gallery: '=', + showEditGallery: '=', + oldData: '<' } }; function GalleryEditController($log, galleryService) { $log.debug('GalleryEditController'); - this.galleries = galleryService.galleries; + //this.galleries = galleryService.galleries; + $log.debug(this.oldData, this); this.cancelUpdate = function() { + $log.debug(this.gallery); + this.gallery = this.oldData; this.showEditGallery = false; - galleryService.fetchGalleries() - .then( oGalleries => { - oGalleries.forEach( (_gallery, index) => { - if (_gallery._id === this.gallery._id) this.galleries[index] = _gallery; - }); - }) - .catch( err => { - $log.error(err); - }); + + + }; + this.updateGallery = function() { $log.debug('GalleryEditController.updateGallery'); galleryService.updateGallery(this.gallery._id, this.gallery) diff --git a/lab-zachary/app/component/gallery/gallery-item/gallery-item.html b/lab-zachary/app/component/gallery/gallery-item/gallery-item.html index 026c0153..e764e43c 100644 --- a/lab-zachary/app/component/gallery/gallery-item/gallery-item.html +++ b/lab-zachary/app/component/gallery/gallery-item/gallery-item.html @@ -9,12 +9,13 @@
diff --git a/lab-zachary/app/component/gallery/gallery-item/gallery-item.js b/lab-zachary/app/component/gallery/gallery-item/gallery-item.js index 6a5b299f..b3a30b39 100644 --- a/lab-zachary/app/component/gallery/gallery-item/gallery-item.js +++ b/lab-zachary/app/component/gallery/gallery-item/gallery-item.js @@ -8,14 +8,19 @@ module.exports = { controllerAs: 'galleryItemCtrl', bindings: { gallery: '<', + oldData: '<', } }; function GalleryItemController($log, galleryService) { $log.debug('GalleryItemController'); - this.showEditGallery = false; + this.editGallery = function() { + this.oldData = angular.copy(this.gallery); + this.showEditGallery = true; + }; + this.deleteGallery = function() { galleryService.deleteGallery(this.gallery._id) .then( _gallery => { diff --git a/lab-zachary/app/service/gallery-service.js b/lab-zachary/app/service/gallery-service.js index e4212f7c..e5969c24 100644 --- a/lab-zachary/app/service/gallery-service.js +++ b/lab-zachary/app/service/gallery-service.js @@ -32,8 +32,9 @@ function galleryService($log, $q, $http, authService) { return $q.reject(err); }); }); - - + }; + service.cancelUpdate = function() { + service.fetchGalleries(); }; service.createGallery = function(gallery) { diff --git a/lab-zachary/app/view/home/home.html b/lab-zachary/app/view/home/home.html index adb3259a..391fa6f5 100644 --- a/lab-zachary/app/view/home/home.html +++ b/lab-zachary/app/view/home/home.html @@ -2,6 +2,6 @@

Galleries

    - +
- \ No newline at end of file + From 8e993cb9d1a4fbe31e7f55715d025564c611e548 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Mon, 3 Apr 2017 12:32:43 -0700 Subject: [PATCH 14/23] added .env --- lab-zachary/.env | 1 + 1 file changed, 1 insertion(+) create mode 100644 lab-zachary/.env diff --git a/lab-zachary/.env b/lab-zachary/.env new file mode 100644 index 00000000..3a2fb159 --- /dev/null +++ b/lab-zachary/.env @@ -0,0 +1 @@ +API_URL='http://localhost:8000' \ No newline at end of file From 8cc28d339098ed27343b86e856d85d0aa9d68b71 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Mon, 3 Apr 2017 16:40:49 -0700 Subject: [PATCH 15/23] day 4 framework --- .../gallery/thumbnail-container/_thumbnail-container.scss | 0 .../gallery/thumbnail-container/thumbnail-container.html | 0 .../component/gallery/thumbnail-container/thumbnail-container.js | 0 lab-zachary/app/component/gallery/thumbnail/_thumbnail.scss | 0 lab-zachary/app/component/gallery/thumbnail/thumbnail.html | 0 lab-zachary/app/component/gallery/thumbnail/thumbnail.js | 0 lab-zachary/app/component/gallery/upload-pic/_upload-pic.scss | 0 lab-zachary/app/component/gallery/upload-pic/upload-pic.html | 0 lab-zachary/app/component/gallery/upload-pic/upload-pic.js | 0 9 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 lab-zachary/app/component/gallery/thumbnail-container/_thumbnail-container.scss create mode 100644 lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.html create mode 100644 lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.js create mode 100644 lab-zachary/app/component/gallery/thumbnail/_thumbnail.scss create mode 100644 lab-zachary/app/component/gallery/thumbnail/thumbnail.html create mode 100644 lab-zachary/app/component/gallery/thumbnail/thumbnail.js create mode 100644 lab-zachary/app/component/gallery/upload-pic/_upload-pic.scss create mode 100644 lab-zachary/app/component/gallery/upload-pic/upload-pic.html create mode 100644 lab-zachary/app/component/gallery/upload-pic/upload-pic.js diff --git a/lab-zachary/app/component/gallery/thumbnail-container/_thumbnail-container.scss b/lab-zachary/app/component/gallery/thumbnail-container/_thumbnail-container.scss new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.html b/lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.html new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.js b/lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.js new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/gallery/thumbnail/_thumbnail.scss b/lab-zachary/app/component/gallery/thumbnail/_thumbnail.scss new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/gallery/thumbnail/thumbnail.html b/lab-zachary/app/component/gallery/thumbnail/thumbnail.html new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/gallery/thumbnail/thumbnail.js b/lab-zachary/app/component/gallery/thumbnail/thumbnail.js new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/gallery/upload-pic/_upload-pic.scss b/lab-zachary/app/component/gallery/upload-pic/_upload-pic.scss new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/gallery/upload-pic/upload-pic.html b/lab-zachary/app/component/gallery/upload-pic/upload-pic.html new file mode 100644 index 00000000..e69de29b diff --git a/lab-zachary/app/component/gallery/upload-pic/upload-pic.js b/lab-zachary/app/component/gallery/upload-pic/upload-pic.js new file mode 100644 index 00000000..e69de29b From ff7960c8bfc15af45dd684137437c79935c9aeb7 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Mon, 3 Apr 2017 22:02:16 -0700 Subject: [PATCH 16/23] added pic upload and delete functionality --- .../gallery/gallery-edit/gallery-edit.html | 1 + .../_thumbnail-container.scss | 9 +++ .../thumbnail-container.html | 8 +++ .../thumbnail-container.js | 10 +++ .../gallery/thumbnail/_thumbnail.scss | 15 ++++ .../gallery/thumbnail/thumbnail.html | 5 ++ .../component/gallery/thumbnail/thumbnail.js | 24 +++++++ .../gallery/upload-pic/_upload-pic.scss | 30 ++++++++ .../gallery/upload-pic/upload-pic.html | 27 ++++++++ .../gallery/upload-pic/upload-pic.js | 27 ++++++++ lab-zachary/app/entry.js | 4 +- .../app/scss/lib/base/_global-vars.scss | 9 ++- lab-zachary/app/service/pic-service.js | 69 +++++++++++++++++++ lab-zachary/app/view/home/home-controller.js | 1 + lab-zachary/app/view/home/home.html | 7 +- lab-zachary/package.json | 2 + 16 files changed, 245 insertions(+), 3 deletions(-) create mode 100644 lab-zachary/app/service/pic-service.js diff --git a/lab-zachary/app/component/gallery/gallery-edit/gallery-edit.html b/lab-zachary/app/component/gallery/gallery-edit/gallery-edit.html index 7f4cfabc..1e05f1b0 100644 --- a/lab-zachary/app/component/gallery/gallery-edit/gallery-edit.html +++ b/lab-zachary/app/component/gallery/gallery-edit/gallery-edit.html @@ -23,3 +23,4 @@ cancel + diff --git a/lab-zachary/app/component/gallery/thumbnail-container/_thumbnail-container.scss b/lab-zachary/app/component/gallery/thumbnail-container/_thumbnail-container.scss index e69de29b..88fc121a 100644 --- a/lab-zachary/app/component/gallery/thumbnail-container/_thumbnail-container.scss +++ b/lab-zachary/app/component/gallery/thumbnail-container/_thumbnail-container.scss @@ -0,0 +1,9 @@ +@import '../../../scss/lib/base/global-vars'; + + +.thumbnail-container{ + margin: $gutter*3 0; + h3 { + margin-bottom: $gutter*2; + } +} \ No newline at end of file diff --git a/lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.html b/lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.html index e69de29b..13be8e12 100644 --- a/lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.html +++ b/lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.html @@ -0,0 +1,8 @@ +
+

{{ thumbnailContainerCtrl.gallery.name }}

+ +
+ +
+
+
\ No newline at end of file diff --git a/lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.js b/lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.js index e69de29b..bde02c97 100644 --- a/lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.js +++ b/lab-zachary/app/component/gallery/thumbnail-container/thumbnail-container.js @@ -0,0 +1,10 @@ +'use strict'; + +require('./_thumbnail-container.scss'); +module.exports = { + template: require('./thumbnail-container.html'), + controllerAs: 'thumbnailContainerCtrl', + bindings: { + gallery: '<' + } +}; \ No newline at end of file diff --git a/lab-zachary/app/component/gallery/thumbnail/_thumbnail.scss b/lab-zachary/app/component/gallery/thumbnail/_thumbnail.scss index e69de29b..0c15e9e6 100644 --- a/lab-zachary/app/component/gallery/thumbnail/_thumbnail.scss +++ b/lab-zachary/app/component/gallery/thumbnail/_thumbnail.scss @@ -0,0 +1,15 @@ +@import '../../../scss/lib/base/global-vars'; + +.thumbnail{ + width:100%; + margin-bottom: $gutter*2; + + img{ + max-width: 100%; + margin:0 auto; + display: block; + clear:both; + } + + +} \ No newline at end of file diff --git a/lab-zachary/app/component/gallery/thumbnail/thumbnail.html b/lab-zachary/app/component/gallery/thumbnail/thumbnail.html index e69de29b..29daf6b2 100644 --- a/lab-zachary/app/component/gallery/thumbnail/thumbnail.html +++ b/lab-zachary/app/component/gallery/thumbnail/thumbnail.html @@ -0,0 +1,5 @@ +
+ {{ thumbnailCtrl.pic.desc }} + delete +
+
\ No newline at end of file diff --git a/lab-zachary/app/component/gallery/thumbnail/thumbnail.js b/lab-zachary/app/component/gallery/thumbnail/thumbnail.js index e69de29b..e6e6511a 100644 --- a/lab-zachary/app/component/gallery/thumbnail/thumbnail.js +++ b/lab-zachary/app/component/gallery/thumbnail/thumbnail.js @@ -0,0 +1,24 @@ +'use strict'; + +require('./_thumbnail.scss'); + +module.exports = { + template: require('./thumbnail.html'), + controller: ['$log', 'picService', thumbnailController], + controllerAs: 'thumbnailCtrl', + bindings: { + pic: '<', + gallery: '<' + } +}; + +function thumbnailController($log, picService){ + $log.debug('thumbnailController'); + + this.deleteGalleryPic = function(){ + console.log('deletePic'); + + picService.deleteGalleryPic(this.gallery, this.pic); + }; + +} \ No newline at end of file diff --git a/lab-zachary/app/component/gallery/upload-pic/_upload-pic.scss b/lab-zachary/app/component/gallery/upload-pic/_upload-pic.scss index e69de29b..864c208f 100644 --- a/lab-zachary/app/component/gallery/upload-pic/_upload-pic.scss +++ b/lab-zachary/app/component/gallery/upload-pic/_upload-pic.scss @@ -0,0 +1,30 @@ +@import '../../../scss/lib/base/global-vars'; + +.upload-pic{ + h3 { + margin-bottom: $gutter/2; + text-decoration: underline; + } + form{ + input { + background-color: $tertiaryColor; + color:$white; + @include placeholder { + color: white; + font-weight:100; + } + } + div{ + text-align: right; + margin-bottom: $gutter; + p{ + text-decoration: underline; + display: inline-block; + margin-right: $gutter; + } + button{ + float:none; + } + } + } +} \ No newline at end of file diff --git a/lab-zachary/app/component/gallery/upload-pic/upload-pic.html b/lab-zachary/app/component/gallery/upload-pic/upload-pic.html index e69de29b..c5efe64a 100644 --- a/lab-zachary/app/component/gallery/upload-pic/upload-pic.html +++ b/lab-zachary/app/component/gallery/upload-pic/upload-pic.html @@ -0,0 +1,27 @@ +
+
+ +

upload new pic

+ +
+ + + +
+ +
+

+ select an image to upload +

+ + +
+
+
+
\ No newline at end of file diff --git a/lab-zachary/app/component/gallery/upload-pic/upload-pic.js b/lab-zachary/app/component/gallery/upload-pic/upload-pic.js index e69de29b..0321d3fe 100644 --- a/lab-zachary/app/component/gallery/upload-pic/upload-pic.js +++ b/lab-zachary/app/component/gallery/upload-pic/upload-pic.js @@ -0,0 +1,27 @@ +'use strict'; + +require('./_upload-pic.scss'); + +module.exports = { + template: require('./upload-pic.html'), + controller: ['$log', 'picService', UploadPicController], + controllerAs: 'uploadPicCtrl', + bindings: { + gallery: '<' + } +}; + +function UploadPicController($log, picService) { + $log.debug('UploadPicController'); + + this.pic = {}; + + this.uploadPic = function() { + picService.uploadGalleryPic(this.gallery, this.pic) + .then( () => { + this.pic.name = null; + this.pic.desc = null; + this.pic.file = null; + }); + }; +}; \ No newline at end of file diff --git a/lab-zachary/app/entry.js b/lab-zachary/app/entry.js index 8f6281c2..37113887 100644 --- a/lab-zachary/app/entry.js +++ b/lab-zachary/app/entry.js @@ -7,10 +7,12 @@ const path = require('path'); const uiRouter = require('angular-ui-router'); const ngTouch = require('angular-touch'); const ngAnimate = require('angular-animate'); +const ngFileUpload = require('ng-file-upload'); + require('./scss/main.scss'); -const cfgram = angular.module('cfgram', [ngTouch, ngAnimate, uiRouter]); +const cfgram = angular.module('cfgram', [ngTouch, ngAnimate, uiRouter, ngFileUpload]); let context = require.context('./config/', true, /\.js$/); context.keys().forEach( key => { diff --git a/lab-zachary/app/scss/lib/base/_global-vars.scss b/lab-zachary/app/scss/lib/base/_global-vars.scss index 85759028..a63c56b1 100644 --- a/lab-zachary/app/scss/lib/base/_global-vars.scss +++ b/lab-zachary/app/scss/lib/base/_global-vars.scss @@ -16,4 +16,11 @@ $secondaryTextSize: 3vw; -webkit-border-radius: $radius; -moz-border-radius: $radius; border-radius: $radius*2; -} \ No newline at end of file +} + +@mixin placeholder { + &::-webkit-input-placeholder {@content} + &:-moz-placeholder {@content} + &::-moz-placeholder {@content} + &:-ms-input-placeholder {@content} +} diff --git a/lab-zachary/app/service/pic-service.js b/lab-zachary/app/service/pic-service.js new file mode 100644 index 00000000..f549536d --- /dev/null +++ b/lab-zachary/app/service/pic-service.js @@ -0,0 +1,69 @@ +'use strict'; + +module.exports = ['$log', '$q', '$http', 'Upload', 'authService', picService]; + +function picService($log, $q, $http, Upload, authService){ + $log.debug('picService'); + + let service = {}; + + service.uploadGalleryPic = function(galleryData, picData) { + $log.debug('picService.uploadGalleryPic'); + + return authService.getToken() + .then( token => { + let url = `${__API_URL__}/api/gallery/${galleryData._id}/pic`; + let headers = { + Authorization: `Bearer ${token}`, + Accept: 'applciation/json' + }; + + return Upload.upload({ + url, + headers, + method: 'POST', + data: { + name: picData.name, + desc: picData.desc, + file: picData.file + } + }) + .then( res => { + galleryData.pics.unshift(res.data); + return res.data; + }) + .catch( err => { + console.error(err); + return $q.reject(err); + }); + }); + }; + service.deleteGalleryPic = function(galleryData, picData) { + $log.debug('picService.deleteGalleryPic'); + + authService.getToken() + .then( token => { + let url = `${__API_URL__}/api/gallery/${galleryData._id}/pic/${picData._id}`; + let config ={ + headers : { + Authorization: `Bearer ${token}`, + Accept: 'application/json', + } + }; + $http.delete(url, config) + .then( res => { + $log.debug(galleryData.pics); + galleryData.pics.forEach((pic, index) => { + if (pic._id === picData._id) galleryData.pics.splice(index,1); + }); + + }) + .catch( err => { + console.error(err); + return $q.reject(err); + }); + }); + }; + return service; +} + diff --git a/lab-zachary/app/view/home/home-controller.js b/lab-zachary/app/view/home/home-controller.js index bcc10d2d..5c8fe4d1 100644 --- a/lab-zachary/app/view/home/home-controller.js +++ b/lab-zachary/app/view/home/home-controller.js @@ -13,6 +13,7 @@ function HomeController($log, $rootScope, galleryService) { galleryService.fetchGalleries() .then( galleries => { this.galleries = galleries; + this.currentGallery = galleries[0]; }); }; diff --git a/lab-zachary/app/view/home/home.html b/lab-zachary/app/view/home/home.html index 391fa6f5..d9e0531d 100644 --- a/lab-zachary/app/view/home/home.html +++ b/lab-zachary/app/view/home/home.html @@ -2,6 +2,11 @@

Galleries

    - +
+ + diff --git a/lab-zachary/package.json b/lab-zachary/package.json index ad674db1..66ed1cfb 100644 --- a/lab-zachary/package.json +++ b/lab-zachary/package.json @@ -30,6 +30,7 @@ "file-loader": "^0.10.1", "html-loader": "^0.4.5", "html-webpack-plugin": "^2.28.0", + "ng-file-upload": "^12.2.13", "node-sass": "^4.5.1", "pascalcase": "^0.1.1", "resolve-url-loader": "^2.0.2", @@ -40,6 +41,7 @@ "webpack": "^2.3.2" }, "devDependencies": { + "ng-file-upload": "^12.2.13", "webpack-dev-server": "^2.4.2" } } From 98f957b85fa58080a2662dcb4304f3b0ef56a69b Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Tue, 4 Apr 2017 21:27:50 -0700 Subject: [PATCH 17/23] added test, worked on delete-done function --- .../gallery/gallery-item/gallery-item.html | 2 +- .../gallery/gallery-item/gallery-item.js | 14 +-- .../gallery/upload-pic/upload-pic.js | 2 +- lab-zachary/app/view/home/home-controller.js | 6 +- lab-zachary/app/view/home/home.html | 6 +- .../{karma.config.js => karma.conf.js} | 14 +-- lab-zachary/package.json | 7 ++ lab-zachary/test/auth-service-test.js | 31 +++++++ lab-zachary/test/example-test.js | 7 ++ lab-zachary/test/gallery-service-test.js | 88 +++++++++++++++++++ 10 files changed, 160 insertions(+), 17 deletions(-) rename lab-zachary/{karma.config.js => karma.conf.js} (54%) create mode 100644 lab-zachary/test/auth-service-test.js create mode 100644 lab-zachary/test/example-test.js create mode 100644 lab-zachary/test/gallery-service-test.js diff --git a/lab-zachary/app/component/gallery/gallery-item/gallery-item.html b/lab-zachary/app/component/gallery/gallery-item/gallery-item.html index e764e43c..6c9fd462 100644 --- a/lab-zachary/app/component/gallery/gallery-item/gallery-item.html +++ b/lab-zachary/app/component/gallery/gallery-item/gallery-item.html @@ -21,4 +21,4 @@ ng-click="galleryItemCtrl.deleteGallery()">delete
-
\ No newline at end of file +
diff --git a/lab-zachary/app/component/gallery/gallery-item/gallery-item.js b/lab-zachary/app/component/gallery/gallery-item/gallery-item.js index b3a30b39..caf11829 100644 --- a/lab-zachary/app/component/gallery/gallery-item/gallery-item.js +++ b/lab-zachary/app/component/gallery/gallery-item/gallery-item.js @@ -4,32 +4,34 @@ require('./_gallery-item.scss'); module.exports = { template: require('./gallery-item.html'), - controller: ['$log', 'galleryService', GalleryItemController], + controller: ['$log', 'galleryService', GalleryItemController], controllerAs: 'galleryItemCtrl', bindings: { gallery: '<', - oldData: '<', + currentGallery: '=', + deleteDone: '&' } }; function GalleryItemController($log, galleryService) { $log.debug('GalleryItemController'); this.showEditGallery = false; + this.currentGallery = 'test'; this.editGallery = function() { this.oldData = angular.copy(this.gallery); this.showEditGallery = true; }; - this.deleteGallery = function() { + this.deleteGallery = () => { galleryService.deleteGallery(this.gallery._id) - .then( _gallery => { - $log.debug('gallery deleted:', _gallery ); + .then( () => { + $log.debug('gallery deleted:', this.currentGallery ); + this.deleteDone(); }) .catch( err => { $log.error( err); }); }; - } \ No newline at end of file diff --git a/lab-zachary/app/component/gallery/upload-pic/upload-pic.js b/lab-zachary/app/component/gallery/upload-pic/upload-pic.js index 0321d3fe..9765551d 100644 --- a/lab-zachary/app/component/gallery/upload-pic/upload-pic.js +++ b/lab-zachary/app/component/gallery/upload-pic/upload-pic.js @@ -24,4 +24,4 @@ function UploadPicController($log, picService) { this.pic.file = null; }); }; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lab-zachary/app/view/home/home-controller.js b/lab-zachary/app/view/home/home-controller.js index 5c8fe4d1..2b19a39f 100644 --- a/lab-zachary/app/view/home/home-controller.js +++ b/lab-zachary/app/view/home/home-controller.js @@ -17,7 +17,11 @@ function HomeController($log, $rootScope, galleryService) { }); }; - + this.galleryDeleteDone = function(gallery) { + if (this.currentGallery._id === gallery._id) { + this.currentGallery = null; + } + }; diff --git a/lab-zachary/app/view/home/home.html b/lab-zachary/app/view/home/home.html index d9e0531d..4b12072e 100644 --- a/lab-zachary/app/view/home/home.html +++ b/lab-zachary/app/view/home/home.html @@ -4,9 +4,9 @@

Galleries

    + current-gallery="homeCtrl.currentGallery" + delete-done="homeCtrl.galleryDeleteDone(homeCtrl.currentGallery)" + ng-click="homeCtrl.currentGallery=gallery">
- diff --git a/lab-zachary/karma.config.js b/lab-zachary/karma.conf.js similarity index 54% rename from lab-zachary/karma.config.js rename to lab-zachary/karma.conf.js index dfbc6e34..68281bae 100644 --- a/lab-zachary/karma.config.js +++ b/lab-zachary/karma.conf.js @@ -1,17 +1,21 @@ -const webpackConfig = require('./webpack.config.js'); +const webpack = require('./webpack.config.js'); +delete webpack.entry; module.exports = function(config) { config.set({ - webpack: webpackConfig, + webpack, basePath: '', frameworks: ['jasmine'], files: [ - 'test/**/*-test.js' + 'app/entry.js', + 'test/**/*-test.js', + 'node_modules/angular-mocks/angular-mocks.js' ], exclude: [ ], preprocessors: { - 'test/**/*-test.js': ['webpack'] + 'test/**/*-test.js': ['webpack'], + 'app/entry.js':['webpack'] }, reporters: ['mocha'], @@ -19,7 +23,7 @@ module.exports = function(config) { colors: true, logLevel: config.LOG_INFO, autoWatch: true, - browsers: ['PhantomJS'], + browsers: ['Chrome'], singleRun: false, concurrency: Infinity }); diff --git a/lab-zachary/package.json b/lab-zachary/package.json index 66ed1cfb..19eb8884 100644 --- a/lab-zachary/package.json +++ b/lab-zachary/package.json @@ -41,6 +41,13 @@ "webpack": "^2.3.2" }, "devDependencies": { + "angular-mocks": "^1.6.4", + "jasmine-core": "^2.5.2", + "karma": "^1.5.0", + "karma-chrome-launcher": "^2.0.0", + "karma-jasmine": "^1.1.0", + "karma-mocha-reporter": "^2.2.3", + "karma-webpack": "^2.0.3", "ng-file-upload": "^12.2.13", "webpack-dev-server": "^2.4.2" } diff --git a/lab-zachary/test/auth-service-test.js b/lab-zachary/test/auth-service-test.js new file mode 100644 index 00000000..e7e3a3b8 --- /dev/null +++ b/lab-zachary/test/auth-service-test.js @@ -0,0 +1,31 @@ +'use strict'; + +describe('Auth Service', function() { + + beforeEach(() => { + angular.mock.module('cfgram'); + angular.mock.inject(($rootScope, authService, $window, $httpBackend) => { + this.$window = $window; + this.$rootScope = $rootScope; + this.authService = authService; + this.$httpBackend = $httpBackend; + }); + }); + + describe('authService.getToken', () => { + it('should return a token', () => { + this.authService.token = null; + this.$window.localStorage.setItem('token', 'test token'); + + this.authService.getToken() + .then( token => { + expect(token).toEqual('test token'); + }) + .catch( err => { + expect(err).toEqual(null); + }); + + this.$rootScope.$apply(); + }); + }); +}); \ No newline at end of file diff --git a/lab-zachary/test/example-test.js b/lab-zachary/test/example-test.js new file mode 100644 index 00000000..f4fcce7c --- /dev/null +++ b/lab-zachary/test/example-test.js @@ -0,0 +1,7 @@ +'use strict'; + +describe('Example Test', function() { + it('should pass this test test', () => { + expect(true).toEqual(true); + }); +}); \ No newline at end of file diff --git a/lab-zachary/test/gallery-service-test.js b/lab-zachary/test/gallery-service-test.js new file mode 100644 index 00000000..f176b871 --- /dev/null +++ b/lab-zachary/test/gallery-service-test.js @@ -0,0 +1,88 @@ +'use strict'; + +describe('Gallery Service Test', function() { + + beforeEach(() => { + angular.mock.module('cfgram'); + angular.mock.inject(($rootScope, authService, galleryService, $window, $httpBackend) => { + this.$rootScope = $rootScope; + this.authService = authService; + this.galleryService = galleryService; + this.$window = $window; + this.$httpBackend = $httpBackend; + }); + }); + + describe('galleryService.createGallery()', () => { + it('should create a new gallery', () => { + let galleryData = { + name: 'example gallery', + desc: 'example description' + }; + + let headers = { + Authorization: 'Bearer test token', + Accept: 'application/json', + 'Content-Type': 'application/json' + }; + + this.$httpBackend.expectPOST('http://localhost:8000/api/gallery', galleryData, headers) + .respond(200, { + _id: '1234', + username: 'testuser', + name: galleryData.name, + desc: galleryData.desc, + pics: [] + }); + + this.galleryService.createGallery(galleryData); + this.$httpBackend.flush(); + this.$rootScope.$apply(); + }); + }); + + describe('galleryService.updateGallery()', () => { + it('should update an existing gallery', () => { + let galleryData = { + name: 'example updated gallery', + desc: 'example updated description', + _id: '12345' + }; + + let headers = { + Authorization: 'Bearer test token', + Accept: 'application/json', + 'Content-Type': 'application/json' + }; + + this.$httpBackend.expectPUT('http://localhost:8000/api/gallery/12345', galleryData, headers) + .respond(200, { + _id: '12345', + username: 'testuser', + name: galleryData.name, + desc: galleryData.desc, + pics: [] + }); + + this.galleryService.updateGallery(galleryData._id, galleryData); + this.$httpBackend.flush(); + this.$rootScope.$apply(); + }); + }); + + describe('galleryService.deleteGallery()', () => { + it('should delete a gallery', () => { + let headers = { + Authorization: 'Bearer test token', + Accept: 'application/json', + }; + + this.$httpBackend.expectDELETE('http://localhost:8000/api/gallery/1234', headers) + .respond(204); + + this.galleryService.deleteGallery('1234'); + this.$httpBackend.flush(); + this.$rootScope.$apply(); + }); + }); +}); \ No newline at end of file From a41598d0b4d203cef5132379bd1d11a2c30aa112 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Wed, 5 Apr 2017 22:03:04 -0700 Subject: [PATCH 18/23] added tests for gallery-edit and gallery-item components --- .../gallery/gallery-edit/gallery-edit.js | 14 +--- .../gallery/gallery-item/gallery-item.js | 7 +- lab-zachary/app/service/gallery-service.js | 4 +- lab-zachary/app/view/home/home.html | 2 +- .../test/gallery-edit-component-test.js | 75 +++++++++++++++++ .../test/gallery-item-component-test.js | 82 +++++++++++++++++++ 6 files changed, 165 insertions(+), 19 deletions(-) create mode 100644 lab-zachary/test/gallery-edit-component-test.js create mode 100644 lab-zachary/test/gallery-item-component-test.js diff --git a/lab-zachary/app/component/gallery/gallery-edit/gallery-edit.js b/lab-zachary/app/component/gallery/gallery-edit/gallery-edit.js index 5d231dc8..339723f9 100644 --- a/lab-zachary/app/component/gallery/gallery-edit/gallery-edit.js +++ b/lab-zachary/app/component/gallery/gallery-edit/gallery-edit.js @@ -15,25 +15,17 @@ module.exports = { function GalleryEditController($log, galleryService) { $log.debug('GalleryEditController'); - //this.galleries = galleryService.galleries; $log.debug(this.oldData, this); + this.cancelUpdate = function() { $log.debug(this.gallery); this.gallery = this.oldData; this.showEditGallery = false; - - - }; this.updateGallery = function() { $log.debug('GalleryEditController.updateGallery'); - galleryService.updateGallery(this.gallery._id, this.gallery) - .then( () => { - this.showEditGallery = false; - }) - .catch( err => { - $log.error(err); - }); + galleryService.updateGallery(this.gallery._id, this.gallery); + this.showEditGallery = false; }; } diff --git a/lab-zachary/app/component/gallery/gallery-item/gallery-item.js b/lab-zachary/app/component/gallery/gallery-item/gallery-item.js index caf11829..8b10b682 100644 --- a/lab-zachary/app/component/gallery/gallery-item/gallery-item.js +++ b/lab-zachary/app/component/gallery/gallery-item/gallery-item.js @@ -8,7 +8,6 @@ module.exports = { controllerAs: 'galleryItemCtrl', bindings: { gallery: '<', - currentGallery: '=', deleteDone: '&' } }; @@ -16,22 +15,22 @@ module.exports = { function GalleryItemController($log, galleryService) { $log.debug('GalleryItemController'); this.showEditGallery = false; - this.currentGallery = 'test'; this.editGallery = function() { this.oldData = angular.copy(this.gallery); this.showEditGallery = true; }; - this.deleteGallery = () => { + this.deleteGallery = function() { galleryService.deleteGallery(this.gallery._id) .then( () => { $log.debug('gallery deleted:', this.currentGallery ); - this.deleteDone(); + this.deleteDone(this.gallery); }) .catch( err => { $log.error( err); }); + return(this.gallery); }; } \ No newline at end of file diff --git a/lab-zachary/app/service/gallery-service.js b/lab-zachary/app/service/gallery-service.js index e5969c24..9952048b 100644 --- a/lab-zachary/app/service/gallery-service.js +++ b/lab-zachary/app/service/gallery-service.js @@ -79,9 +79,7 @@ function galleryService($log, $q, $http, authService) { }) .then( res => { $log.log('gallery updated:'); - // service.galleries.forEach( (_gallery, index) => { - // if (_gallery._id === galleryID) service.galleries[index] = res.data; - // }); + return res.data; }) .catch( err => { diff --git a/lab-zachary/app/view/home/home.html b/lab-zachary/app/view/home/home.html index 4b12072e..cb9a4c89 100644 --- a/lab-zachary/app/view/home/home.html +++ b/lab-zachary/app/view/home/home.html @@ -5,7 +5,7 @@

Galleries

diff --git a/lab-zachary/test/gallery-edit-component-test.js b/lab-zachary/test/gallery-edit-component-test.js new file mode 100644 index 00000000..36e26631 --- /dev/null +++ b/lab-zachary/test/gallery-edit-component-test.js @@ -0,0 +1,75 @@ +'use strict'; + +describe('Gallery Edit Controller', function() { + beforeEach( () => { + angular.mock.module('cfgram'); + angular.mock.inject(($rootScope, $componentController, $httpBackend) => { + this.$rootScope = $rootScope; + this.$componentController = $componentController; + this.$httpBackend = $httpBackend; + }); + }); + describe('galleryEditCtrl.cancelUpdate', () => { + it('should cancel a pending update and restore existing data',() => { + let mockBindings = { + gallery: {}, + oldData: { + _id: '12345', + name: 'test name', + desc: 'test description', + pics: [], + }, + showEditGallery: true + }; + let galleryEditCtrl = this.$componentController('galleryEdit', null, mockBindings); + + galleryEditCtrl.cancelUpdate(); + + expect(galleryEditCtrl.showEditGallery).toEqual(false); + expect(galleryEditCtrl.gallery).toEqual(mockBindings.oldData); + + this.$rootScope.$apply(); + }); + }); + describe('galleryEditCtrl.updateGallery', () => { + it('should update a gallery', () => { + let mockBindings = { + gallery: { + _id: '12345', + name: 'updated name', + desc: 'updated desc', + pics: [] + }, + showEditGallery: true + }; + + let url = 'http://localhost:8000/api/gallery/12345'; + let headers = { + 'Content-Type': 'application/json', + Accept: 'application/json', + Authorization: 'Bearer test token', + }; + + let galleryEditCtrl = this.$componentController('galleryEdit', null, mockBindings); + + this.$httpBackend.expectPUT(url, galleryEditCtrl.gallery, headers) + .respond(200, { + _id: '12345', + username: 'testuser', + name: mockBindings.gallery.name, + desc: mockBindings.gallery.desc, + pics: [] + }); + + galleryEditCtrl.updateGallery(); + expect(galleryEditCtrl.showEditGallery).toEqual(false); + + this.$httpBackend.flush(); + this.$rootScope.$apply(); + + }); + }); +}); + + + diff --git a/lab-zachary/test/gallery-item-component-test.js b/lab-zachary/test/gallery-item-component-test.js new file mode 100644 index 00000000..199b84fc --- /dev/null +++ b/lab-zachary/test/gallery-item-component-test.js @@ -0,0 +1,82 @@ +'use strict'; + +describe('Gallery Item Component', function(){ + beforeEach(() => { + angular.mock.module('cfgram'); + angular.mock.inject(($rootScope, $componentController, $httpBackend, authService) => { + this.$rootScope = $rootScope; + this.$componentController = $componentController; + this.$httpBackend = $httpBackend; + this.authService = authService; + }); + }); + + describe('galleryItemCtrl.delete()', () => { + it('should call deleteDone', () => { + let mockBindings = { + gallery: { + _id: '12345', + name: 'test name', + desc: 'test description', + pics: [], + }, + deleteDone: function(data){ + expect(data.galleryData._id).toEqual('12345'); + } + }; + + let galleryItemCtrl = this.$componentController('galleryItem', null, mockBindings); + galleryItemCtrl.deleteDone({galleryData: galleryItemCtrl.gallery}); + + this.$rootScope.$apply(); + }); + + it('should call deleteDone with gallery after galleryDelete', () => { + let url = 'http://localhost:8000/api/gallery/12345'; + let headers = { + Authorization: 'Bearer test token', + Accept: 'application/json' + }; + this.deleteDoneFired = false; + let mockBindings = { + gallery: { + _id: '12345', + name: 'test name', + desc: 'test description', + pics: [] + }, + deleteDone: function(data){ + expect(data._id).toEqual(mockBindings.gallery._id); + } + }; + + this.$httpBackend.expectDELETE(url, headers).respond(204); + + let galleryItemCtrl = this.$componentController('galleryItem', null, mockBindings); + + expect(galleryItemCtrl.deleteGallery()._id).toEqual(mockBindings.gallery._id); + + this.$httpBackend.flush(); + this.$rootScope.$apply(); + }); + }); + describe('galleryItemCtrl.editGallery', () => { + it('should trigger the edit state', () => { + let mockBindings = { + gallery: { + _id: '12345', + name: 'test name', + desc: 'test description', + pics: [] + } + }; + let galleryItemCtrl = this.$componentController('galleryItem', null, mockBindings); + + galleryItemCtrl.editGallery(); + + expect(galleryItemCtrl.showEditGallery).toEqual(true); + expect(galleryItemCtrl.oldData).toEqual(mockBindings.gallery); + }); + }); + +}); From 0f3448211c279fa87be7c8027880b7788ab85ae0 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Wed, 5 Apr 2017 22:04:37 -0700 Subject: [PATCH 19/23] tweaked test --- lab-zachary/test/gallery-item-component-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lab-zachary/test/gallery-item-component-test.js b/lab-zachary/test/gallery-item-component-test.js index 199b84fc..8af026cd 100644 --- a/lab-zachary/test/gallery-item-component-test.js +++ b/lab-zachary/test/gallery-item-component-test.js @@ -76,7 +76,7 @@ describe('Gallery Item Component', function(){ expect(galleryItemCtrl.showEditGallery).toEqual(true); expect(galleryItemCtrl.oldData).toEqual(mockBindings.gallery); + this.$rootScope.$apply(); }); }); - }); From 30036434d35cef0527f8a25600e427884ab9cd65 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Thu, 6 Apr 2017 12:44:02 -0700 Subject: [PATCH 20/23] one commit too many --- lab-zachary/app/entry.js | 2 ++ lab-zachary/app/scss/lib/base/_base.scss | 9 +++++++++ lab-zachary/assets/sprite.png | Bin 0 -> 9480 bytes 3 files changed, 11 insertions(+) create mode 100644 lab-zachary/assets/sprite.png diff --git a/lab-zachary/app/entry.js b/lab-zachary/app/entry.js index 37113887..fdd1d4a8 100644 --- a/lab-zachary/app/entry.js +++ b/lab-zachary/app/entry.js @@ -43,3 +43,5 @@ context.keys().forEach( key => { console.log('component:', key, name, module); cfgram.component(name, module); }); + + diff --git a/lab-zachary/app/scss/lib/base/_base.scss b/lab-zachary/app/scss/lib/base/_base.scss index e6c7a7c0..d00f6433 100644 --- a/lab-zachary/app/scss/lib/base/_base.scss +++ b/lab-zachary/app/scss/lib/base/_base.scss @@ -48,6 +48,15 @@ body{ width: 100%; // position: absolute; // bottom: 0px; + .social-icons{ + background: url('../../assets/sprite.png'); + .facebook{ + } + .twitter{ + } + .instagram{ + } + } } pre{ max-width:100%; diff --git a/lab-zachary/assets/sprite.png b/lab-zachary/assets/sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..da52623ba581d494ad2ae22afb257840cfb77fd1 GIT binary patch literal 9480 zcmaKSXCPeP*03C=_TFoqH_!Dn$w`<ZKI{3dD0m)%u;XZ^InfaLM>d4xA zxCz_-r4fd@d1AP+u;dh>p0@TbARjh6kR!xhp5s?X4+k5>L7u}@Qdd;hQx)U{c>?nS z8N&38>|rkUG7cPy3T$#vSqy+1$j6oq>gMY1EenFq;0432vVMfpz!(x0^5y6M@=#iiin| z{x#_zLS5beKdGDBf2h5E3_$;@@Bb6n+sNM&Bw_&a_IT}Oj|m)@^RFm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WQlsVw?~UqF!cthAnMpZhaoCpsTZ63r5Ke??SbI#nL}OWO zG`v>WYsdj!e^Lx9nk!|*Nis!5zTCMBiK*bkno~BIUibPw z=KZ}+t3Y9tKI5E?Go^sz90KZ+P(|vOGu{OF-)8{E>Y)sgTDye5{Tl1N28#ZWOFo&6 zma^`XE;21n;}%vd$zns*INi3})vDo!VqQt0@<|0hSVYH2kE>Bxt-tCRd(~lS9^E$W oTdvK_QVS-Mt&zM6!6v|h=A5qIr~l~p_uV8dbv?EBDmLN&2iwiVTL1t6 literal 0 HcmV?d00001 From 9be839bf91572741b9e5896b9c4ed701e8ac02c2 Mon Sep 17 00:00:00 2001 From: Zachary Crumbo Date: Thu, 6 Apr 2017 19:54:18 -0700 Subject: [PATCH 21/23] added fuzzy search directive, title case filter and orderby toggle --- .../gallery/gallery-item/gallery-item.html | 2 +- lab-zachary/app/directive/social-icons.html | 10 ++++++ lab-zachary/app/directive/social-icons.js | 31 ++++++++++++++++ lab-zachary/app/entry.js | 14 ++++++++ lab-zachary/app/filter/format/title-case.js | 12 +++++++ .../filter/gallery-search/gallery-search.js | 18 ++++++++++ lab-zachary/app/index.html | 7 ++-- lab-zachary/app/scss/lib/base/_base.scss | 33 +++++++++++++----- .../app/scss/lib/base/_global-vars.scss | 2 ++ lab-zachary/app/view/home/home-controller.js | 18 +++++++++- lab-zachary/app/view/home/home.html | 6 +++- lab-zachary/assets/sprite.png | Bin 9480 -> 8835 bytes lab-zachary/package.json | 1 + lab-zachary/webpack.config.js | 7 ++++ 14 files changed, 147 insertions(+), 14 deletions(-) create mode 100644 lab-zachary/app/directive/social-icons.html create mode 100644 lab-zachary/app/directive/social-icons.js create mode 100644 lab-zachary/app/filter/format/title-case.js create mode 100644 lab-zachary/app/filter/gallery-search/gallery-search.js diff --git a/lab-zachary/app/component/gallery/gallery-item/gallery-item.html b/lab-zachary/app/component/gallery/gallery-item/gallery-item.html index 6c9fd462..51830559 100644 --- a/lab-zachary/app/component/gallery/gallery-item/gallery-item.html +++ b/lab-zachary/app/component/gallery/gallery-item/gallery-item.html @@ -1,7 +1,7 @@