Skip to content

Commit

Permalink
Merge pull request #64 from heyday/master
Browse files Browse the repository at this point in the history
BUGFIX: Error on closing if no file selected Fixes #50
  • Loading branch information
Aaron Carlino authored Sep 28, 2016
2 parents d442cae + 5f217fe commit b61fb84
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "unclecheese/silverstripe-kickassets",
"name": "heyday/silverstripe-kickassets",
"description": "Provides an alternative file management interface for SilverStripe CMS with drag-and-drop, multi-selection, and several other desktop-like UI conventions.",
"type": "silverstripe-module",
"keywords": ["silverstripe", "assets", "files", "AssetAdmin", "upload"],
Expand Down
4 changes: 3 additions & 1 deletion javascript/build/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -54783,7 +54783,9 @@

var error = undefined;

if (!_storesSelectedItemsStore2['default'].isValidCount()) {
if (items.length === 0) {
error = (0, _utilsLang.sf)((0, _utilsLang2['default'])('KickAssets.NOFILESELECTED', "You haven't selected any file."));
} else if (!_storesSelectedItemsStore2['default'].isValidCount()) {
error = (0, _utilsLang.sf)((0, _utilsLang2['default'])('KickAssets.TOOMANYSELECTED', 'You have selected too many items. Please select no more than %s.'), max);
} else if (!_storesSelectedItemsStore2['default'].isValidTypes()) {
error = (0, _utilsLang.sf)((0, _utilsLang2['default'])('KickAssets.INVALIDTYPESSELECTED', 'You have selected some invalid items. Please select only %s'), types.join(', '));
Expand Down
6 changes: 3 additions & 3 deletions javascript/build/bundle.min.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion javascript/src/containers/SelectionButtonContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ const SelectionButtonContainer = React.createClass({

let error;

if(!SelectedItemsStore.isValidCount()) {
if(items.length === 0) {
error = sf(_t(
'KickAssets.NOFILESELECTED',
"You haven't selected any file."));
}

else if(!SelectedItemsStore.isValidCount()) {
error = sf(_t(
'KickAssets.TOOMANYSELECTED',
'You have selected too many items. Please select no more than %s.'
Expand Down
3 changes: 2 additions & 1 deletion lang/da.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ else {
'KickAssets.DONE': 'Færdig',
'KickAssets.TOOMANYSELECTED': 'Du har valgt for mange filer. Vælg ikke flere end %s.',
'KickAssets.INVALIDTYPESSELECTED': 'Du har valgt nogle ugyldige filer. Vælg kun %s',
'KickAssets.INVALIDEXTENSIONSSELECTED': 'Du har valgt nogle filer med ugyldige filtypenavne. Vælg kun %s'
'KickAssets.INVALIDEXTENSIONSSELECTED': 'Du har valgt nogle filer med ugyldige filtypenavne. Vælg kun %s',
'KickAssets.NOFILESELECTED': 'Du har ikke valgt nogen fil.'
});
}
3 changes: 2 additions & 1 deletion lang/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ else {
'KickAssets.DONE': 'Fertig',
'KickAssets.TOOMANYSELECTED': 'Die haben zu viele Objekte ausgewählt. Bitte nicht mehr %s auswählen.',
'KickAssets.INVALIDTYPESSELECTED': 'Sie haben ungültige Objekte ausgewählt. Bitte nur %s auswählen.',
'KickAssets.INVALIDEXTENSIONSSELECTED': 'Sie haben Dateien mit ungültiger Dateienamenrweiterung ausgewählt. Bitte nur %s auswählen.'
'KickAssets.INVALIDEXTENSIONSSELECTED': 'Sie haben Dateien mit ungültiger Dateienamenrweiterung ausgewählt. Bitte nur %s auswählen.',
'KickAssets.NOFILESELECTED': 'Sie haben keine Datei ausgewählt.'
});
}

0 comments on commit b61fb84

Please sign in to comment.