2020-10-01 17:08:36 -04:00
|
|
|
import Vue from 'vue';
|
2020-10-08 20:08:41 -04:00
|
|
|
import Vuex from 'vuex';
|
2020-10-01 17:08:36 -04:00
|
|
|
import { parseBoolean } from '~/lib/utils/common_utils';
|
2020-10-08 20:08:41 -04:00
|
|
|
import NewFeatureFlag from './components/new_feature_flag.vue';
|
2021-02-14 13:09:20 -05:00
|
|
|
import createStore from './store/new';
|
2020-10-08 20:08:41 -04:00
|
|
|
|
|
|
|
Vue.use(Vuex);
|
2020-10-01 17:08:36 -04:00
|
|
|
|
|
|
|
export default () => {
|
|
|
|
const el = document.querySelector('#js-new-feature-flag');
|
2020-10-08 20:08:41 -04:00
|
|
|
const {
|
|
|
|
environmentsScopeDocsPath,
|
|
|
|
strategyTypeDocsPagePath,
|
|
|
|
endpoint,
|
|
|
|
featureFlagsPath,
|
2020-10-20 02:09:03 -04:00
|
|
|
environmentsEndpoint,
|
|
|
|
projectId,
|
|
|
|
userCalloutsPath,
|
|
|
|
userCalloutId,
|
|
|
|
showUserCallout,
|
2020-10-08 20:08:41 -04:00
|
|
|
} = el.dataset;
|
2020-10-01 17:08:36 -04:00
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
2020-11-03 04:09:07 -05:00
|
|
|
store: createStore({ endpoint, projectId, path: featureFlagsPath }),
|
2020-10-01 17:08:36 -04:00
|
|
|
provide: {
|
|
|
|
environmentsScopeDocsPath,
|
|
|
|
strategyTypeDocsPagePath,
|
2020-10-20 02:09:03 -04:00
|
|
|
environmentsEndpoint,
|
|
|
|
projectId,
|
|
|
|
userCalloutsPath,
|
|
|
|
userCalloutId,
|
|
|
|
showUserCallout: parseBoolean(showUserCallout),
|
2020-10-01 17:08:36 -04:00
|
|
|
},
|
|
|
|
render(createElement) {
|
2020-10-20 02:09:03 -04:00
|
|
|
return createElement(NewFeatureFlag);
|
2020-10-01 17:08:36 -04:00
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|