diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-12 15:14:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-12 15:14:10 +0300 |
commit | da646aac6c559584f63d1fc06132d7351abcfac6 (patch) | |
tree | e6e17878b47c081dcd7e161e9bfc3bacd535c8a6 /app/assets/javascripts | |
parent | 612dd7d31ab927dd79968a6be7cb36599291bace (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts')
5 files changed, 35 insertions, 13 deletions
diff --git a/app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js b/app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js index 92cdd1c600f..b9e4c7b68b0 100644 --- a/app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js +++ b/app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js @@ -31,6 +31,7 @@ const MAX_CHAR_LIMIT = 2000; const MAX_MERMAID_BLOCK_LIMIT = 50; // Max # of `&` allowed in Chaining of links syntax const MAX_CHAINING_OF_LINKS_LIMIT = 30; +const BUFFER_IFRAME_HEIGHT = 10; // Keep a map of mermaid blocks we've already rendered. const elsProcessingMap = new WeakMap(); let renderedMermaidBlocks = 0; @@ -117,9 +118,9 @@ function renderMermaidEl(el, source) { if (event.origin !== 'null' || event.source !== iframeEl.contentWindow) { return; } - const { h, w } = event.data; - iframeEl.width = w; - iframeEl.height = h; + const { h } = event.data; + iframeEl.width = '100%'; + iframeEl.height = `${h + BUFFER_IFRAME_HEIGHT}px`; }, false, ); diff --git a/app/assets/javascripts/integrations/edit/components/dynamic_field.vue b/app/assets/javascripts/integrations/edit/components/dynamic_field.vue index 258cd1bf365..4b0579a5beb 100644 --- a/app/assets/javascripts/integrations/edit/components/dynamic_field.vue +++ b/app/assets/javascripts/integrations/edit/components/dynamic_field.vue @@ -153,7 +153,7 @@ export default { :invalid-feedback="__('This field is required.')" :state="valid" > - <template #description> + <template v-if="!isCheckbox" #description> <span v-safe-html:[$options.helpHtmlConfig]="help"></span> </template> @@ -161,6 +161,9 @@ export default { <input :name="fieldName" type="hidden" :value="model || false" /> <gl-form-checkbox :id="fieldId" v-model="model" :disabled="isInheriting"> {{ checkboxLabel || humanizedTitle }} + <template #help> + <span v-safe-html:[$options.helpHtmlConfig]="help"></span> + </template> </gl-form-checkbox> </template> <template v-else-if="isSelect"> diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index e221a54d9c6..376134afef0 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -101,6 +101,21 @@ function deferredInitialisation() { initFeatureHighlight(); initCopyCodeButton(); + const helpToggle = document.querySelector('.header-help-dropdown-toggle'); + if (helpToggle) { + helpToggle.addEventListener( + 'click', + () => { + import(/* webpackChunkName: 'versionCheck' */ './gitlab_version_check') + .then(({ default: initGitlabVersionCheck }) => { + initGitlabVersionCheck(); + }) + .catch(() => {}); + }, + { once: true }, + ); + } + const search = document.querySelector('#search'); if (search) { search.addEventListener( diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/details_header.vue b/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/details_header.vue index d988ad8d8ca..29c181f04fb 100644 --- a/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/details_header.vue +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/details_header.vue @@ -143,6 +143,7 @@ export default { </template> <template #right-actions> <gl-dropdown + v-if="!deleteButtonDisabled" icon="ellipsis_v" text="More actions" :text-sr-only="true" @@ -150,11 +151,7 @@ export default { no-caret right > - <gl-dropdown-item - variant="danger" - :disabled="deleteButtonDisabled" - @click="$emit('delete')" - > + <gl-dropdown-item variant="danger" @click="$emit('delete')"> {{ __('Delete image repository') }} </gl-dropdown-item> </gl-dropdown> diff --git a/app/assets/javascripts/repository/components/blob_controls.vue b/app/assets/javascripts/repository/components/blob_controls.vue index 4041315f5ec..bde1b217ec9 100644 --- a/app/assets/javascripts/repository/components/blob_controls.vue +++ b/app/assets/javascripts/repository/components/blob_controls.vue @@ -63,19 +63,25 @@ export default { }, computed: { filePath() { - const { path } = this.$route.params; - updateElementsVisibility('.tree-controls', !path); - return path; + return this.$route.params.path; + }, + showBlobControls() { + return this.filePath && this.$route.name === 'blobPathDecoded'; }, blobInfo() { return this.project?.repository?.blobs?.nodes[0] || {}; }, }, + watch: { + showBlobControls(shouldShow) { + updateElementsVisibility('.tree-controls', !shouldShow); + }, + }, }; </script> <template> - <div v-if="filePath"> + <div v-if="showBlobControls"> <gl-button data-testid="find" :href="blobInfo.findFilePath" :class="$options.buttonClassList"> {{ $options.i18n.findFile }} </gl-button> |