-
Notifications
You must be signed in to change notification settings - Fork 15
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
#1017 #864 Users should be able to rename and move files #41
base: master
Are you sure you want to change the base?
#1017 #864 Users should be able to rename and move files #41
Conversation
interface.html
Outdated
|
||
<template id="template-move-modal-folders"> | ||
\{{#if (gt children.length 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.
please use indentation with spaces as follows:
<li foo
bar
baz>
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.
fixed
interface.html
Outdated
<ul class="move-modal-list"> | ||
</ul> | ||
<div class="move-modal-empty-state"> | ||
<span>😳</span> |
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.
HTML Entity is missing semicolon:
😳
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.
fixed
js/interface.js
Outdated
@@ -21,12 +25,15 @@ var currentAppId; | |||
var currentFolders; | |||
var currentFiles; | |||
var counterOrganization; | |||
var foldersForMoving = {}; |
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.
var foldersForMoving = { navStack: [] };
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.
fixed
js/interface.js
Outdated
|
||
// Users selected folders tree (for breadcrumbs) | ||
function addPathToStack(id, name, orgId, appId, parentId, type) { | ||
foldersForMoving['navStack'].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.
indentation needs to be fixed:
array.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.
fixed
js/interface.js
Outdated
function addPathToStack(id, name, orgId, appId, parentId, type) { | ||
foldersForMoving['navStack'].push( | ||
{ | ||
id: Number(id)?Number(id):null, |
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.
Have you read the code guidelines? It should be a ? b : c
(note the spaces)
Note: you can also change this operation to Number(id) || null
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.
fixed
js/interface.js
Outdated
Fliplet.Media.Folders.create(options).then(addFolder); | ||
|
||
$('.new-btn').click(); | ||
console.log('lastFolderSelected', lastFolderSelected) |
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.
console.log to be removed
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.
fixed
js/interface.js
Outdated
$('.new-btn').click(); | ||
console.log('lastFolderSelected', lastFolderSelected) | ||
Fliplet.Media.Folders.create(options).then( function (folder) { | ||
if (!isCreatingInModal) { |
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.
looks like these two IFs should be combined into a single block
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.
fixed
js/interface.js
Outdated
$('.move-modal-empty-state').removeClass('active'); | ||
$('[data-move-button]').attr('disabled'); | ||
foldersForMoving['navStack'] = []; | ||
var type = $(this).find(":selected").attr('data-type'); |
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 stick to single quotes whenever possible
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.
fixed
js/interface.js
Outdated
$(this).attr('data-org-id'), | ||
$(this).attr('data-app-id'), | ||
$(this).attr('data-parent-id'), | ||
'folder'); |
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.
closing bracket should be on new line without indentation:
foo(
1,
2
);
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.
fixed
js/interface.js
Outdated
folderId = null; | ||
} | ||
|
||
appId = appId ? appId : null; |
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.
use ternary operator: appId = appId || null;
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.
fixed
js/interface.js
Outdated
function excludeFolders(items) { | ||
var parentItemIdOfSelectedItems = navStack[navStack.length-1].id; | ||
var selectedIdPlaceInModal = foldersForMoving.navStack[foldersForMoving.navStack.length-1].id; | ||
var searchResult = items; |
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.
Result is singular, but you're assigning a variable called items (plural). Which is correct?
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.
fixed to plural name
} | ||
|
||
return searchResult; | ||
|
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.
why this empty space?
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.
fixed
js/interface.js
Outdated
} | ||
|
||
// Create list of folders in modal | ||
function addFoldersToMoveModal(res) { |
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.
what's "res"? can you rename it to something more meaningful?
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.
fixed
@@ -653,7 +890,7 @@ $('.file-manager-wrapper') | |||
if (!folderName) { | |||
return; | |||
} | |||
|
|||
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.
Empty lines should be completely empty, without spaces
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.
fixed
interface.html
Outdated
data-org-id="\{{organizationId}}" | ||
data-app-id="\{{appId}}" | ||
data-parent-id="\{{parentId}}" | ||
> |
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.
>
should be on the previous line as per my previous comment
for (var i = 0; i < selectedIdForMoving.length; i++) { | ||
return item.id !== selectedIdForMoving[i]; | ||
} | ||
}) |
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.
missing semicolon
js/interface.js
Outdated
) | ||
} | ||
|
||
updateMethod.then(function() { |
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 add a .catch
…emicolon, 2) added catch for search method, 3) fixed html structure
…and-move-files # Conflicts: # css/interface.css # js/interface.js
@leraradinovich PR has conflicts and not all of my review notes were fixed. |
@squallstar