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

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

33 lines
806 B
JavaScript
Raw Normal View History

2023-01-13 00:05:48 +05:30
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
2023-03-17 16:20:25 +05:30
import { parseBoolean } from '~/lib/utils/common_utils';
2023-04-23 21:23:45 +05:30
import App from './components/app.vue';
2023-01-13 00:05:48 +05:30
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
export const initArtifactsTable = () => {
const el = document.querySelector('#js-artifact-management');
if (!el) {
return false;
}
2023-03-17 16:20:25 +05:30
const { projectPath, canDestroyArtifacts, artifactsManagementFeedbackImagePath } = el.dataset;
2023-01-13 00:05:48 +05:30
return new Vue({
el,
apolloProvider,
provide: {
projectPath,
2023-03-17 16:20:25 +05:30
canDestroyArtifacts: parseBoolean(canDestroyArtifacts),
artifactsManagementFeedbackImagePath,
2023-01-13 00:05:48 +05:30
},
2023-04-23 21:23:45 +05:30
render: (createElement) => createElement(App),
2023-01-13 00:05:48 +05:30
});
};