-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add module JS file to handle Vue apps (#2584)
* wip jsbundling-rails * wip esbuild * working sso mapping app * clean * fix * gitignore * fix * eslint override
- Loading branch information
Showing
16 changed files
with
299 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
web: bin/rails server | ||
js: yarn build --watch |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
//= link_tree ../examples | ||
//= link_tree ../images | ||
//= link_tree ../fonts | ||
//= link_tree ../builds | ||
//= link_directory ../stylesheets .css | ||
//= link_directory ../javascripts .js | ||
//= link vue.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "./apps" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<script> | ||
import { VueDraggableNext } from "vue-draggable-next"; | ||
const appElt = document.querySelector('#sso-mapping-app'); | ||
export default { | ||
components: { | ||
draggable: VueDraggableNext, | ||
}, | ||
data () { | ||
return { | ||
fields: JSON.parse(appElt.dataset.fields), | ||
keys: JSON.parse(appElt.dataset.keys) | ||
} | ||
}, | ||
methods: { | ||
addField: function () { | ||
this.fields.push({sso_key: 'key', internal_key: 'email', roles: {}}); | ||
console.log(this.fields); | ||
this.enableSelects(); | ||
}, | ||
enableSelects: function () { | ||
// conditional.js messes with the new field added, so we have to force enable the select fields | ||
var selectFields, | ||
target, | ||
i; | ||
setTimeout(function() { | ||
selectFields = document.getElementsByClassName("form-select"); | ||
for (i = 0; i < selectFields.length; i += 1) { | ||
target = selectFields[i]; | ||
target.removeAttribute('disabled'); | ||
} | ||
}, 100); | ||
} | ||
}, | ||
mounted() { | ||
this.enableSelects(); | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { createApp } from 'vue'; | ||
import SsoMappingApp from './SsoMappingApp.vue'; | ||
|
||
if (document.getElementById('sso-mapping-app')) { | ||
createApp(SsoMappingApp).mount('#sso-mapping-app'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env sh | ||
|
||
if gem list --no-installed --exact --silent foreman; then | ||
echo "Installing foreman..." | ||
gem install foreman | ||
fi | ||
|
||
# Default to port 3000 if not specified | ||
export PORT="${PORT:-3000}" | ||
|
||
exec foreman start -f Procfile.dev --env /dev/null "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env node | ||
|
||
import * as esbuild from 'esbuild' | ||
import vuePlugin from 'esbuild-plugin-vue-next' | ||
|
||
const options = { | ||
entryPoints: ['app/javascript/admin-module.js'], | ||
bundle: true, | ||
sourcemap: true, | ||
format: 'esm', | ||
outdir: 'app/assets/builds', | ||
publicPath: '/assets', | ||
logLevel: 'info', | ||
plugins: [vuePlugin()], | ||
define: { | ||
__VUE_OPTIONS_API__: 'true', | ||
__VUE_PROD_DEVTOOLS__: 'false', | ||
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false' | ||
}, | ||
alias: { | ||
'vue': 'vue/dist/vue.esm-bundler.js', | ||
}, | ||
} | ||
const watchMode = process.argv.includes('--watch') | ||
|
||
if (watchMode) { | ||
let ctx = await esbuild.context(options) | ||
await ctx.watch() | ||
} else { | ||
await esbuild.build(options) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.