debian-mirror-gitlab/app/assets/javascripts/projects/terraform_notification/index.js
2021-10-27 15:23:28 +05:30

23 lines
633 B
JavaScript

import Vue from 'vue';
import { parseBoolean, getCookie } from '~/lib/utils/common_utils';
import TerraformNotification from './components/terraform_notification.vue';
export default () => {
const el = document.querySelector('.js-terraform-notification');
const bannerDismissedKey = 'terraform_notification_dismissed';
if (!el || parseBoolean(getCookie(bannerDismissedKey))) {
return false;
}
const { terraformImagePath } = el.dataset;
return new Vue({
el,
provide: {
terraformImagePath,
bannerDismissedKey,
},
render: (createElement) => createElement(TerraformNotification),
});
};