2020-10-01 17:08:36 -04:00
|
|
|
import Vue from 'vue';
|
2020-10-08 20:08:41 -04:00
|
|
|
import Vuex from 'vuex';
|
|
|
|
import EditFeatureFlag from './components/edit_feature_flag.vue';
|
2021-02-14 13:09:20 -05:00
|
|
|
import createStore from './store/edit';
|
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-edit-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,
|
|
|
|
featureFlagIssuesEndpoint,
|
2021-10-05 08:12:58 -04:00
|
|
|
searchPath,
|
2020-10-08 20:08:41 -04:00
|
|
|
} = el.dataset;
|
2020-10-01 17:08:36 -04:00
|
|
|
|
|
|
|
return new Vue({
|
2020-11-03 04:09:07 -05:00
|
|
|
store: createStore({ endpoint, projectId, path: featureFlagsPath }),
|
2020-10-01 17:08:36 -04:00
|
|
|
el,
|
|
|
|
provide: {
|
|
|
|
environmentsScopeDocsPath,
|
|
|
|
strategyTypeDocsPagePath,
|
2020-10-20 02:09:03 -04:00
|
|
|
environmentsEndpoint,
|
|
|
|
projectId,
|
|
|
|
featureFlagIssuesEndpoint,
|
2021-10-05 08:12:58 -04:00
|
|
|
searchPath,
|
2020-10-01 17:08:36 -04:00
|
|
|
},
|
|
|
|
render(createElement) {
|
2020-10-20 02:09:03 -04:00
|
|
|
return createElement(EditFeatureFlag);
|
2020-10-01 17:08:36 -04:00
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|