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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-07-27 15:10:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-27 15:10:33 +0300
commitfdf32113c3924f7faec91101282fc28ec42fc869 (patch)
tree388fdb9982d5ae80c8bc9b9bdcc0dde98cd6ead9 /app/assets/javascripts/repository
parent5add82515889cf332b65bbf59394079222dc66b3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/repository')
-rw-r--r--app/assets/javascripts/repository/components/blob_content_viewer.vue23
-rw-r--r--app/assets/javascripts/repository/components/blob_viewers/image_viewer.vue2
-rw-r--r--app/assets/javascripts/repository/constants.js2
3 files changed, 24 insertions, 3 deletions
diff --git a/app/assets/javascripts/repository/components/blob_content_viewer.vue b/app/assets/javascripts/repository/components/blob_content_viewer.vue
index a34ed065323..bdb78bab909 100644
--- a/app/assets/javascripts/repository/components/blob_content_viewer.vue
+++ b/app/assets/javascripts/repository/components/blob_content_viewer.vue
@@ -21,7 +21,13 @@ import projectInfoQuery from '../queries/project_info.query.graphql';
import getRefMixin from '../mixins/get_ref';
import userInfoQuery from '../queries/user_info.query.graphql';
import applicationInfoQuery from '../queries/application_info.query.graphql';
-import { DEFAULT_BLOB_INFO, TEXT_FILE_TYPE, LFS_STORAGE, LEGACY_FILE_TYPES } from '../constants';
+import {
+ DEFAULT_BLOB_INFO,
+ TEXT_FILE_TYPE,
+ LFS_STORAGE,
+ LEGACY_FILE_TYPES,
+ CODEOWNERS_FILE_NAME,
+} from '../constants';
import BlobButtonGroup from './blob_button_group.vue';
import ForkSuggestion from './fork_suggestion.vue';
import { loadViewer } from './blob_viewers';
@@ -32,6 +38,7 @@ export default {
BlobButtonGroup,
BlobContent,
GlLoadingIcon,
+ CodeownersValidation: () => import('ee_component/blob/components/codeowners_validation.vue'),
GlButton,
ForkSuggestion,
WebIdeLink,
@@ -79,7 +86,7 @@ export default {
const queryVariables = {
projectPath: this.projectPath,
filePath: this.path,
- ref: this.originalBranch || this.ref,
+ ref: this.currentRef,
refType: this.refType?.toUpperCase() || null,
shouldFetchRawText: true,
};
@@ -171,6 +178,12 @@ export default {
return nodes[0] || {};
},
+ currentRef() {
+ return this.originalBranch || this.ref;
+ },
+ isCodeownersFile() {
+ return this.path.includes(CODEOWNERS_FILE_NAME);
+ },
viewer() {
const { richViewer, simpleViewer } = this.blobInfo;
return this.activeViewerType === RICH_BLOB_VIEWER ? richViewer : simpleViewer;
@@ -402,6 +415,12 @@ export default {
:fork-path="forkPath"
@cancel="setForkTarget(null)"
/>
+ <codeowners-validation
+ v-if="isCodeownersFile"
+ :current-ref="currentRef"
+ :project-path="projectPath"
+ :file-path="path"
+ />
<blob-content
v-if="!blobViewer"
class="js-syntax-highlight"
diff --git a/app/assets/javascripts/repository/components/blob_viewers/image_viewer.vue b/app/assets/javascripts/repository/components/blob_viewers/image_viewer.vue
index 014f1abc121..9a8bb8e4aa6 100644
--- a/app/assets/javascripts/repository/components/blob_viewers/image_viewer.vue
+++ b/app/assets/javascripts/repository/components/blob_viewers/image_viewer.vue
@@ -8,7 +8,7 @@ export default {
},
data() {
return {
- url: this.blob.rawPath,
+ url: this.blob.externalStorageUrl || this.blob.rawPath,
alt: this.blob.name,
};
},
diff --git a/app/assets/javascripts/repository/constants.js b/app/assets/javascripts/repository/constants.js
index b711f671850..4327b237c8c 100644
--- a/app/assets/javascripts/repository/constants.js
+++ b/app/assets/javascripts/repository/constants.js
@@ -114,3 +114,5 @@ export const POLLING_INTERVAL_BACKOFF = 2;
export const CONFLICTS_MODAL_ID = 'fork-sync-conflicts-modal';
export const FORK_UPDATED_EVENT = 'fork:updated';
+
+export const CODEOWNERS_FILE_NAME = 'CODEOWNERS';