debian-mirror-gitlab/app/assets/javascripts/environments/index.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1 KiB
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
import Vue from 'vue';
2020-11-24 15:15:51 +05:30
import VueApollo from 'vue-apollo';
2023-06-20 00:43:36 +05:30
import { removeLastSlashInUrlPath } from '~/lib/utils/url_utility';
2019-02-15 15:39:39 +05:30
import { parseBoolean } from '../lib/utils/common_utils';
2022-05-07 20:08:51 +05:30
import { apolloProvider } from './graphql/client';
import EnvironmentsApp from './components/environments_app.vue';
2018-03-17 18:26:18 +05:30
2020-11-24 15:15:51 +05:30
Vue.use(VueApollo);
2017-08-17 22:00:37 +05:30
2021-12-11 22:18:48 +05:30
export default (el) => {
if (el) {
2022-05-07 20:08:51 +05:30
const {
canCreateEnvironment,
endpoint,
newEnvironmentPath,
helpPagePath,
projectPath,
defaultBranchName,
projectId,
2023-06-20 00:43:36 +05:30
kasTunnelUrl,
2022-05-07 20:08:51 +05:30
} = el.dataset;
2021-12-11 22:18:48 +05:30
return new Vue({
el,
2022-05-07 20:08:51 +05:30
apolloProvider: apolloProvider(endpoint),
2021-12-11 22:18:48 +05:30
provide: {
2022-05-07 20:08:51 +05:30
projectPath,
defaultBranchName,
endpoint,
newEnvironmentPath,
helpPagePath,
projectId,
2023-06-20 00:43:36 +05:30
kasTunnelUrl: removeLastSlashInUrlPath(kasTunnelUrl),
2022-05-07 20:08:51 +05:30
canCreateEnvironment: parseBoolean(canCreateEnvironment),
2021-12-11 22:18:48 +05:30
},
2022-05-07 20:08:51 +05:30
render(h) {
return h(EnvironmentsApp);
2021-12-11 22:18:48 +05:30
},
});
}
return null;
2020-11-24 15:15:51 +05:30
};