-
Notifications
You must be signed in to change notification settings - Fork 17
lab-davidw #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DavidGWheeler
wants to merge
6
commits into
codefellows-seattle-javascript-401d15:master
Choose a base branch
from
DavidGWheeler:debug
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
lab-davidw #7
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
23f47bd
add code ready for tests, style and debugging
DavidGWheeler 67fea53
url is stuck?
DavidGWheeler 6bb24e0
add progress on delete pic
DavidGWheeler b556fd9
add progress on delete pics
DavidGWheeler 88545ba
add Delete to pic-service dependencies
DavidGWheeler f02c3db
add demo tests
DavidGWheeler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
**/node_modules/* | ||
**/vendor/* | ||
**/*.min.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"rules": { | ||
"quotes": ["error", "single", { "allowTemplateLiterals": true }], | ||
"comma-dangle": ["error", "always-multiline"], | ||
"no-console": "off", | ||
"indent": [ "error", 2 ], | ||
"semi": ["error", "always"] | ||
}, | ||
"env": { | ||
"es6": true, | ||
"node": true, | ||
"mocha": true, | ||
"jasmine": true | ||
}, | ||
"globals": { | ||
"__API_URI__": false, | ||
"__DEBUG__": false | ||
}, | ||
"ecmaFeatures": { | ||
"modules": true, | ||
"experimentalObjectRestSpread": true, | ||
"impliedStrict": true | ||
}, | ||
"extends": "eslint:recommended" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# ignore db directorys | ||
db | ||
|
||
# Created by https://www.gitignore.io/api/linux,node,osx,vim | ||
|
||
### 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-* | ||
|
||
|
||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# 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 | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
|
||
### 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 | ||
|
||
|
||
### Vim ### | ||
# swap | ||
[._]*.s[a-w][a-z] | ||
[._]s[a-w][a-z] | ||
# session | ||
Session.vim | ||
# temporary | ||
.netrwhist | ||
*~ | ||
# auto-generated tag files | ||
tags | ||
|
||
# environment | ||
.env | ||
|
||
node_modules | ||
build/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# lab 31 Angular Image Uploads | ||
|
||
## Goal | ||
to build an auth service for our frontend app and hook it up to the slugram staging back-end, add a Gallery and logout. | ||
## How to use this app: | ||
Follow these steps for both the frontend and backend. | ||
1. Frontend: | ||
1. Download the repo: https://github.com/DavidGWheeler/27-angular-auth.git | ||
2. Add your .env file with the url target. For example: | ||
` | ||
API_URL=http:localhost:3000 | ||
` | ||
3. Install the package dependencies with node package manager: | ||
` | ||
$ npm install | ||
` | ||
4. Now you need to install the backend. | ||
|
||
2. Backend: | ||
1. Download: https://github.com/slugbyte/slugram-backend | ||
2. Add you .env file with the following paramaters: | ||
```Javascript | ||
MONGODB_URI='mongodb://localhost/cfgram-backend" | ||
NODE_ENV='testing' | ||
APP_SECRET='<yoursecret>' | ||
PORT=<your port> | ||
AWS_BUCKET='<your bucket name>' | ||
AWS_ACCESS_KEY_ID='<your access key>' | ||
AWS_SECRET_ACCESS_KEY='<your secret key>' | ||
``` | ||
|
||
3. Install the package dependencies with node package manager: | ||
` | ||
$ npm install | ||
` | ||
4. Run the server (with debug): | ||
` | ||
$ npm run start-debug | ||
` | ||
5. Run the server: | ||
` | ||
$ npm run start | ||
` | ||
6. Run the front end (with debug): | ||
` | ||
$ npm run build-watch | ||
` | ||
*-or- you can just build the web pack:* | ||
` | ||
$ npm run build | ||
` | ||
6. You can run tests with the following command: | ||
` | ||
$ npm run test | ||
` | ||
7. Open the website wherever you have it hosted. | ||
- locally hosted example url:` http://localhost:8080/ ` | ||
|
||
### From the front end: | ||
- You can Sign up for "cfGram", the app. | ||
- You will be taken to Home, upon sign up. | ||
- On subsequent visits, you can sign in, to be taken to home. | ||
- You can create a Gallery. | ||
- You can edit your Gallery name and description | ||
- You can logout, and will be taken to the login page. | ||
- add photos to an S3 bucket | ||
- and display the same images in the Gallery | ||
|
||
##### Upcoming features: | ||
- delete images from a gallery |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
lab-davidw/app/component/gallery/create-gallery/_create-gallery.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.btn-left { | ||
float: left; | ||
clear: right; | ||
} |
32 changes: 32 additions & 0 deletions
32
lab-davidw/app/component/gallery/create-gallery/create-gallery.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<section> | ||
<form name="createGalleryForm" | ||
ng-submit="createGalleryCtrl.createGallery()"> | ||
<fieldset> | ||
<label for="name">name</label> | ||
<input | ||
class="input-std" | ||
type="text" | ||
name="name" | ||
placeholder="name" | ||
ng-model="createGalleryCtrl.gallery.name" | ||
required> | ||
</fieldset> | ||
<fieldset> | ||
<label for="description">desc</label> | ||
<input | ||
class="input-std" | ||
type="text" | ||
name="desciption" | ||
placeholder="desciption" | ||
ng-model="createGalleryCtrl.gallery.desc" | ||
required> | ||
</fieldset> | ||
|
||
<button | ||
class="btn-left" | ||
type="submit" | ||
name="create gallery"> | ||
create gallery | ||
</button> | ||
</form> | ||
</section> |
33 changes: 33 additions & 0 deletions
33
lab-davidw/app/component/gallery/create-gallery/create-gallery.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use strict'; | ||
|
||
require('./_create-gallery.scss'); | ||
|
||
module.exports = { | ||
template: require('./create-gallery.html'), | ||
controllerAs: 'createGalleryCtrl', | ||
controller: [ | ||
'$log', | ||
'$rootScope', | ||
'galleryService', | ||
function($log, $rootScope, galleryService) { | ||
this.$onInit = () => { | ||
$log.debug('Create Gallery Controller'); | ||
this.gallery = {}; | ||
|
||
this.createGallery = () => { | ||
return galleryService.createGallery(this.gallery) | ||
.then( | ||
() => { | ||
let res = this.gallery; | ||
this.gallery.name = null; | ||
this.gallery.desc = null; | ||
$rootScope.$emit('newGalleryCreated'); | ||
return res; | ||
}, | ||
err => $log.error(err) | ||
); | ||
}; | ||
}; | ||
}, | ||
], | ||
}; |
Empty file.
17 changes: 17 additions & 0 deletions
17
lab-davidw/app/component/gallery/edit-gallery/edit-gallery.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<section> | ||
<form | ||
name="editGalleryForm" | ||
ng-submit="editGalleryCtrl.updateGallery()" | ||
novalidate> | ||
<fieldset> | ||
<label for="name">name</label> | ||
<input type="text" name="name" ng-model="editGalleryCtrl.gallery.name"> | ||
</fieldset> | ||
<fieldset> | ||
<label for="description">desc</label> | ||
<input type="text" name="description" ng-model="editGalleryCtrl.gallery.desc"> | ||
</fieldset> | ||
|
||
<button class="btn-std" type="submit" name="update">update</button> | ||
</form> | ||
</section> |
25 changes: 25 additions & 0 deletions
25
lab-davidw/app/component/gallery/edit-gallery/edit-gallery.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
template: require('./edit-gallery.html'), | ||
controllerAs: 'editGalleryCtrl', | ||
bindings: { | ||
gallery: '<', | ||
}, | ||
controller: [ | ||
'$log', | ||
'galleryService', | ||
function($log, galleryService) { | ||
this.$onInit = () => { | ||
$log.debug('Edit Gallery Controller'); | ||
this.updateGallery = () => { | ||
galleryService.updateGallery(this.gallery._id, this.gallery) | ||
.then( | ||
() => $log.log('updated succesfully'), | ||
err => $log.error(err) | ||
); | ||
}; | ||
}; | ||
}, | ||
], | ||
}; |
22 changes: 22 additions & 0 deletions
22
lab-davidw/app/component/gallery/gallery-item/_gallery-item.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.gallery-name { | ||
margin-top: 1em; | ||
float: left; | ||
clear: left; | ||
font-size: 2.75vh; | ||
} | ||
|
||
.gallery-desc { | ||
float: left; | ||
clear: left; | ||
font-size: 2.75vh; | ||
} | ||
|
||
.gallery-id { | ||
float: left; | ||
clear: left; | ||
font-size: 2.75vh; | ||
} | ||
|
||
li { | ||
list-style: none; | ||
} |
23 changes: 23 additions & 0 deletions
23
lab-davidw/app/component/gallery/gallery-item/gallery-item.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<li> | ||
<div ng-if="!galleryItemCtrl.showEditGallery"> | ||
<div> | ||
<span class="gallery-name"><strong>name:</strong> {{ galleryItemCtrl.gallery.name }}</span><br> | ||
<span class="gallery-desc"><strong>description:</strong> {{ galleryItemCtrl.gallery.desc }}</span><br> | ||
<span class="gallery-id"><strong> id:</strong> {{ galleryItemCtrl.gallery._id }}</span><br> | ||
</div> | ||
</div> | ||
|
||
<edit-gallery ng-if="galleryItemCtrl.showEditGallery" gallery="galleryItemCtrl.gallery"></edit-gallery> | ||
|
||
<button | ||
class="btn-std" | ||
name="edit" | ||
ng-click="galleryItemCtrl.showEditGallery = !galleryItemCtrl.showEditGallery">edit | ||
</button> | ||
|
||
<button | ||
class="btn-std" | ||
name="delete gallery" | ||
ng-click="galleryItemCtrl.deleteGallery()">delete gallery | ||
</button> | ||
</li> |
29 changes: 29 additions & 0 deletions
29
lab-davidw/app/component/gallery/gallery-item/gallery-item.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
require('./_gallery-item.scss'); | ||
|
||
module.exports = { | ||
template: require('./gallery-item.html'), | ||
controllerAs: 'galleryItemCtrl', | ||
bindings: { | ||
gallery: '<', | ||
}, | ||
controller: [ | ||
'$log', | ||
'galleryService', | ||
function($log, galleryService) { | ||
this.$onInit = () => { | ||
$log.debug('Gallery Item Controller'); | ||
|
||
this.showEditGallery = false; | ||
this.deleteGallery = () => { | ||
return galleryService.deleteGallery(this.gallery._id) | ||
.then( | ||
() => $log.log('deleted gallery succesfully'), | ||
err => $log.error(err) | ||
); | ||
}; | ||
}; | ||
}, | ||
], | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great ReadME!