diff --git a/.rubocop.yml b/.rubocop.yml index b6f7bd3da8c..c9e8e44bd7c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -351,12 +351,8 @@ RSpec/LeakyConstantDeclaration: - 'spec/db/schema_spec.rb' - 'spec/lib/feature_spec.rb' - 'spec/lib/gitlab/config/entry/simplifiable_spec.rb' - - 'spec/lib/gitlab/database/migration_helpers_spec.rb' - - 'spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb' - - 'spec/lib/gitlab/database/with_lock_retries_spec.rb' - 'spec/lib/gitlab/git/diff_collection_spec.rb' - 'spec/lib/gitlab/import_export/import_test_coverage_spec.rb' - - 'spec/lib/gitlab/import_export/project/relation_factory_spec.rb' - 'spec/lib/gitlab/quick_actions/dsl_spec.rb' - 'spec/lib/marginalia_spec.rb' - 'spec/mailers/notify_spec.rb' diff --git a/app/assets/javascripts/commons/bootstrap.js b/app/assets/javascripts/commons/bootstrap.js index e5e1cbb1e62..df0fa1ae88b 100644 --- a/app/assets/javascripts/commons/bootstrap.js +++ b/app/assets/javascripts/commons/bootstrap.js @@ -70,7 +70,12 @@ whitelist.acronym = []; whitelist.blockquote = []; whitelist.del = []; whitelist.ins = []; -whitelist['gl-emoji'] = []; +whitelist['gl-emoji'] = [ + 'data-name', + 'data-unicode-version', + 'data-fallback-src', + 'data-fallback-sprite-class', +]; // Whitelisting SVG tags and attributes whitelist.svg = ['viewBox']; diff --git a/app/assets/javascripts/diff_notes/components/jump_to_discussion.js b/app/assets/javascripts/diff_notes/components/jump_to_discussion.js index 0c521fa29bd..0991f5282a8 100644 --- a/app/assets/javascripts/diff_notes/components/jump_to_discussion.js +++ b/app/assets/javascripts/diff_notes/components/jump_to_discussion.js @@ -1,4 +1,4 @@ -/* eslint-disable func-names, guard-for-in, no-restricted-syntax, no-lonely-if, no-continue */ +/* eslint-disable func-names, no-continue */ /* global CommentsStore */ import $ from 'jquery'; @@ -42,13 +42,13 @@ const JumpToDiscussion = Vue.extend({ }, lastResolvedId() { let lastId; - for (const discussionId in this.discussions) { + Object.keys(this.discussions).forEach(discussionId => { const discussion = this.discussions[discussionId]; if (!discussion.isResolved()) { lastId = discussion.id; } - } + }); return lastId; }, }, @@ -95,12 +95,10 @@ const JumpToDiscussion = Vue.extend({ if (unresolvedDiscussionCount === 1) { hasDiscussionsToJumpTo = false; } - } else { + } else if (unresolvedDiscussionCount === 0) { // If there are no unresolved discussions on the diffs tab at all, // there are no discussions to jump to. - if (unresolvedDiscussionCount === 0) { - hasDiscussionsToJumpTo = false; - } + hasDiscussionsToJumpTo = false; } } else if (activeTab !== 'show') { // If we are on the commits or builds tabs, diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue index 2018c706b11..3ea4a24f421 100644 --- a/app/assets/javascripts/monitoring/components/dashboard.vue +++ b/app/assets/javascripts/monitoring/components/dashboard.vue @@ -226,7 +226,7 @@ export default { 'allDashboards', 'environmentsLoading', 'expandedPanel', - 'promVariables', + 'variables', 'isUpdatingStarredValue', ]), ...mapGetters('monitoringDashboard', [ @@ -251,7 +251,7 @@ export default { return !this.environmentsLoading && this.filteredEnvironments.length === 0; }, shouldShowVariablesSection() { - return Object.keys(this.promVariables).length > 0; + return Object.keys(this.variables).length > 0; }, }, watch: { @@ -273,7 +273,7 @@ export default { handler({ group, panel }) { const dashboardPath = this.currentDashboard || this.selectedDashboard?.path; updateHistory({ - url: panelToUrl(dashboardPath, convertVariablesForURL(this.promVariables), group, panel), + url: panelToUrl(dashboardPath, convertVariablesForURL(this.variables), group, panel), title: document.title, }); }, @@ -344,7 +344,7 @@ export default { }, generatePanelUrl(groupKey, panel) { const dashboardPath = this.currentDashboard || this.selectedDashboard?.path; - return panelToUrl(dashboardPath, convertVariablesForURL(this.promVariables), groupKey, panel); + return panelToUrl(dashboardPath, convertVariablesForURL(this.variables), groupKey, panel); }, hideAddMetricModal() { this.$refs.addMetricModal.hide(); diff --git a/app/assets/javascripts/monitoring/components/variables_section.vue b/app/assets/javascripts/monitoring/components/variables_section.vue index e054c9d8e26..1175e3bb461 100644 --- a/app/assets/javascripts/monitoring/components/variables_section.vue +++ b/app/assets/javascripts/monitoring/components/variables_section.vue @@ -2,7 +2,7 @@ import { mapState, mapActions } from 'vuex'; import CustomVariable from './variables/custom_variable.vue'; import TextVariable from './variables/text_variable.vue'; -import { setPromCustomVariablesFromUrl } from '../utils'; +import { setCustomVariablesFromUrl } from '../utils'; export default { components: { @@ -10,12 +10,12 @@ export default { TextVariable, }, computed: { - ...mapState('monitoringDashboard', ['promVariables']), + ...mapState('monitoringDashboard', ['variables']), }, methods: { ...mapActions('monitoringDashboard', ['fetchDashboardData', 'updateVariableValues']), refreshDashboard(variable, value) { - if (this.promVariables[variable].value !== value) { + if (this.variables[variable].value !== value) { const changedVariable = { key: variable, value }; // update the Vuex store this.updateVariableValues(changedVariable); @@ -24,7 +24,7 @@ export default { // mutation respond directly. // This can be further investigate in // https://gitlab.com/gitlab-org/gitlab/-/issues/217713 - setPromCustomVariablesFromUrl(this.promVariables); + setCustomVariablesFromUrl(this.variables); // fetch data this.fetchDashboardData(); } @@ -41,7 +41,7 @@ export default {