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

#1017 #864 Users should be able to rename and move files #41

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

leraradinovich
Copy link
Contributor

interface.html Outdated

<template id="template-move-modal-folders">
\{{#if (gt children.length 0)}}
<li
Copy link
Contributor

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>

Copy link
Contributor Author

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>&#x1F633</span>
Copy link
Contributor

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:

&#x1F633;

Copy link
Contributor Author

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 = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var foldersForMoving = { navStack: [] };

Copy link
Contributor Author

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(
Copy link
Contributor

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({

});

Copy link
Contributor Author

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,
Copy link
Contributor

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

Copy link
Contributor Author

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)
Copy link
Contributor

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

Copy link
Contributor Author

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) {
Copy link
Contributor

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

Copy link
Contributor Author

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');
Copy link
Contributor

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

Copy link
Contributor Author

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');
Copy link
Contributor

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
);

Copy link
Contributor Author

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;
Copy link
Contributor

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;

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this empty space?

Copy link
Contributor Author

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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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;
}

Copy link
Contributor

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

Copy link
Contributor Author

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}}"
>
Copy link
Contributor

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];
}
})
Copy link
Contributor

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() {
Copy link
Contributor

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
@squallstar
Copy link
Contributor

@leraradinovich PR has conflicts and not all of my review notes were fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants