Skip to content
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

Test/create folder #86

Open
wants to merge 73 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
f946b0b
Add style to allow word to be break and wrap
JamieHo3312 Apr 18, 2016
6230d9c
Update the style to place in the middle of the table
JamieHo3312 Apr 18, 2016
3b1c6e8
Remove angular-breadcrumb & implement breadcrumb component
Apr 21, 2016
2f1e1dc
Add base style for display property
JamieHo3312 Apr 21, 2016
d0227f2
Fix flexbox type layout issues in IE10
JamieHo3312 Apr 21, 2016
ce606a8
Add list item style for file list
JamieHo3312 Apr 21, 2016
ef3ccc9
Design file list
JamieHo3312 Apr 21, 2016
e7ad670
Change the accent theme grey to indigo
JamieHo3312 Apr 21, 2016
b17959d
Add File component
Apr 21, 2016
0a18a11
Remove angular-breadcrumb from source code
Apr 21, 2016
9ea4a82
Add click event to bucket component
Apr 22, 2016
dfb26b3
Add sample view & service to file component
Apr 22, 2016
3146d6e
Rename utils to services
Apr 25, 2016
e782e35
Move natural sotr function to utils for reusable
Apr 25, 2016
55f211c
Replace upload and create folder icon
JamieHo3312 Apr 26, 2016
dd78031
Add dialog-footer and list-dialog style
JamieHo3312 Apr 27, 2016
57bc03a
Add the ui of upload file
JamieHo3312 Apr 27, 2016
7f836dd
Real api call
May 6, 2016
745928e
Merge remote-tracking branch 'jamie/feature/design-file-list' into fe…
May 6, 2016
ad02be3
Bind controller properties to view
May 6, 2016
6fc82ff
Update $file service
May 6, 2016
635cf94
Merge branch 'dev' into feature/implement-breadcrumb
May 16, 2016
ce3cdb1
fix bug in action-navbar.html
May 16, 2016
46cf39a
Merge branch 'dev' into feature/files-list-component
May 16, 2016
b521b34
Merge branch 'feature/implement-breadcrumb' into feature/files-list-c…
May 16, 2016
6679b83
Update file module
May 16, 2016
0a58ba8
Add ng-file-upload to dependencies
May 16, 2016
a356e99
Merge remote-tracking branch 'jamie/feature/design-upload-form' into …
May 16, 2016
d11309a
Add fileUpload to vendor and remove angular-breadcrumb
May 17, 2016
6b3d4af
Add filesize filter for size format
May 17, 2016
f71b02c
Add align style for set the vertical alignment
JamieHo3312 May 17, 2016
4fc9ec7
Add style for highlight the messages
JamieHo3312 May 17, 2016
37cc662
Design transfer view
JamieHo3312 May 17, 2016
5bbc8af
Update file.html
May 18, 2016
3d1c5c6
Remove unnecessary state and dependence in file.service.js
May 18, 2016
d90dfd1
Add file upload component
May 18, 2016
0054bd7
Add sign out handler
May 18, 2016
30283b7
Add method to Upload button in action navbar
May 18, 2016
f024de0
Fix breadcrumb bar
May 18, 2016
36bc561
Merge remote-tracking branch 'jamie/feature/design-transfer' into fea…
May 18, 2016
b8f6cff
Add transfer UI & update layout component
May 18, 2016
f46b0b1
Add transfer service
May 18, 2016
cf833f4
Remove transfer import in components/index.js
May 18, 2016
c931e89
Use boolean to control upadting status
May 18, 2016
48fadf8
Move toal size method to utils
May 18, 2016
d26b84b
Update method name
May 18, 2016
89fac79
Refactor upload component
May 18, 2016
35d0104
Merge branch 'feature/files-upload-component' into feature/transfer-c…
May 18, 2016
c0a0904
Update TokenInterceptor for other error handler
May 19, 2016
c98ab5b
Complete transfer component
May 19, 2016
f5df9e0
Fix bugs of toast message
May 19, 2016
e6b383d
Add $file dependence to $transfer
May 19, 2016
891ea2d
Update transfers & properties button of action navbar
May 19, 2016
3b7d1e4
Update properties event in actions button of action navbar
May 19, 2016
c8a9133
Format the file list for handle download
May 19, 2016
dc36651
Fix bugs when response files is null
May 19, 2016
3881496
Keep the previous bucket length of breadcrumb
May 19, 2016
34c9390
Add file download method
May 19, 2016
61f2848
Fix bugs of paths property in upload service
May 19, 2016
a14c4ad
Rename folders to prefix and make it as string
May 20, 2016
b853db7
Use html5 download api to download file
May 20, 2016
cd3a9b1
Refactor file service
May 23, 2016
a3a9bde
Add error handler when the download file not exist
May 23, 2016
24dcf80
Fix bug when file size small than 1024 bytes
May 20, 2016
67bed8a
Fix bug when action navbar switch
May 20, 2016
1943d0e
Fix menu items of actions button
May 23, 2016
6598bb5
Initial the folder component
May 23, 2016
a2aa487
Add createFolder to folder service
May 23, 2016
0784947
Add folder support to file service
May 23, 2016
82eff42
Fix issue etag will be same string
May 25, 2016
3a8c75f
Merge branch 'feature/download-file-component' into feature/create-fo…
May 25, 2016
89fd0a4
The select item should be file that is downloadable
May 25, 2016
0180272
Add create folder component unit test
May 26, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update file module
Add method to breadcrumb for update the paths and update file
module. This commit can display bucket and files, but not yet
support display folder.

* add `updateFilePath` to $breadcrumb
* add necessary method call to file controller
  • Loading branch information
jigsawye committed May 16, 2016
commit 6679b8378cb3ff4e93fd65b9912c4350894a7348
11 changes: 8 additions & 3 deletions src/components/file/file.controller.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
export default class FileController {
/** @ngInject */
constructor($scope, $stateParams, $file) {
constructor($scope, $stateParams, $file, $bucket, $breadcrumb) {
Object.assign(this, {
$scope, $file,
$scope, $file, $bucket, $breadcrumb,
});

this.$scope.$watch(
() => $file.state.lists,
newVal => Object.assign(this, newVal)
, true);

this.$file.setPaths($stateParams.path);
const [bucket, ...folders] = $stateParams.path.split('/');

this.$file.setPaths(bucket, folders);
this.$breadcrumb.updateFilePath(folders);

this.$bucket.getBuckets();
this.$file.getFiles();
}
}
1 change: 1 addition & 0 deletions src/components/file/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const route = $stateProvider => {
controller: FileController,
controllerAs: 'file',
template: FileTemplate,
onEnter: $nav => $nav.setTypeToFile(),
});
};

Expand Down
8 changes: 5 additions & 3 deletions src/components/file/file.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@ export default class FileService {
};
}

setPaths(path) {
const [bucket, ...folders] = path.split('/');
setPaths(bucket, folders) {
this.paths = { bucket, folders };
}

getFiles() {
const { bucket, folders } = this.paths;
const endpoint = `/v1/file/list/${bucket}?prefix=${folders.join('/')}`;

this.state.lists.requesting = true;
this.state.lists.data = [];

this.$fetch
.get(`/v1/file/list/${this.paths.bucket}?prefix=${this.paths.folders.join('/')}`)
.get(endpoint)
.then(({ data }) => {
this.state.lists.error = false;
this.state.lists.data = data.files || [];
Expand Down
26 changes: 26 additions & 0 deletions src/components/layout/breadcrumb/breadcrumb.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ export default class BreadcrumbService {
this.initPaths();
}

/**
* Initial the paths state.
*
* @return {void}
*/
initPaths() {
this.paths = [{
link: '/bucket',
Expand All @@ -13,7 +18,28 @@ export default class BreadcrumbService {
}];
}

/**
* Update the files length of bucket.
*
* @param {integer} len
*
* @return {void}
*/
updateBucketPath(len) {
this.paths[0].len = len;
}

/**
* Update paths in breadcrumb bar.
*
* @param {Array} paths
*
* @return {void}
*/
updateFilePath(paths) {
paths.forEach(path => {
const pathLink = this.paths.map(({ link }) => link).join('');
this.paths.push({ link: pathLink, text: path });
});
}
}