-
Notifications
You must be signed in to change notification settings - Fork 37
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
[#16] added attachment #22
Conversation
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.
In addition to the specific comments, the issue referenced specifically said we would address the attachments at a later time.
Please, if what you are working on doesn't match the issue create a new issue so the rest of the team can see what you are working on.
Also, I think we'll need to discuss how we will manage attachments:
- Are we going to continue with the zip file solution for HTML resources or would another method be better?
- Can we make any changes to the data structure to improve performance?
src/app/home/navigation.scss
Outdated
@@ -35,5 +35,9 @@ | |||
li:last-child a { | |||
border:none; | |||
} | |||
|
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.
Please remove the change on the following lines. It is not related to creating the add resources component.
|
||
onChange(event) { | ||
var files = event.target.files; | ||
this.upload_files.push( |
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.
We are only supporting one file upload with the function as written, so there is no need to save this as an array. It just complicates the code below with constant [0]
var filename = this.upload_files[0].name; | ||
var defaultOpts = {headers:headers,withCredentials:true}; | ||
|
||
this.couchService.post('/resources',{}).then( |
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.
Does it not work to post a resource with an attachment?
If possible, we should refactor this to only have one HTTP request.
src/app/home/navigation.component.ts
Outdated
@@ -7,7 +7,7 @@ import { Router } from '@angular/router'; | |||
selector:'main-navigation', | |||
template: ` | |||
<ul> | |||
<li *ngFor="let comp of components"><a [routerLink]="'/' + comp.link">{{comp.name.toUpperCase()}}</a></li> | |||
<li *ngFor="let comp of components"><a routerLinkActive="active-link" [routerLink]="'/' + comp.link">{{comp.name.toUpperCase()}}</a></li> |
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.
Please remove this change. It is not related to creating the add resources component.
src/app/shared/couchdb.service.ts
Outdated
|
||
|
||
//For Attachment files | ||
saveAttachment(db:string,data:any,content_type:any): Promise<any> { |
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.
This is an exact copy of the put method on the service. It is not necessary to add this, you can just use the put method.
In general, please do not add another method to the CouchService service. It is meant to be a quick wrapper for the basic HTTP requests to CouchDB.
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.
Ah, I see the slight difference with the content_type
parameter. Rather than mostly copy the put
method, the opts parameter for the put
method can be used to overwrite the header.
<div> | ||
{{message}} | ||
<ol> | ||
<li *ngFor="let attachment of attachments">{{_.keys(attachment.doc._attachments)[0]}}</li> |
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.
This looks like the only place you are using Underscore. The resource list won't be listing out attachments, so I don't think we need to add an entire library for this one function that we will be removing in the future.
.angular-cli.json
Outdated
@@ -24,7 +24,8 @@ | |||
], | |||
"scripts": [ | |||
"../node_modules/jquery/dist/jquery.min.js", | |||
"../node_modules/bootstrap/dist/js/bootstrap.min.js" | |||
"../node_modules/bootstrap/dist/js/bootstrap.min.js", | |||
"../node_modules/underscore/underscore-min.js" |
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.
See the other comment. I don't think we need to add Underscore at this time.
To make sure this keeps moving in the right direction, I went ahead and did some work on this today.
I think that covers it. |
@paulbert I think we need to define the type of audio and video . Since , html5 doesn't support all type of audio and video. |
Merging this so we can continue working on resources, but I'll create an issue so we can continue the discussion about video & audio support for HTML5 |
No description provided.