diff --git a/.gitignore b/.gitignore index 244c599369..ede61a8e9e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ koha-tmpl/opac-tmpl/bootstrap/css/print.css koha-tmpl/opac-tmpl/bootstrap/css/print-rtl.css koha-tmpl/opac-tmpl/bootstrap/css/sco.css koha-tmpl/opac-tmpl/bootstrap/css/sco-rtl.css +koha-tmpl/opac-tmpl/bootstrap/js/vue/dist/ koha-tmpl/intranet-tmpl/prog/css/maps/ koha-tmpl/intranet-tmpl/prog/css/bookings.css diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Islands/PatronSelfRenewal/PatronSelfRenewal.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Islands/PatronSelfRenewal/PatronSelfRenewal.vue new file mode 100644 index 0000000000..c5484a4371 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Islands/PatronSelfRenewal/PatronSelfRenewal.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Islands/PatronSelfRenewal/VerificationChecks.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Islands/PatronSelfRenewal/VerificationChecks.vue new file mode 100644 index 0000000000..74d8c06b31 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Islands/PatronSelfRenewal/VerificationChecks.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts index 1382998496..6520df0020 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts @@ -87,6 +87,19 @@ export const componentRegistry: Map = }, }, ], + [ + "patron-self-renewal", + { + importFn: async () => { + const module = await import( + /* webpackChunkName: "patron-self-renewal" */ + "../components/Islands/PatronSelfRenewal/PatronSelfRenewal.vue" + ); + return module.default; + }, + config: {}, + }, + ], ]); /** diff --git a/rspack.config.js b/rspack.config.js index e925b491b5..df276cfb4d 100644 --- a/rspack.config.js +++ b/rspack.config.js @@ -3,6 +3,96 @@ const { VueLoaderPlugin } = require("vue-loader"); const path = require("path"); const rspack = require("@rspack/core"); +const islandsExport = application => { + const vueDir = + application === "intranet" + ? "intranet-tmpl/prog" + : "opac-tmpl/bootstrap"; + + return { + resolve: { + alias: { + "@fetch": path.resolve( + __dirname, + "koha-tmpl/intranet-tmpl/prog/js/fetch" + ), + "@koha-vue": path.resolve( + __dirname, + "koha-tmpl/intranet-tmpl/prog/js/vue" + ), + }, + }, + experiments: { + outputModule: true, + }, + entry: { + islands: [ + "./koha-tmpl/intranet-tmpl/prog/js/vue/csp-nonce.js", + "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts", + ], + }, + output: { + filename: "[name].esm.js", + path: path.resolve(__dirname, `koha-tmpl/${vueDir}/js/vue/dist/`), + chunkFilename: "[name].[contenthash].esm.js", + globalObject: "window", + library: { + type: "module", + }, + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: "vue-loader", + options: { + experimentalInlineMatchResource: true, + }, + exclude: [path.resolve(__dirname, "t/cypress/")], + }, + { + test: /\.ts$/, + loader: "builtin:swc-loader", + options: { + jsc: { + parser: { + syntax: "typescript", + }, + }, + appendTsSuffixTo: [/\.vue$/], + }, + exclude: [ + /node_modules/, + path.resolve(__dirname, "t/cypress/"), + ], + type: "javascript/auto", + }, + { + test: /\.css$/i, + type: "javascript/auto", + use: ["style-loader", "css-loader"], + }, + ], + }, + plugins: [ + new VueLoaderPlugin(), + new rspack.DefinePlugin({ + __VUE_OPTIONS_API__: true, + __VUE_PROD_DEVTOOLS__: false, + __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false, + }), + ], + externals: { + jquery: "jQuery", + "datatables.net": "DataTable", + "datatables.net-buttons": "DataTable", + "datatables.net-buttons/js/buttons.html5": "DataTable", + "datatables.net-buttons/js/buttons.print": "DataTable", + "datatables.net-buttons/js/buttons.colVis": "DataTable", + }, + }; +}; + module.exports = [ { resolve: { @@ -104,87 +194,8 @@ module.exports = [ "datatables.net-buttons/js/buttons.colVis": "DataTable", }, }, - { - resolve: { - alias: { - "@fetch": path.resolve( - __dirname, - "koha-tmpl/intranet-tmpl/prog/js/fetch" - ), - }, - }, - experiments: { - outputModule: true, - }, - entry: { - islands: [ - "./koha-tmpl/intranet-tmpl/prog/js/vue/csp-nonce.js", - "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts", - ], - }, - output: { - filename: "[name].esm.js", - path: path.resolve( - __dirname, - "koha-tmpl/intranet-tmpl/prog/js/vue/dist/" - ), - chunkFilename: "[name].[contenthash].esm.js", - globalObject: "window", - library: { - type: "module", - }, - }, - module: { - rules: [ - { - test: /\.vue$/, - loader: "vue-loader", - options: { - experimentalInlineMatchResource: true, - }, - exclude: [path.resolve(__dirname, "t/cypress/")], - }, - { - test: /\.ts$/, - loader: "builtin:swc-loader", - options: { - jsc: { - parser: { - syntax: "typescript", - }, - }, - appendTsSuffixTo: [/\.vue$/], - }, - exclude: [ - /node_modules/, - path.resolve(__dirname, "t/cypress/"), - ], - type: "javascript/auto", - }, - { - test: /\.css$/i, - type: "javascript/auto", - use: ["style-loader", "css-loader"], - }, - ], - }, - plugins: [ - new VueLoaderPlugin(), - new rspack.DefinePlugin({ - __VUE_OPTIONS_API__: true, - __VUE_PROD_DEVTOOLS__: false, - __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false, - }), - ], - externals: { - jquery: "jQuery", - "datatables.net": "DataTable", - "datatables.net-buttons": "DataTable", - "datatables.net-buttons/js/buttons.html5": "DataTable", - "datatables.net-buttons/js/buttons.print": "DataTable", - "datatables.net-buttons/js/buttons.colVis": "DataTable", - }, - }, + islandsExport("intranet"), + islandsExport("opac"), { entry: { "api-client.cjs": [