Browse Source

WIP. Merge

master
Orzu Ionut 3 years ago
parent
commit
d93dbd64d9
  1. 5
      README.md
  2. 7
      app/Providers/AppServiceProvider.php
  3. 280
      package-lock.json
  4. 1
      package.json
  5. 1342
      public/js/app.js
  6. 11
      public/js/app.js.LICENSE.txt
  7. 1
      public/js/mitt.es.js.map
  8. 4
      resources/js/app.ts
  9. 15
      resources/js/components/Home/Home.ts
  10. 1
      resources/js/components/Home/Home.vue
  11. 53
      resources/js/components/ProcessFile/ProcessFile.ts
  12. 49
      resources/js/components/ProcessFile/ProcessFile.vue
  13. 35
      resources/js/components/layout/Header.vue

5
README.md

@ -62,6 +62,11 @@ the searchers in the first row independently, each column extending the searchin
Then the second row will be applied on the results of the first row, so on the email addresses and the text strings
which have a leading '#' character, basically each row filters the results of the previous row.
# Demo Version
Is available here https://demo.searchanddisplace.com/
No authentication is required.
# Demo Steps
- Select and upload a document file (supported files: .docx, .pdf, .odt, .txt)
- After the file is uploaded and processed you will see it's contents on the page

7
app/Providers/AppServiceProvider.php

@ -3,6 +3,7 @@
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\UrlGenerator;
class AppServiceProvider extends ServiceProvider
{
@ -21,8 +22,10 @@ class AppServiceProvider extends ServiceProvider
*
* @return void
*/
public function boot()
public function boot(UrlGenerator $url)
{
//
if (env('APP_ENV') !== 'local') {
$url->forceScheme('https');
}
}
}

280
package-lock.json

@ -12,9 +12,9 @@
}
},
"@babel/compat-data": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.0.tgz",
"integrity": "sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q==",
"version": "7.14.4",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.4.tgz",
"integrity": "sha512-i2wXrWQNkH6JplJQGn3Rd2I4Pij8GdHkXwHMxm+zV5YG/Jci+bCNrWZEWC4o+umiDkRrRs4dVzH3X4GP7vyjQQ==",
"dev": true
},
"@babel/core": {
@ -71,28 +71,28 @@
}
},
"@babel/helper-compilation-targets": {
"version": "7.13.16",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz",
"integrity": "sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA==",
"version": "7.14.4",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.4.tgz",
"integrity": "sha512-JgdzOYZ/qGaKTVkn5qEDV/SXAh8KcyUVkCoSWGN8T3bwrgd6m+/dJa2kVGi6RJYJgEYPBdZ84BZp9dUjNWkBaA==",
"dev": true,
"requires": {
"@babel/compat-data": "^7.13.15",
"@babel/compat-data": "^7.14.4",
"@babel/helper-validator-option": "^7.12.17",
"browserslist": "^4.14.5",
"browserslist": "^4.16.6",
"semver": "^6.3.0"
}
},
"@babel/helper-create-class-features-plugin": {
"version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.3.tgz",
"integrity": "sha512-BnEfi5+6J2Lte9LeiL6TxLWdIlEv9Woacc1qXzXBgbikcOzMRM2Oya5XGg/f/ngotv1ej2A/b+3iJH8wbS1+lQ==",
"version": "7.14.4",
"resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.4.tgz",
"integrity": "sha512-idr3pthFlDCpV+p/rMgGLGYIVtazeatrSOQk8YzO2pAepIjQhCN3myeihVg58ax2bbbGK9PUE1reFi7axOYIOw==",
"dev": true,
"requires": {
"@babel/helper-annotate-as-pure": "^7.12.13",
"@babel/helper-function-name": "^7.14.2",
"@babel/helper-member-expression-to-functions": "^7.13.12",
"@babel/helper-optimise-call-expression": "^7.12.13",
"@babel/helper-replace-supers": "^7.14.3",
"@babel/helper-replace-supers": "^7.14.4",
"@babel/helper-split-export-declaration": "^7.12.13"
}
},
@ -222,15 +222,15 @@
}
},
"@babel/helper-replace-supers": {
"version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.3.tgz",
"integrity": "sha512-Rlh8qEWZSTfdz+tgNV/N4gz1a0TMNwCUcENhMjHTHKp3LseYH5Jha0NSlyTQWMnjbYcwFt+bqAMqSLHVXkQ6UA==",
"version": "7.14.4",
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.4.tgz",
"integrity": "sha512-zZ7uHCWlxfEAAOVDYQpEf/uyi1dmeC7fX4nCf2iz9drnCwi1zvwXL3HwWWNXUQEJ1k23yVn3VbddiI9iJEXaTQ==",
"dev": true,
"requires": {
"@babel/helper-member-expression-to-functions": "^7.13.12",
"@babel/helper-optimise-call-expression": "^7.12.13",
"@babel/traverse": "^7.14.2",
"@babel/types": "^7.14.2"
"@babel/types": "^7.14.4"
}
},
"@babel/helper-simple-access": {
@ -307,9 +307,9 @@
}
},
"@babel/parser": {
"version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.3.tgz",
"integrity": "sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ==",
"version": "7.14.4",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz",
"integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==",
"dev": true
},
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": {
@ -427,13 +427,13 @@
}
},
"@babel/plugin-proposal-object-rest-spread": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.2.tgz",
"integrity": "sha512-hBIQFxwZi8GIp934+nj5uV31mqclC1aYDhctDu5khTi9PCCUOczyy0b34W0oE9U/eJXiqQaKyVsmjeagOaSlbw==",
"version": "7.14.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.4.tgz",
"integrity": "sha512-AYosOWBlyyXEagrPRfLJ1enStufsr7D1+ddpj8OLi9k7B6+NdZ0t/9V7Fh+wJ4g2Jol8z2JkgczYqtWrZd4vbA==",
"dev": true,
"requires": {
"@babel/compat-data": "^7.14.0",
"@babel/helper-compilation-targets": "^7.13.16",
"@babel/compat-data": "^7.14.4",
"@babel/helper-compilation-targets": "^7.14.4",
"@babel/helper-plugin-utils": "^7.13.0",
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-parameters": "^7.14.2"
@ -666,25 +666,25 @@
}
},
"@babel/plugin-transform-block-scoping": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.2.tgz",
"integrity": "sha512-neZZcP19NugZZqNwMTH+KoBjx5WyvESPSIOQb4JHpfd+zPfqcH65RMu5xJju5+6q/Y2VzYrleQTr+b6METyyxg==",
"version": "7.14.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.4.tgz",
"integrity": "sha512-5KdpkGxsZlTk+fPleDtGKsA+pon28+ptYmMO8GBSa5fHERCJWAzj50uAfCKBqq42HO+Zot6JF1x37CRprwmN4g==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.13.0"
}
},
"@babel/plugin-transform-classes": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.2.tgz",
"integrity": "sha512-7oafAVcucHquA/VZCsXv/gmuiHeYd64UJyyTYU+MPfNu0KeNlxw06IeENBO8bJjXVbolu+j1MM5aKQtH1OMCNg==",
"version": "7.14.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.4.tgz",
"integrity": "sha512-p73t31SIj6y94RDVX57rafVjttNr8MvKEgs5YFatNB/xC68zM3pyosuOEcQmYsYlyQaGY9R7rAULVRcat5FKJQ==",
"dev": true,
"requires": {
"@babel/helper-annotate-as-pure": "^7.12.13",
"@babel/helper-function-name": "^7.14.2",
"@babel/helper-optimise-call-expression": "^7.12.13",
"@babel/helper-plugin-utils": "^7.13.0",
"@babel/helper-replace-supers": "^7.13.12",
"@babel/helper-replace-supers": "^7.14.4",
"@babel/helper-split-export-declaration": "^7.12.13",
"globals": "^11.1.0"
}
@ -699,9 +699,9 @@
}
},
"@babel/plugin-transform-destructuring": {
"version": "7.13.17",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.17.tgz",
"integrity": "sha512-UAUqiLv+uRLO+xuBKKMEpC+t7YRNVRqBsWWq1yKXbBZBje/t3IXCiSinZhjn/DC3qzBfICeYd2EFGEbHsh5RLA==",
"version": "7.14.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.4.tgz",
"integrity": "sha512-JyywKreTCGTUsL1OKu1A3ms/R1sTP0WxbpXlALeGzF53eB3bxtNkYdMj9SDgK7g6ImPy76J5oYYKoTtQImlhQA==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.13.0"
@ -1081,9 +1081,9 @@
}
},
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.4",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.4.tgz",
"integrity": "sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
@ -1435,9 +1435,9 @@
}
},
"@types/eslint": {
"version": "7.2.11",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.11.tgz",
"integrity": "sha512-WYhv//5K8kQtsSc9F1Kn2vHzhYor6KpwPbARH7hwYe3C3ETD0EVx/3P5qQybUoaBEuUa9f/02JjBiXFWalYUmw==",
"version": "7.2.13",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.13.tgz",
"integrity": "sha512-LKmQCWAlnVHvvXq4oasNUMTJJb2GwSyTY8+1C7OH5ILR8mPLaljv1jxL1bXW3xB3jFbQxTKxJAvI8PyjB09aBg==",
"dev": true,
"requires": {
"@types/estree": "*",
@ -1592,9 +1592,9 @@
"dev": true
},
"@types/node": {
"version": "15.6.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-15.6.1.tgz",
"integrity": "sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA==",
"version": "15.9.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-15.9.0.tgz",
"integrity": "sha512-AR1Vq1Ei1GaA5FjKL5PBqblTZsL5M+monvGSZwe6sSIdGiuu7Xr/pNwWJY+0ZQuN8AapD/XMB5IzBAyYRFbocA==",
"dev": true
},
"@types/normalize-package-data": {
@ -5006,9 +5006,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001230",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz",
"integrity": "sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ==",
"version": "1.0.30001233",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001233.tgz",
"integrity": "sha512-BmkbxLfStqiPA7IEzQpIk0UFZFf3A4E6fzjPJ6OR+bFC2L8ES9J8zGA/asoi47p8XDVkev+WJo2I2Nc8c/34Yg==",
"dev": true
},
"case-sensitive-paths-webpack-plugin": {
@ -5086,9 +5086,9 @@
"dev": true
},
"ci-info": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.1.1.tgz",
"integrity": "sha512-kdRWLBIJwdsYJWYJFtAFFYxybguqeF91qpZaggjG5Nf8QKdizFG2hjqvaTXbxFIcYbSaD74KpAXv6BSm17DHEQ==",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.2.0.tgz",
"integrity": "sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A==",
"dev": true
},
"cipher-base": {
@ -5783,9 +5783,9 @@
"dev": true
},
"core-js-compat": {
"version": "3.13.0",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.13.0.tgz",
"integrity": "sha512-jhbI2zpVskgfDC9mGRaDo1gagd0E0i/kYW0+WvibL/rafEHKAHO653hEXIxJHqRlRLITluXtRH3AGTL5qJmifQ==",
"version": "3.13.1",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.13.1.tgz",
"integrity": "sha512-mdrcxc0WznfRd8ZicEZh1qVeJ2mu6bwQFh8YVUK48friy/FOwFV5EJj9/dlh+nMQ74YusdVfBFDuomKgUspxWQ==",
"dev": true,
"requires": {
"browserslist": "^4.16.6",
@ -6783,9 +6783,9 @@
"dev": true
},
"electron-to-chromium": {
"version": "1.3.739",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.739.tgz",
"integrity": "sha512-+LPJVRsN7hGZ9EIUUiWCpO7l4E3qBYHNadazlucBfsXBbccDFNKUBAgzE68FnkWGJPwD/AfKhSzL+G+Iqb8A4A==",
"version": "1.3.744",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.744.tgz",
"integrity": "sha512-o/vep/PvSXg+7buwCbVJXHY3zbjYVmFPwnMMnchESXgAzrfcasvbX/hQZHCFGG7YdZgdtwt1KTMyK9CyBxPbLA==",
"dev": true
},
"elliptic": {
@ -6889,9 +6889,9 @@
}
},
"es-abstract": {
"version": "1.18.2",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.2.tgz",
"integrity": "sha512-byRiNIQXE6HWNySaU6JohoNXzYgbBjztwFnBLUTiJmWXjaU9bSq3urQLUlNLQ292tc+gc07zYZXNZjaOoAX3sw==",
"version": "1.18.3",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz",
"integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
@ -7640,9 +7640,9 @@
}
},
"forwarded": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=",
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
"dev": true
},
"fraction.js": {
@ -8983,14 +8983,14 @@
"dev": true
},
"jest-worker": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz",
"integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==",
"version": "27.0.2",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.2.tgz",
"integrity": "sha512-EoBdilOTTyOgmHXtw/cPc+ZrCA0KJMrkXzkrPGNwLmnvvlN1nj7MPrxpT7m+otSv2e1TLaVffzDnE/LB14zJMg==",
"dev": true,
"requires": {
"@types/node": "*",
"merge-stream": "^2.0.0",
"supports-color": "^7.0.0"
"supports-color": "^8.0.0"
},
"dependencies": {
"has-flag": {
@ -9000,9 +9000,9 @@
"dev": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
@ -9210,26 +9210,26 @@
},
"dependencies": {
"@babel/preset-env": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.2.tgz",
"integrity": "sha512-7dD7lVT8GMrE73v4lvDEb85cgcQhdES91BSD7jS/xjC6QY8PnRhux35ac+GCpbiRhp8crexBvZZqnaL6VrY8TQ==",
"version": "7.14.4",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.4.tgz",
"integrity": "sha512-GwMMsuAnDtULyOtuxHhzzuSRxFeP0aR/LNzrHRzP8y6AgDNgqnrfCCBm/1cRdTU75tRs28Eh76poHLcg9VF0LA==",
"dev": true,
"requires": {
"@babel/compat-data": "^7.14.0",
"@babel/helper-compilation-targets": "^7.13.16",
"@babel/compat-data": "^7.14.4",
"@babel/helper-compilation-targets": "^7.14.4",
"@babel/helper-plugin-utils": "^7.13.0",
"@babel/helper-validator-option": "^7.12.17",
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.13.12",
"@babel/plugin-proposal-async-generator-functions": "^7.14.2",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-class-static-block": "^7.13.11",
"@babel/plugin-proposal-class-static-block": "^7.14.3",
"@babel/plugin-proposal-dynamic-import": "^7.14.2",
"@babel/plugin-proposal-export-namespace-from": "^7.14.2",
"@babel/plugin-proposal-json-strings": "^7.14.2",
"@babel/plugin-proposal-logical-assignment-operators": "^7.14.2",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.2",
"@babel/plugin-proposal-numeric-separator": "^7.14.2",
"@babel/plugin-proposal-object-rest-spread": "^7.14.2",
"@babel/plugin-proposal-object-rest-spread": "^7.14.4",
"@babel/plugin-proposal-optional-catch-binding": "^7.14.2",
"@babel/plugin-proposal-optional-chaining": "^7.14.2",
"@babel/plugin-proposal-private-methods": "^7.13.0",
@ -9252,10 +9252,10 @@
"@babel/plugin-transform-arrow-functions": "^7.13.0",
"@babel/plugin-transform-async-to-generator": "^7.13.0",
"@babel/plugin-transform-block-scoped-functions": "^7.12.13",
"@babel/plugin-transform-block-scoping": "^7.14.2",
"@babel/plugin-transform-classes": "^7.14.2",
"@babel/plugin-transform-block-scoping": "^7.14.4",
"@babel/plugin-transform-classes": "^7.14.4",
"@babel/plugin-transform-computed-properties": "^7.13.0",
"@babel/plugin-transform-destructuring": "^7.13.17",
"@babel/plugin-transform-destructuring": "^7.14.4",
"@babel/plugin-transform-dotall-regex": "^7.12.13",
"@babel/plugin-transform-duplicate-keys": "^7.12.13",
"@babel/plugin-transform-exponentiation-operator": "^7.12.13",
@ -9282,7 +9282,7 @@
"@babel/plugin-transform-unicode-escapes": "^7.12.13",
"@babel/plugin-transform-unicode-regex": "^7.12.13",
"@babel/preset-modules": "^0.1.4",
"@babel/types": "^7.14.2",
"@babel/types": "^7.14.4",
"babel-plugin-polyfill-corejs2": "^0.2.0",
"babel-plugin-polyfill-corejs3": "^0.2.0",
"babel-plugin-polyfill-regenerator": "^0.2.0",
@ -9326,15 +9326,15 @@
"dev": true
},
"autoprefixer": {
"version": "10.2.5",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.2.5.tgz",
"integrity": "sha512-7H4AJZXvSsn62SqZyJCP+1AWwOuoYpUfK6ot9vm0e87XD6mT8lDywc9D9OTJPMULyGcvmIxzTAMeG2Cc+YX+fA==",
"version": "10.2.6",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.2.6.tgz",
"integrity": "sha512-8lChSmdU6dCNMCQopIf4Pe5kipkAGj/fvTMslCsih0uHpOrXOPUEVOmYMMqmw3cekQkSD7EhIeuYl5y0BLdKqg==",
"dev": true,
"requires": {
"browserslist": "^4.16.3",
"caniuse-lite": "^1.0.30001196",
"browserslist": "^4.16.6",
"caniuse-lite": "^1.0.30001230",
"colorette": "^1.2.2",
"fraction.js": "^4.0.13",
"fraction.js": "^4.1.1",
"normalize-range": "^0.1.2",
"postcss-value-parser": "^4.1.0"
}
@ -9418,9 +9418,9 @@
"dev": true
},
"execa": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz",
"integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==",
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-5.1.0.tgz",
"integrity": "sha512-CkdUB7s2y6S+d4y+OM/+ZtQcJCiKUCth4cNImGMqrt2zEVtW2rfHGspQBE1GDo6LjeNIQmTPKXqTCKjqFKyu3A==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.3",
@ -10015,9 +10015,9 @@
}
},
"marked": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/marked/-/marked-2.0.5.tgz",
"integrity": "sha512-yfCEUXmKhBPLOzEC7c+tc4XZdIeTdGoRCZakFMkCxodr7wDXqoapIME4wjcpBPJLNyUnKJ3e8rb8wlAgnLnaDw=="
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/marked/-/marked-2.0.7.tgz",
"integrity": "sha512-BJXxkuIfJchcXOJWTT2DOL+yFWifFv2yGYOUzvXg8Qz610QKw+sHCvTMYwA+qWGhlA2uivBezChZ/pBy1tWdkQ=="
},
"md5": {
"version": "2.3.0",
@ -10247,18 +10247,18 @@
"dev": true
},
"mime-db": {
"version": "1.47.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
"integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
"version": "1.48.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz",
"integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==",
"dev": true
},
"mime-types": {
"version": "2.1.30",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
"integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
"version": "2.1.31",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz",
"integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==",
"dev": true,
"requires": {
"mime-db": "1.47.0"
"mime-db": "1.48.0"
}
},
"mimic-fn": {
@ -10358,6 +10358,11 @@
}
}
},
"mitt": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/mitt/-/mitt-2.1.0.tgz",
"integrity": "sha512-ILj2TpLiysu2wkBbWjAmww7TkZb65aiQO+DkVdUTBpBXq+MHYiETENkKFMtsJZX1Lf4pe4QOrTSjIfUwN5lRdg=="
},
"mixin-deep": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
@ -10804,15 +10809,14 @@
}
},
"object.values": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz",
"integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==",
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.4.tgz",
"integrity": "sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"define-properties": "^1.1.3",
"es-abstract": "^1.18.0-next.2",
"has": "^1.0.3"
"es-abstract": "^1.18.2"
}
},
"obuf": {
@ -12757,12 +12761,12 @@
"dev": true
},
"proxy-addr": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
"integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
"dev": true,
"requires": {
"forwarded": "~0.1.2",
"forwarded": "0.2.0",
"ipaddr.js": "1.9.1"
}
},
@ -13537,9 +13541,9 @@
"dev": true
},
"sass": {
"version": "1.34.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.34.0.tgz",
"integrity": "sha512-rHEN0BscqjUYuomUEaqq3BMgsXqQfkcMVR7UhscsAVub0/spUrZGBMxQXFS2kfiDsPLZw5yuU9iJEFNC2x38Qw==",
"version": "1.34.1",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.34.1.tgz",
"integrity": "sha512-scLA7EIZM+MmYlej6sdVr0HRbZX5caX5ofDT9asWnUJj21oqgsC+1LuNfm0eg+vM0fCTZHhwImTiCU0sx9h9CQ==",
"dev": true,
"requires": {
"chokidar": ">=3.0.0 <4.0.0"
@ -14630,12 +14634,12 @@
}
},
"terser-webpack-plugin": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.2.tgz",
"integrity": "sha512-6QhDaAiVHIQr5Ab3XUWZyDmrIPCHMiqJVljMF91YKyqwKkL5QHnYMkrMBy96v9Z7ev1hGhSEw1HQZc2p/s5Z8Q==",
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.3.tgz",
"integrity": "sha512-cxGbMqr6+A2hrIB5ehFIF+F/iST5ZOxvOmy9zih9ySbP1C2oEWQSOUS+2SNBTjzx5xLKO4xnod9eywdfq1Nb9A==",
"dev": true,
"requires": {
"jest-worker": "^26.6.2",
"jest-worker": "^27.0.2",
"p-limit": "^3.1.0",
"schema-utils": "^3.0.0",
"serialize-javascript": "^5.0.1",
@ -15490,9 +15494,9 @@
"dev": true
},
"vue": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.12.tgz",
"integrity": "sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg=="
"version": "2.6.13",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.13.tgz",
"integrity": "sha512-O+pAdJkce1ooYS1XyoQtpBQr9An+Oys3w39rkqxukVO3ZD1ilYJkWBGoRuadiQEm2LLJnCL2utV4TMSf52ubjw=="
},
"vue-class-component": {
"version": "7.2.6",
@ -15537,9 +15541,9 @@
}
},
"vue-template-compiler": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.12.tgz",
"integrity": "sha512-OzzZ52zS41YUbkCBfdXShQTe69j1gQDZ9HIX8miuC9C3rBCk9wIRjLiZZLrmX9V+Ftq/YEyv1JaVr5Y/hNtByg==",
"version": "2.6.13",
"resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.13.tgz",
"integrity": "sha512-latKAqpUjCkovB8XppW5gnZbSdYQzkf8pavsMBZYZrQcG6lAnj0EH4Ty7jMwAwFw5Cf4mybKBHlp1UTjnLPOWw==",
"dev": true,
"requires": {
"de-indent": "^1.0.2",
@ -15745,9 +15749,9 @@
}
},
"webpack": {
"version": "5.37.1",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.37.1.tgz",
"integrity": "sha512-btZjGy/hSjCAAVHw+cKG+L0M+rstlyxbO2C+BOTaQ5/XAnxkDrP5sVbqWhXgo4pL3X2dcOib6rqCP20Zr9PLow==",
"version": "5.38.1",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.38.1.tgz",
"integrity": "sha512-OqRmYD1OJbHZph6RUMD93GcCZy4Z4wC0ele4FXyYF0J6AxO1vOSuIlU1hkS/lDlR9CDYBz64MZRmdbdnFFoT2g==",
"dev": true,
"requires": {
"@types/eslint-scope": "^3.7.0",
@ -15760,7 +15764,7 @@
"chrome-trace-event": "^1.0.2",
"enhanced-resolve": "^5.8.0",
"es-module-lexer": "^0.4.0",
"eslint-scope": "^5.1.1",
"eslint-scope": "5.1.1",
"events": "^3.2.0",
"glob-to-regexp": "^0.4.1",
"graceful-fs": "^4.2.4",
@ -15771,14 +15775,14 @@
"schema-utils": "^3.0.0",
"tapable": "^2.1.1",
"terser-webpack-plugin": "^5.1.1",
"watchpack": "^2.0.0",
"webpack-sources": "^2.1.1"
"watchpack": "^2.2.0",
"webpack-sources": "^2.3.0"
},
"dependencies": {
"acorn": {
"version": "8.2.4",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.2.4.tgz",
"integrity": "sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg==",
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.3.0.tgz",
"integrity": "sha512-tqPKHZ5CaBJw0Xmy0ZZvLs1qTV+BNFSyvn77ASXkpBNfIRk8ev26fKrD9iLGwGA9zedPao52GSHzq8lyZG0NUw==",
"dev": true
},
"enhanced-resolve": {
@ -15821,9 +15825,9 @@
"dev": true
},
"webpack-sources": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz",
"integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==",
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.3.0.tgz",
"integrity": "sha512-WyOdtwSvOML1kbgtXbTDnEW0jkJ7hZr/bDByIwszhWd/4XX1A3XMkrbFMsuH4+/MfLlZCUzlAdg4r7jaGKEIgQ==",
"dev": true,
"requires": {
"source-list-map": "^2.0.1",
@ -15905,9 +15909,9 @@
},
"dependencies": {
"execa": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz",
"integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==",
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-5.1.0.tgz",
"integrity": "sha512-CkdUB7s2y6S+d4y+OM/+ZtQcJCiKUCth4cNImGMqrt2zEVtW2rfHGspQBE1GDo6LjeNIQmTPKXqTCKjqFKyu3A==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.3",
@ -16627,9 +16631,9 @@
"dev": true
},
"ws": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz",
"integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==",
"dev": true,
"requires": {
"async-limiter": "~1.0.0"

1
package.json

@ -29,6 +29,7 @@
"dependencies": {
"@types/marked": "^2.0.3",
"marked": "^2.0.5",
"mitt": "^2.1.0",
"primeflex": "^2.0.0",
"primeicons": "^4.1.0",
"primevue": "^2.4.1",

1342
public/js/app.js
File diff suppressed because it is too large
View File

11
public/js/app.js.LICENSE.txt

@ -0,0 +1,11 @@
/*!
* Vue.js v2.6.13
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
/**
* vue-class-component v7.2.6
* (c) 2015-present Evan You
* @license MIT
*/

1
public/js/mitt.es.js.map

@ -0,0 +1 @@
{"version":3,"file":"mitt.es.js","sources":["../src/index.ts"],"sourcesContent":["export type EventType = string | symbol;\n\n// An event handler can take an optional event argument\n// and should not return a value\nexport type Handler<T = any> = (event?: T) => void;\nexport type WildcardHandler = (type: EventType, event?: any) => void;\n\n// An array of all currently registered event handlers for a type\nexport type EventHandlerList = Array<Handler>;\nexport type WildCardEventHandlerList = Array<WildcardHandler>;\n\n// A map of event types and their corresponding event handlers.\nexport type EventHandlerMap = Map<EventType, EventHandlerList | WildCardEventHandlerList>;\n\nexport interface Emitter {\n\tall: EventHandlerMap;\n\n\ton<T = any>(type: EventType, handler: Handler<T>): void;\n\ton(type: '*', handler: WildcardHandler): void;\n\n\toff<T = any>(type: EventType, handler: Handler<T>): void;\n\toff(type: '*', handler: WildcardHandler): void;\n\n\temit<T = any>(type: EventType, event?: T): void;\n\temit(type: '*', event?: any): void;\n}\n\n/**\n * Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nexport default function mitt(all?: EventHandlerMap): Emitter {\n\tall = all || new Map();\n\n\treturn {\n\n\t\t/**\n\t\t * A Map of event names to registered handler functions.\n\t\t */\n\t\tall,\n\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to listen for, or `\"*\"` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @memberOf mitt\n\t\t */\n\t\ton<T = any>(type: EventType, handler: Handler<T>) {\n\t\t\tconst handlers = all.get(type);\n\t\t\tconst added = handlers && handlers.push(handler);\n\t\t\tif (!added) {\n\t\t\t\tall.set(type, [handler]);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to unregister `handler` from, or `\"*\"`\n\t\t * @param {Function} handler Handler function to remove\n\t\t * @memberOf mitt\n\t\t */\n\t\toff<T = any>(type: EventType, handler: Handler<T>) {\n\t\t\tconst handlers = all.get(type);\n\t\t\tif (handlers) {\n\t\t\t\thandlers.splice(handlers.indexOf(handler) >>> 0, 1);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `\"*\"` handlers are invoked after type-matched handlers.\n\t\t *\n\t\t * Note: Manually firing \"*\" handlers is not supported.\n\t\t *\n\t\t * @param {string|symbol} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @memberOf mitt\n\t\t */\n\t\temit<T = any>(type: EventType, evt: T) {\n\t\t\t((all.get(type) || []) as EventHandlerList).slice().map((handler) => { handler(evt); });\n\t\t\t((all.get('*') || []) as WildCardEventHandlerList).slice().map((handler) => { handler(type, evt); });\n\t\t}\n\t};\n}\n"],"names":["all","Map","on","type","handler","handlers","get","push","set","off","splice","indexOf","emit","evt","slice","map"],"mappings":"wBAgC6BA,GAG5B,MAAO,CAKNA,IAPDA,EAAMA,GAAO,IAAIC,IAehBC,YAAYC,EAAiBC,GAC5B,IAAMC,EAAWL,EAAIM,IAAIH,GACXE,GAAYA,EAASE,KAAKH,IAEvCJ,EAAIQ,IAAIL,EAAM,CAACC,KAUjBK,aAAaN,EAAiBC,GAC7B,IAAMC,EAAWL,EAAIM,IAAIH,GACrBE,GACHA,EAASK,OAAOL,EAASM,QAAQP,KAAa,EAAG,IAcnDQ,cAAcT,EAAiBU,IAC5Bb,EAAIM,IAAIH,IAAS,IAAyBW,QAAQC,IAAI,SAACX,GAAcA,EAAQS,MAC7Eb,EAAIM,IAAI,MAAQ,IAAiCQ,QAAQC,IAAI,SAACX,GAAcA,EAAQD,EAAMU"}

4
resources/js/app.ts

@ -33,6 +33,8 @@ import Dialog from 'primevue/dialog';
import Message from 'primevue/message';
import Timeline from 'primevue/timeline';
import ScrollPanel from 'primevue/scrollpanel';
import ConfirmationService from 'primevue/confirmationservice';
import ConfirmDialog from 'primevue/confirmdialog';
// Own components
import AppHeader from './components/layout/Header.vue';
@ -50,6 +52,7 @@ Vue.use(PrimeVue, {
});
Vue.use(ToastService);
Vue.use(ConfirmationService);
Vue.use(ApiPlugin);
Vue.component('Button', Button);
@ -78,6 +81,7 @@ Vue.component('Dialog', Dialog);
Vue.component('Message', Message);
Vue.component('Timeline', Timeline);
Vue.component('ScrollPanel', ScrollPanel);
Vue.component('ConfirmDialog', ConfirmDialog);
// Layout
Vue.component('app-header', AppHeader);

15
resources/js/components/Home/Home.ts

@ -18,18 +18,25 @@ export default class Home extends Vue {
/**
* A method which uploads the files to the server for processing
*
* @param event The event containing the uploaded files information
* @param {any} event The event containing the uploaded files information
*/
public async uploadFile(event: any): Promise<void> {
let file = event.files[0];
return this.uploadNewFile(file);
}
/**
* A method which uploads the files to the server for processing
*
* @param {File} file The event containing the uploaded files information
*/
public async uploadNewFile(file: File): Promise<void> {
this.uploading = true;
this.fileUploaded = false;
this.$toast.add({severity: 'info', summary: 'Uploading...', detail: 'Uploading your file...', life: 3000});
try {
let file = event.files[0];
let response = await this.$api.uploadFile(file);
this.fileUploaded = true;

1
resources/js/components/Home/Home.vue

@ -33,6 +33,7 @@
<template v-else>
<process-file :file="uploadResult"
:searchers="searchers"
@newFile="uploadNewFile"
@error="onError">
</process-file>
</template>

53
resources/js/components/ProcessFile/ProcessFile.ts

@ -43,6 +43,9 @@ export default class ProcessFile extends Vue {
// Toggles the visibility of the available searchers dialog
private searchersDialogVisible: boolean = false;
// Toggles the visibility of the document upload dialog
private uploadDialogVisible: boolean = false;
// The list of filters/searchers in a format usable by the datatable
// private searchersData: Array<{ id: string; name: string; type: string; }> = [];
@ -53,7 +56,7 @@ export default class ProcessFile extends Vue {
private selectedSearchers: any = {};
//The list of expanded rows in the selected filters/searchers table
private expandedRows: Array<{ id: string; name: string; }> = [];
private expandedRows: Array<any> = [];
// The list of options applied to the searchers (for the moment, only replace_with)
private searchersOptions: { [key: string]: string } = {};
@ -112,13 +115,53 @@ export default class ProcessFile extends Vue {
if ( ! this.searchersDialogVisible) {
for (let selectedSearcher of this.newlySelectedSearchers) {
this.selectedSearchers[selectedSearcher.id] = selectedSearcher;
// this.selectedSearchers[selectedSearcher.id] = selectedSearcher;
this.$set(this.selectedSearchers, selectedSearcher.id, selectedSearcher);
this.expandedRows = Object.values(this.selectedSearchers).filter((p: any) => p.id);
}
this.newlySelectedSearchers = [];
}
}
/**
* Toggle the dialog which lets the user upload a new document
*
* @param {boolean} newValue
*/
toggleUploadDialog(newValue?: boolean) {
if (typeof newValue !== 'undefined') {
this.uploadDialogVisible = newValue;
} else {
this.uploadDialogVisible = !this.searchersDialogVisible;
}
}
/**
* A method which uploads the files to the server for processing
*
* @param event The event containing the uploaded files information
*/
public async uploadFile(event: any): Promise<void> {
this.$confirm.require({
message: 'You will lose any progress on the current uploaded document. Are you sure you want to proceed?',
header: 'Confirmation',
icon: 'pi pi-exclamation-triangle',
accept: () => {
this.fileContent = this.processedFileContent = '';
let file = event.files[0];
this.toggleUploadDialog(false);
this.$emit('newFile', file);
},
reject: () => {
// TODO: Show a message to the user that the action was cancelled.
}
});
}
/**
* Wait for the file to be processed in ingest
*/
@ -161,7 +204,7 @@ export default class ProcessFile extends Vue {
* @param $event
*/
private onSelectedSearchersReorder($event: any) {
this.selectedSearchers = $event.value;
Object.assign({}, this.selectedSearchers, $event.value);
}
private confirmDeleteProduct(searcher: any) {
@ -205,6 +248,7 @@ export default class ProcessFile extends Vue {
* Create the diff preview for the document
*/
private createDiffPreview() {
console.log('CREATING DIFF PREVIEW: ', this.processedFileContent);
this.processedFileContentPreview = this.processedFileContent;
let indexes: Array<{ start: number; end: number }> = [];
@ -248,7 +292,6 @@ export default class ProcessFile extends Vue {
*/
@Watch('showDiffHighlight')
private onDiffHighlightChanged(newValue: boolean, oldValue: boolean): void {
console.log('OLD: ', oldValue);
console.log('NEW: ', newValue);
//
}
}

49
resources/js/components/ProcessFile/ProcessFile.vue

@ -6,6 +6,15 @@
<template #left>
<h3>Original document content</h3>
</template>
<template #right>
<Button
label="Try another document"
icon="pi pi-upload"
class="p-button-success p-button-outlined p-button-sm"
@click="toggleUploadDialog()"/>
</template>
</Toolbar>
</template>
@ -60,7 +69,7 @@
label="Run filters"
icon="pi pi-play"
class="p-button-success p-button-outlined p-button-sm"
:disabled="fileContent == '' || selectedSearchers.length === 0"
:disabled="fileContent == '' || Object.keys(selectedSearchers).length === 0"
@click="runSearchers"/>
</template>
</Toolbar>
@ -169,13 +178,15 @@
dataKey="id"
class="p-datatable-sm"
:expandedRows.sync="expandedRows"
@row-reorder="onSelectedSearchersReorder">
@row-reorder="onSelectedSearchersReorder"
:scrollable="true"
scrollHeight="80vh">
<Column :rowReorder="true" headerStyle="width: 3rem"/>
<Column field="name" header="Name"></Column>
<Column>
<Column headerStyle="width: 3rem">
<template #body="slotProps">
<Button icon="pi pi-trash"
class="p-button-rounded p-button-warning"
@ -204,8 +215,40 @@
</div>
</template>
<template #footer>
<Button
label="Run filters"
icon="pi pi-play"
class="p-button-success p-button-sm"
:disabled="fileContent == '' || Object.keys(selectedSearchers).length === 0"
@click="toggleSearchersSidebar(); runSearchers()"/>
</template>
</DataTable>
</Sidebar>
<!-- File upload dialog -->
<Dialog header="Upload a new file"
:visible.sync="uploadDialogVisible"
:maximizable="true"
:style="{width: '50vw'}"
:contentStyle="{overflow: 'visible'}"
id="upload_dialog"
ref="upload-dialog">
<FileUpload
name="upload[]"
:customUpload="true"
:auto="true"
@uploader="uploadFile">
<template #empty>
<p>Drag and drop files to here to upload.</p>
</template>
</FileUpload>
</Dialog>
</div>
</template>

35
resources/js/components/layout/Header.vue

@ -2,18 +2,22 @@
<div class="header">
<!-- Left side of header -->
<div class="left">
<Button @click="onHomeButtonClick" class="p-button-primary" label="Search and Displace" />
<Button
@click="onRouteChange('/')"
class="p-button-primary"
label="Search and Displace" />
</div>
<!-- Right side of header -->
<div class="right">
<a href="/regex/create" style="margin-right: 1rem;">
<Button class="fc-button">Add regex</Button>
</a>
<a href="/searchers">
<Button class="fc-button">Searchers</Button>
</a>
<Button
@click="onRouteChange('/regex/create')"
class="p-button-primary fc-button"
label="Add regex" />
<Button
@click="onRouteChange('/searchers')"
class="p-button-primary fc-button"
label="Searchers" />
</div>
</div>
</template>
@ -27,5 +31,20 @@ export default class AppHeader extends Vue {
onHomeButtonClick() {
window.location.href = '/';
}
onRouteChange(url: string) {
this.$confirm.require({
message: 'You will lose any progress on the current uploaded document. Are you sure you want to proceed?',
header: 'Confirmation',
icon: 'pi pi-exclamation-triangle',
accept: () => {
console.log("ACCEPT!");
window.location.href = url;
},
reject: () => {
// TODO: Show a message to the user that the action was cancelled.
}
});
}
}
</script>
Loading…
Cancel
Save