Hide GitLab "Migrate from Jenkins" Widget

Hides the GitLab "Migrate from Jenkins" widget on the pipelines page.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Hide GitLab "Migrate from Jenkins" Widget
// @namespace   Violentmonkey Scripts
// @match       https://gitlab.*/*/merge_requests/*
// @grant       none
// @version     1.0.0
// @author      joshmcorreia
// @license     MIT
// @description Hides the GitLab "Migrate from Jenkins" widget on the pipelines page.
// ==/UserScript==

// GitHub repo can be found at https://github.com/joshmcorreia/userscript_hide_gitlab_migrate_from_jenkins

const pipeline_suggest_selector = ".mr-pipeline-suggest";

function remove_migrate_widget() {
    var pipeline_suggest_element = document.querySelector(pipeline_suggest_selector);
    pipeline_suggest_element.remove();
}

(new MutationObserver(check)).observe(document, {childList: true, subtree: true});

function check(changes, observer) {
    if(document.querySelector(pipeline_suggest_selector)) {
        observer.disconnect();
        remove_migrate_widget();
    }
}