Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Revert stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
EpocDotFr committed Sep 10, 2020
1 parent 056e319 commit f6c7282
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 52 deletions.
11 changes: 0 additions & 11 deletions html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,6 @@
<div class="pbs pll">
<small class="txt-muted">This feature is automatically disabled if logged-out</small>
</div>
<!--<div class="pts row">
<div class="w40p txt-center browser-style">
<input type="checkbox" id="enable_menu_to_hide_mrs_based_on_pipeline_status">
</div>
<div>
<label for="enable_menu_to_hide_mrs_based_on_pipeline_status">Enable menu allowing to hide Merge Requests based on their latest pipeline status</label>
</div>
</div>
<div class="pbs pll">
<small class="txt-muted">This feature is automatically disabled if the GitLab "pipeline" feature is disabled</small>
</div>-->
<div class="txt-center pts pbs"><button type="submit" class="browser-style">Save preferences</button></div>
</form>

Expand Down
27 changes: 1 addition & 26 deletions js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
* Determines if the project do uses the Gitlab "pipeline" feature.
*/
isPipelineFeatureEnabled() {
return false;// document.querySelector('.nav-sidebar .shortcuts-pipelines') ? true : false;
return document.querySelector('.nav-sidebar .shortcuts-pipelines') ? true : false;
}

/**
Expand Down Expand Up @@ -231,10 +231,6 @@
if (self.userAuthenticated && self.preferences.enable_button_to_toggle_wip_status) {
self.attachClickEventToToggleWipStatusButtons();
}

if (self.pipelineFeatureEnabled && self.preferences.enable_menu_to_hide_mrs_based_on_pipeline_status) {
self.addHideMrsByPipelineStatusMenu();
}
});
}

Expand Down Expand Up @@ -579,27 +575,6 @@
return placeholders[placeholder];
}).trim();
}

addHideMrsByPipelineStatusMenu() {
let menu = '<div class="filter-dropdown-container d-flex flex-column flex-md-row">' +
'<div class="dropdown inline prepend-left-10">' +
'<button class="btn btn-default dropdown-menu-toggle" data-display="static" data-toggle="dropdown" type="button">' +
'Pipeline status <i aria-hidden="true" class="fa fa-chevron-down"></i>' +
'</button>' +
'<ul class="dropdown-menu dropdown-menu-right dropdown-menu-selectable">' +
'<li>' +
'<a class="" href="#">Passed</a>' +
'<a class="is-active" href="#">Failed</a>' +
'</li>' +
'</ul>' +
'</div>' +
'</div>';

this.parseHtmlAndAppend(
document.querySelector('.filtered-search-block'),
menu
);
}
}

let cs = new ContentScript();
Expand Down
15 changes: 2 additions & 13 deletions js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
this.jiraTicketLinkLabelTypeRadioButtons = Array.from(document.querySelectorAll('input[name="jira_ticket_link_label_type"]'));

this.enableButtonToToggleWipStatusCheckbox = document.querySelector('input#enable_button_to_toggle_wip_status');

this.enableMenuToHideMrsBasedOnPipelineStatus = document.querySelector('input#enable_menu_to_hide_mrs_based_on_pipeline_status');
}

/**
Expand Down Expand Up @@ -69,9 +67,6 @@

self.enableButtonToToggleWipStatusCheckbox.checked = preferences.enable_button_to_toggle_wip_status;
self.enableButtonToToggleWipStatusCheckbox.dispatchEvent(new CustomEvent('change'));

self.enableMenuToHideMrsBasedOnPipelineStatus.checked = preferences.enable_menu_to_hide_mrs_based_on_pipeline_status;
self.enableMenuToHideMrsBasedOnPipelineStatus.dispatchEvent(new CustomEvent('change'));
});
}

Expand Down Expand Up @@ -122,10 +117,6 @@
this.enableButtonToToggleWipStatusCheckbox.addEventListener('change', function() {
self.forceUserToEnableAtLeastOneFeatureIfNecessarily();
});

this.enableMenuToHideMrsBasedOnPipelineStatus.addEventListener('change', function() {
self.forceUserToEnableAtLeastOneFeatureIfNecessarily();
});
}

/**
Expand All @@ -147,8 +138,7 @@
enable_jira_ticket_link: this.enableJiraTicketLinkCheckbox.checked,
base_jira_url: this.baseJiraUrlInput.value,
jira_ticket_link_label_type: jira_ticket_link_label_type,
enable_button_to_toggle_wip_status: this.enableButtonToToggleWipStatusCheckbox.checked,
enable_menu_to_hide_mrs_based_on_pipeline_status: this.enableMenuToHideMrsBasedOnPipelineStatus.checked
enable_button_to_toggle_wip_status: this.enableButtonToToggleWipStatusCheckbox.checked
},
function() {
self.setSuccessfulVisualFeedbackOnSubmitButton();
Expand Down Expand Up @@ -183,8 +173,7 @@
return !this.displaySourceAndTargetBranchesCheckbox.checked
&& !this.enableButtonToCopyMrInfoCheckbox.checked
&& !this.enableJiraTicketLinkCheckbox.checked
&& !this.enableButtonToToggleWipStatusCheckbox.checked
&& !this.enableMenuToHideMrsBasedOnPipelineStatus.checked;
&& !this.enableButtonToToggleWipStatusCheckbox.checked;
}

/**
Expand Down
3 changes: 1 addition & 2 deletions js/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
enable_jira_ticket_link: false,
base_jira_url: '',
jira_ticket_link_label_type: 'ticket_id',
enable_button_to_toggle_wip_status: true,
enable_menu_to_hide_mrs_based_on_pipeline_status: true
enable_button_to_toggle_wip_status: true
};
}

Expand Down

0 comments on commit f6c7282

Please sign in to comment.