fix(frontend): batch commit toolbar doesnt appear in vue prod mode (#1023)

This commit is contained in:
Kristaps Fabians Geikins
2022-09-22 18:24:29 +03:00
committed by GitHub
parent 84c6ea68a2
commit 5c86540b8e
3 changed files with 15 additions and 17 deletions
+5 -3
View File
@@ -13,7 +13,11 @@ import { formatNumber } from '@/plugins/formatNumber'
Vue.filter('prettynum', formatNumber)
// process.env.NODE_ENV is injected by Webpack
Vue.config.productionTip = process.env.NODE_ENV === 'development'
const enableDevMode =
!!process.env.FORCE_VUE_DEVTOOLS || process.env.NODE_ENV === 'development'
Vue.config.productionTip = enableDevMode
Vue.config.devtools = enableDevMode
Vue.use(VTooltip, {
defaultDelay: 300,
@@ -21,8 +25,6 @@ Vue.use(VTooltip, {
defaultHtml: false
})
// RANDOM CHANGE! (testing out gitguardian)
// In highly restrictive sandboxed environments mixpanel init might fail due to document.cookie access
Vue.use(VueMixpanel, {
token: 'acd87c5a50b56df91a795e999812a3a4',
@@ -1,4 +1,3 @@
import { reduce } from 'lodash'
import { ref, computed } from 'vue'
export enum BatchActionType {
@@ -11,19 +10,14 @@ export enum BatchActionType {
*/
export function useCommitMultiActions() {
const selectedCommitsState = ref({} as Record<string, boolean>)
const selectedCommitIds = computed(() =>
reduce(
selectedCommitsState.value,
(res, val, key) => {
if (val) {
res.push(key)
}
const selectedCommitIds = computed(() => {
const results: string[] = []
for (const [key, val] of Object.entries(selectedCommitsState.value)) {
if (val) results.push(key)
}
return res
},
[] as string[]
)
)
return results
})
const clearSelectedCommits = () => {
selectedCommitsState.value = {}
+3 -1
View File
@@ -24,7 +24,9 @@ const config = {
// Add plugin for injecting env vars
config
.plugin('speckle-env-vars')
.use(webpack.EnvironmentPlugin, [{ SPECKLE_SERVER_VERSION: 'unknown' }])
.use(webpack.EnvironmentPlugin, [
{ SPECKLE_SERVER_VERSION: 'unknown', FORCE_VUE_DEVTOOLS: false }
])
// Setting source map according to build env
config.devtool(isProdBuild ? false : 'eval-source-map')