Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 0c13178

Browse files
author
Parth Shah
committed
more fixes
1 parent a58d5a7 commit 0c13178

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

app/directives/tc-fp-file-input/tc-fp-file-input.directive.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import _ from 'lodash'
44
(function() {
55
'use strict'
66

7-
angular.module('tcUIComponents').directive('tcFpFileInput', ['CONSTANTS', 'logger', 'UserService', 'filepickerService', tcFPFileInput])
7+
angular.module('tcUIComponents').directive('tcFpFileInput', ['$rootScope', 'CONSTANTS', 'logger', 'UserService', 'filepickerService', tcFPFileInput])
88

9-
function tcFPFileInput(CONSTANTS, logger, UserService, filepickerService) {
9+
function tcFPFileInput($rootScope, CONSTANTS, logger, UserService, filepickerService) {
1010
return {
1111
restrict: 'E',
1212
require: '^form',
@@ -40,6 +40,7 @@ import _ from 'lodash'
4040

4141
// set default services
4242
scope.fpServices = scope.fpServices || "COMPUTER,GOOGLE_DRIVE,BOX,DROPBOX"
43+
scope.fpContainer = CONSTANTS.FILE_PICKER_SUBMISSION_CONTAINER_NAME || 'submission-staging-dev'
4344

4445
// set max size
4546
scope.maxSize = 500*1024*1024
@@ -50,7 +51,7 @@ import _ from 'lodash'
5051
*/
5152
element.bind('change', function(event) {
5253
event.preventDefault()
53-
scope.onSuccess({event: event.originalEvent || event});
54+
scope.onSuccess(event.originalEvent || event);
5455
$rootScope.$apply()
5556
});
5657
element = element.length ? element[0] : element;
@@ -60,15 +61,18 @@ import _ from 'lodash'
6061
}
6162
filepickerService.constructWidget(element)
6263

63-
scope.onSuccess = function (fpFile) {
64-
scope.ngModel = {
64+
scope.onSuccess = function (event) {
65+
debugger
66+
var fpFile = event.fpfile
67+
var _file = {
6568
name: scope.filename || fpFile.filename,
66-
container: fpFile.container,
69+
container: fpFile.container || scope.fpContainer,
6770
path: fpFile.key,
6871
size: fpFile.size,
6972
mimetype: fpFile.mimetype
7073
}
71-
scope.setFileReference({file: file, fieldId: scope.fieldId})
74+
scope.ngModel = _file
75+
scope.setFileReference({file: _file, fieldId: scope.fieldId})
7276
}
7377
}
7478
}

app/directives/tc-fp-file-input/tc-fp-file-input.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
data-fp-multiple="false",
1414
data-fp-extensions="{{extensions}}",
1515
data-fp-store-location="s3",
16+
data-fp-store-container="{{fpContainer}}",
1617
data-fp-store-path="{{filePath}}",
1718
on-success="onFileSeleted(event.fpfile)"
1819
)

app/submissions/submissions.module.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ import angular from 'angular'
1515
angular.module('tc.submissions', dependencies)
1616
.config(['filepickerProvider', 'CONSTANTS',
1717
function (filepickerProvider, CONSTANTS) {
18-
//CONSTANTS.FILE_PICKER_API_KEY
19-
filepickerProvider.setKey("AzFINuQoqTmqw0QEoaw9az")
18+
filepickerProvider.setKey(CONSTANTS.FILE_PICKER_API_KEY || 'AzFINuQoqTmqw0QEoaw9az')
2019
}
2120
])
2221

app/submissions/submit-design-files/submit-design-files.controller.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ import _ from 'lodash'
5050
},
5151
userId: userId,
5252
data: {
53-
method: challengeToSubmitTo.challenge.track.toUpperCase() + '_CHALLENGE_ZIP_FILE',
54-
55-
// Can delete below since they are processed and added later?
53+
method: 'DESIGN_CHALLENGE_FILE_PICKER_ZIP_FILE',
5654
files: [],
5755
submitterRank: 1,
5856
submitterComments: '',
@@ -149,7 +147,7 @@ import _ from 'lodash'
149147
}, [])
150148

151149
vm.submissionsBody.data.fonts = processedFonts
152-
150+
debugger
153151
SubmissionsService.startSubmission(vm.submissionsBody, updateProgress)
154152
.then(function(newSubmission) {
155153
logger.debug("New Submission: ", newSubmission)

0 commit comments

Comments
 (0)