Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(() => {
// Configures the subject props
propsData = {
...dateInputFixture.props,
}
vuetify = new Vuetify()
})
export const renderWithVuetify = (component, options, callback) => {
return render(
// anonymous component
{
// Vue's render function
render(createElement) {
// wrap the component with a <div data-app="true"> node and render the test component
return createElement('div', {attrs: {'data-app': true}}, [
createElement(component),
])
},
},
// for Vuetify components that use the $vuetify instance property
{vuetify: new Vuetify(), ...options},
callback,
)
}
</div>
export function createViewer(container, proxyConfig = null) {
const proxyConfiguration = proxyConfig || activeProxyConfig || Config.Proxy;
const proxyManager = vtkProxyManager.newInstance({ proxyConfiguration });
const store = createStore(proxyManager);
// subscription won't be unsubscribed b/c we currently
// don't have a way to destroy a viewer
registerProxyManagerHooks(proxyManager, store);
/* eslint-disable no-new */
new Vue({
el: container,
components: { App },
store,
vuetify: new Vuetify(),
template: '',
});
// support history-based navigation
function onRoute(event) {
const state = event.state || {};
if (state.app) {
store.commit(Mutations.SHOW_APP);
} else {
store.commit(Mutations.SHOW_LANDING);
}
}
store.watch(
(state) => state.route,
(route) => {
const state = window.history.state || {};
// Get git logs for both source and locale
const localeLog = await getLog(localePath)
const sourceLog = await getLog(sourcePath)
// If file is not commited, there's not much we can do
if (localeLog.total === 0) return 'unchanged'
// If file is newer than latest commit
// and value is changed then it's new
const { mtime } = await fs.stat(localePath)
const modifiedDate = new Date(mtime)
const commitDate = new Date(localeLog.latest.date)
if (modifiedDate > commitDate) {
const commitJson = await getJsonContent(localePath, localeLog.latest.hash)
if (helpers.getObjectValueByPath(commitJson, fileKey) !== helpers.getObjectValueByPath(localeJson, fileKey)) return 'new'
}
const latestSourceCommitDate = new Date(sourceLog.latest.date)
const latestLocaleCommitDate = new Date(localeLog.latest.date)
// If source has been updated after latest locale
// then we might have a mismatch
if (latestSourceCommitDate > latestLocaleCommitDate) {
const previousCommit = getPreviousCommit(sourceLog, localeLog.latest)
if (!previousCommit) throw new Error('asdasdas')
const oldJson = await getJsonContent(sourcePath, previousCommit.hash)
const newJson = await getJsonContent(sourcePath, sourceLog.latest.hash)
const changes = diffJson.diff(oldJson, newJson)
VSelect,
VSwitch,
VBtn,
VDatePicker,
VProgressCircular,
VSubheader,
VTooltip,
VDivider,
VCard,
VDialog,
},
directives,
iconfont: 'mdi',
// https://vuetifyjs.com/en/theme-generator
theme: {
primary: colors.blue.darken1,
secondary: colors.blue.lighten3,
accent: colors.amber.darken4,
error: colors.red.base,
warning: colors.yellow.darken3,
info: colors.blue.base,
success: colors.green.base
}
})
import VueResource from "vue-resource";
Vue.use(VueResource);
import Notifications from "vue-notification";
Vue.use(Notifications);
import ErrHandlers from "./lib/errors";
VSubheader,
VTooltip,
VDivider,
VCard,
VDialog,
},
directives,
iconfont: 'mdi',
// https://vuetifyjs.com/en/theme-generator
theme: {
primary: colors.blue.darken1,
secondary: colors.blue.lighten3,
accent: colors.amber.darken4,
error: colors.red.base,
warning: colors.yellow.darken3,
info: colors.blue.base,
success: colors.green.base
}
})
import VueResource from "vue-resource";
Vue.use(VueResource);
import Notifications from "vue-notification";
Vue.use(Notifications);
import ErrHandlers from "./lib/errors";
Vue.use(ErrHandlers);
import { FluxUtils } from "./lib/fluxUtils";
Vue.use(FluxUtils);
/*
** vuetify module configuration
** https://github.com/nuxt-community/vuetify-module
*/
vuetify: {
customVariables: ['~/assets/variables.scss'],
defaultAssets: false,
theme: {
dark: true,
themes: {
dark: {
primary: colors.blue.darken2,
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3
}
}
}
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, { isDev, isClient }) {
if (!isDev) {
// relative links, please.
import Vue from 'vue';
import Vuetify from 'vuetify';
import colors from 'vuetify/es5/util/colors';
// You can also specify those components you are going to use for "a la carte" build:
// https://github.com/vuetifyjs/nuxt/blob/master/template/plugins/vuetify.js
// https://github.com/vuetifyjs/a-la-carte/blob/master/template/src/main.js
Vue.use(Vuetify, {
theme: {
primary: '#9c27b0', // a color that is not in the material colors palette
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.darken2,
error: colors.deepOrange.accent4,
success: colors.green.accent3,
},
});
import 'shared/styles/main.less';
import Catalog from './views/Catalog.vue';
require('utils/translations');
const router = require('./router');
Vue.use(Vuetify, {
rtl: window.isRTL,
theme: {
primary: colors.blue.base, // @blue-500
primaryBackground: colors.blue.lighten5,
greyBackground: colors.grey.lighten3,
greenSuccess: '#4db6ac',
topic: colors.grey.base,
video: '#283593',
audio: '#f06292',
document: '#ff3d00',
exercise: '#4db6ac',
html5: '#ff8f00',
slideshow: '#4ece90',
},
});
Vue.use(VueIntl);
Vue.use(VueRouter);
new Vue({
el: 'catalog',
router,
...Catalog,
});
import 'vuetify/dist/vuetify.min.css';
import 'shared/styles/main.less';
import Catalog from './views/Catalog.vue';
require('utils/translations');
const router = require('./router');
Vue.use(Vuetify, {
rtl: window.isRTL,
theme: {
primary: colors.blue.base, // @blue-500
primaryBackground: colors.blue.lighten5,
greyBackground: colors.grey.lighten3,
greenSuccess: '#4db6ac',
topic: colors.grey.base,
video: '#283593',
audio: '#f06292',
document: '#ff3d00',
exercise: '#4db6ac',
html5: '#ff8f00',
slideshow: '#4ece90',
},
});
Vue.use(VueIntl);
Vue.use(VueRouter);
new Vue({
el: 'catalog',
router,