Assorted fixed (#3332)

* Better error handling of failed file uploads.  Also improve formatting of modal dialog

* Readd app.js to the js build, fixes collapsing sidebar

* Update JS

* Fix font size.  We need to explicitly set the font size for the table because everywhere else that comes from bootstrap-tables
This commit is contained in:
Daniel Meltzer 2017-02-23 00:49:06 -06:00 committed by snipe
parent 381526e488
commit ad9470b6f8
12 changed files with 1590 additions and 189 deletions

View file

@ -79,8 +79,7 @@ class ImportController extends Controller
'files' => $results 'files' => $results
]; ];
} }
$results['error']=trans('general.feature_disabled'); return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.feature_disabled')), 500);
return $results;
} }
/** /**
* Processes the specified Import. * Processes the specified Import.

View file

@ -53,7 +53,8 @@ elixir(function(mix) {
bowerPath + '/iCheck/icheck.js', bowerPath + '/iCheck/icheck.js',
bowerPath + '/select2/dist/js/select2.full.js', bowerPath + '/select2/dist/js/select2.full.js',
bowerPath + '/ekko-lightbox/dist/ekko-lightbox.js', bowerPath + '/ekko-lightbox/dist/ekko-lightbox.js',
'snipeit.js' 'snipeit.js',
'app.js'
],'public/assets/js'); ],'public/assets/js');
mix.version(['assets/css/app.css','assets/js/all.js']); mix.version(['assets/css/app.css','assets/js/all.js']);

0
public/assets/css/app.css Normal file → Executable file
View file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

0
public/build/assets/css/app-97b46ba110.css Normal file → Executable file
View file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
{ {
"assets/css/app.css": "assets/css/app-97b46ba110.css", "assets/css/app.css": "assets/css/app-97b46ba110.css",
"assets/js/all.js": "assets/js/all-e871790407.js" "assets/js/all.js": "assets/js/all-cedefbcf04.js"
} }

View file

@ -691,11 +691,3 @@ function _init() {
}; };
})(jQuery); })(jQuery);
const app = new Vue({
el: '#app'
});

View file

@ -1,13 +1,16 @@
<style scoped> <style scoped>
td {
font-size: 14px;
}
</style> </style>
<template> <template>
<div> <div class="row">
<alert v-show="alert.visible" :alertType="alert.type" v-on:hide="alert.visible = false">{{ alert.message }}</alert> <alert v-show="alert.visible" :alertType="alert.type" v-on:hide="alert.visible = false">{{ alert.message }}</alert>
<errors :errors="importErrors"></errors> <errors :errors="importErrors"></errors>
<modal v-model="displayImportModal" effect="fade"> <modal v-model="displayImportModal" effect="fade">
<div slot="modal-header" class="modal-title">Import File:</div> <div slot="modal-header" class="modal-header">
<h4 class="modal-title">Import File:</h4>
</div>
<div slot="modal-body" class="modal-body"> <div slot="modal-body" class="modal-body">
<div class="dynamic-form-row"> <div class="dynamic-form-row">
<div class="col-md-4 col-xs-12"> <div class="col-md-4 col-xs-12">
@ -29,18 +32,16 @@
</div> </div>
</div> </div>
<div slot="modal-footer" class="modal-footer"> <div class="modal-footer" slot="modal-footer">
<div class="row">
<div class="alert alert-success col-md-5 col-md-offset-1" style="text-align:left" v-if="modal.statusText">{{ this.modal.statusText }}</div> <div class="alert alert-success col-md-5 col-md-offset-1" style="text-align:left" v-if="modal.statusText">{{ this.modal.statusText }}</div>
<button type="button" class="btn btn-default" @click="displayImportModal = false">Cancel</button> <button type="button" class="btn btn-default" @click="displayImportModal = false">Cancel</button>
<button type="submit" class="btn btn-primary" @click="postSave">Save</button> <button type="submit" class="btn btn-primary" @click="postSave">Process</button>
</div>
</div> </div>
</modal> </modal>
<div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="box"> <div class="box">
<div class="box-body"> <div class="box-body">
<div class="row">
<div class="col-md-3"> <div class="col-md-3">
<!-- The fileinput-button span is used to style the file input field as button --> <!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-info fileinput-button"> <span class="btn btn-info fileinput-button">
@ -58,6 +59,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<table class="table table-striped" id="upload-table"> <table class="table table-striped" id="upload-table">
@ -85,7 +87,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -155,7 +156,8 @@
}, },
fail(e, data) { fail(e, data) {
vm.progress.currentClass = "progress-bar-danger"; vm.progress.currentClass = "progress-bar-danger";
vm.progress.statusText = data.errorThrown; // Display any errors returned from the $.ajax()
vm.progress.statusText = data.jqXHR.responseJSON.messages;
} }
}) })
}, },
@ -187,6 +189,7 @@
}, },
postSave() { postSave() {
this.modal.statusText = "Processing...";
this.$http.post('/api/v1/imports/process/'+this.activeFile.id, { this.$http.post('/api/v1/imports/process/'+this.activeFile.id, {
'import-update': this.modal.update, 'import-update': this.modal.update,
'import-type': this.modal.importType 'import-type': this.modal.importType

File diff suppressed because one or more lines are too long