Skip to content

Commit

Permalink
Little fixes
Browse files Browse the repository at this point in the history
(and rebase)

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
  • Loading branch information
tcitworld committed Aug 6, 2018
1 parent a75de29 commit 55158ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions js/app/controllers/calcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
* Description: The fullcalendar controller.
*/

app.controller('CalController', ['$scope', 'Calendar', 'CalendarService', 'VEventService', 'SettingsService', 'TimezoneService', 'VEvent', 'is', 'fc', 'EventsEditorDialogService', 'PopoverPositioningUtility', '$window', 'isPublic', 'constants', 'settings', '$uibModal',
function ($scope, Calendar, CalendarService, VEventService, SettingsService, TimezoneService, VEvent, is, fc, EventsEditorDialogService, PopoverPositioningUtility, $window, isPublic, constants, settings) {
app.controller('CalController', ['$scope', 'Calendar', 'CalendarService', 'VEventService', 'SettingsService', 'TimezoneService', 'VEvent', 'is', 'fc', 'EventsEditorDialogService', 'PopoverPositioningUtility', '$window', 'isPublic', 'constants', 'settings', '$http', '$uibModal',
function ($scope, Calendar, CalendarService, VEventService, SettingsService, TimezoneService, VEvent, is, fc, EventsEditorDialogService, PopoverPositioningUtility, $window, isPublic, constants, settings, $http, $uibModal) {
'use strict';

is.loading = true;
Expand Down Expand Up @@ -153,9 +153,9 @@ app.controller('CalController', ['$scope', 'Calendar', 'CalendarService', 'VEven

$scope.importFileByPath = function(path) {
return $http.get(
OC.linkToRemoteBase('dav') + '/files/' + OC.getCurrentUser().displayName + '/' + decodeURI(path)
OC.linkToRemoteBase('dav') + '/files/' + OC.getCurrentUser().uid + '/' + decodeURIComponent(path)
).then(function(response) {
const fileName = decodeURIComponent(path);
const fileName = decodeURIComponent(decodeURI(path)).split('/').pop();
const fileBody = response.data;
let file = new File([fileBody], fileName, {type: 'text/calendar'});

Expand All @@ -173,6 +173,8 @@ app.controller('CalController', ['$scope', 'Calendar', 'CalendarService', 'VEven
},
scope: $scope
});
}).catch(function() {
OC.Notification.showTemporary(t('calendar', 'There was an issue while importing your calendar'));
});
};

Expand Down
2 changes: 1 addition & 1 deletion js/utility/registerUtility.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let register = (function () {
actionHandler: function(filename, context) {
let path = $('#fileList').find('[data-file="'+filename+'"]').data('path');
path = path.substring(1);
window.location = OC.generateUrl('apps/calendar/#/import/{filename}', {filename: encodeURI(path + '/' + filename)});
window.location = OC.generateUrl('apps/calendar/#/import/{filename}', {filename: encodeURIComponent(path + '/' + filename)});
},
permissions: OC.PERMISSION_READ,
icon: function () {
Expand Down
2 changes: 1 addition & 1 deletion templates/part.import.dialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<tbody>
<tr ng-repeat="file in files" ng-show="!file.done">
<td class="name">
<span>{{ file.file.name | limitTo:nameSize }}{{file.file.name.length < nameSize ? '' : '...'}}</span>
<span>{{ file.file.name | limitTo:nameSize }}{{ file.file.name.length < nameSize ? '' : '...' }}</span>
</td>
<td class="calendartype">
<span ng-show="file.wasCanceled()">
Expand Down

0 comments on commit 55158ae

Please sign in to comment.