2020-01-01 13:55:28 +05:30
|
|
|
/* eslint-disable func-names, no-return-assign */
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
import $ from 'jquery';
|
2022-04-04 11:22:00 +05:30
|
|
|
import { setCookie } from '~/lib/utils/common_utils';
|
2021-03-11 19:13:27 +05:30
|
|
|
import initClonePanel from '~/clone_panel';
|
2023-03-04 22:38:38 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
export default class Project {
|
|
|
|
constructor() {
|
2021-02-22 17:27:13 +05:30
|
|
|
initClonePanel();
|
2020-11-24 15:15:51 +05:30
|
|
|
|
2021-12-11 22:18:48 +05:30
|
|
|
$('.js-hide-no-ssh-message').on('click', function (e) {
|
2022-04-04 11:22:00 +05:30
|
|
|
setCookie('hide_no_ssh_message', 'false');
|
2021-12-11 22:18:48 +05:30
|
|
|
$(this).parents('.js-no-ssh-key-message').remove();
|
2018-03-17 18:26:18 +05:30
|
|
|
return e.preventDefault();
|
|
|
|
});
|
2021-12-11 22:18:48 +05:30
|
|
|
$('.js-hide-no-password-message').on('click', function (e) {
|
2022-04-04 11:22:00 +05:30
|
|
|
setCookie('hide_no_password_message', 'false');
|
2021-12-11 22:18:48 +05:30
|
|
|
$(this).parents('.js-no-password-message').remove();
|
2018-11-20 20:47:30 +05:30
|
|
|
return e.preventDefault();
|
|
|
|
});
|
2021-03-08 18:12:59 +05:30
|
|
|
$('.hide-auto-devops-implicitly-enabled-banner').on('click', function (e) {
|
2018-11-20 20:47:30 +05:30
|
|
|
const projectId = $(this).data('project-id');
|
|
|
|
const cookieKey = `hide_auto_devops_implicitly_enabled_banner_${projectId}`;
|
2022-04-04 11:22:00 +05:30
|
|
|
setCookie(cookieKey, 'false');
|
2021-03-08 18:12:59 +05:30
|
|
|
$(this).parents('.auto-devops-implicitly-enabled-banner').remove();
|
2018-03-17 18:26:18 +05:30
|
|
|
return e.preventDefault();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
static changeProject(url) {
|
2018-11-20 20:47:30 +05:30
|
|
|
return (window.location = url);
|
2018-03-17 18:26:18 +05:30
|
|
|
}
|
|
|
|
}
|