Welcome to mirror list, hosted at ThFree Co, Russian Federation.

namespace_storage_limit_alert.js « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 34ad93c127d63db53b867c2ebd3ed273676fb01c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import Cookies from 'js-cookie';

const handleOnDismiss = ({ currentTarget }) => {
  const {
    dataset: { id, level },
  } = currentTarget;

  Cookies.set(`hide_storage_limit_alert_${id}_${level}`, true, { expires: 365 });

  const notification = document.querySelector('.js-namespace-storage-alert');
  notification.parentNode.removeChild(notification);
};

export default () => {
  const alert = document.querySelector('.js-namespace-storage-alert-dismiss');

  if (alert) {
    alert.addEventListener('click', handleOnDismiss);
  }
};