snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.92k stars 3.16k forks source link

Addition Bootstrap Table Configuration/Extensions not appearing #10081

Open canaanmerchant opened 3 years ago

canaanmerchant commented 3 years ago

Debug mode

Describe the bug

I'm trying to add the table-filter-control extension to my bootstrap tables but I cannot figure out how to include the scripts or verify that isn't the problem.

In Debug Mode I get the following error:

Unable to locate Mix file: /css/dist/bootstrap-table.css. (View: C:\inetpub\wwwroot\snipeit\resources\views\partials\bootstrap-table.blade.php) (View: C:\inetpub\wwwroot\snipeit\resources\views\partials\bootstrap-table.blade.php

Which I can see the css file in that path but maybe I'm missing something.

I'm still new to Laravel so using Mix is still a bit of a mystery though when I run npm run dev I don't see any errors related to the bootsrap-table.css.

Within my "Table" elements I set "data-filter-control="true"" and I see that in the console but no filter appears. I can set a filter type in the "th" element but I don't really see where those are created.

So two questions:

  1. How can I add filters into my columns?
  2. Why can't bootstrap-css be found in debug mode?

Reproduction steps

  1. In debug mode I can't even open any of the pages. It immediately throws an error
  2. Outside of debug the site appears the same before and after even as I follow this (https://examples.bootstrap-table.com/#extensions/filter-control.html) as close as I can.

Expected behavior

A column with a filter available . I can sort since that was enabled out of the box but any configuration I add does not appear

Screenshots

No response

Snipe-IT Version

v5.1.8 build 6148 (g3ca3de9e4)

Operating System

Windows

Web Server

IIS

PHP Version

7.4.22

Operating System

Windows

Browser

Chrome

Version

Version 93.0.4577.63 (Official Build) (64-bit)

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

Illuminate \ View \ ViewException (E_ERROR)
Unable to locate Mix file: /css/dist/all.css. (View: C:\inetpub\wwwroot\snipeit\resources\views\layouts\default.blade.php) (View: C:\inetpub\wwwroot\snipeit\resources\views\layouts\default.blade.php)
Previous exceptions
Unable to locate Mix file: /css/dist/all.css. (View: C:\inetpub\wwwroot\snipeit\resources\views\layouts\default.blade.php) (0)
Unable to locate Mix file: /css/dist/all.css. (0)

`
 <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
      <meta name="baseUrl" content="<?php echo e(url('/')); ?>/">

    <script nonce="<?php echo e(csrf_token()); ?>">
      window.Laravel = { csrfToken: '<?php echo e(csrf_token()); ?>' };
    </script>

    <link rel="stylesheet" href="<?php echo e(url(mix('css/dist/all.css'))); ?>">
    <?php if(($snipeSettings) && ($snipeSettings->allow_user_skin==1) && Auth::check() && Auth::user()->present()->skin != ''): ?>
        <link rel="stylesheet" href="<?php echo e(url(mix('css/dist/skins/skin-'.Auth::user()->present()->skin.'.min.css'))); ?>">
    <?php else: ?>
    <link rel="stylesheet" href="<?php echo e(url(mix('css/dist/skins/skin-'.($snipeSettings->skin!='' ? $snipeSettings->skin : 'blue').'.css'))); ?>">
    <?php endif; ?>

    <?php echo $__env->yieldPushContent('css'); ?>

    <?php if(($snipeSettings) && ($snipeSettings->header_color!='')): ?>
    <style nonce="<?php echo e(csrf_token()); ?>">
        .main-header .navbar, .main-header .logo {
            background-color: <?php echo e($snipeSettings->header_color); ?>;
            background: -webkit-linear-gradient(top,  <?php echo e($snipeSettings->header_color); ?> 0%,<?php echo e($snipeSettings->header_color); ?> 100%);
            background: linear-gradient(to bottom, <?php echo e($snipeSettings->header_color); ?> 0%,<?php echo e($snipeSettings->header_color); ?> 100%);
            border-color: <?php echo e($snipeSettings->header_color); ?>;
        }
        .skin-<?php echo e($snipeSettings->skin!='' ? $snipeSettings->skin : 'blue'); ?> .sidebar-menu > li:hover > a, .skin-<?php echo e($snipeSettings->skin!='' ? $snipeSettings->skin : 'blue'); ?> .sidebar-menu > li.active > a {
          border-left-color: <?php echo e($snipeSettings->header_color); ?>;
`

[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
gd
hash
iconv
json
ldap
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
Phar
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

Additional context

No response

welcome[bot] commented 3 years ago

πŸ‘‹ Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

canaanmerchant commented 3 years ago

Update:

Debug mode throws errors where it can't find several files in the out of the box mix file. I can go an comment out those scripts (including all.js and all.css) so the application technically runs but is practically useless because its missing important JS/CSS including no bootstrap-table at all

canaanmerchant commented 3 years ago

Yes, I can see the table-filter-control extension folder path in the project structure but adding that to the webpack.mix and running npm run dev causes the site to crash because the site can't find bootstrap-table.js at all