diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-11 15:08:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-11 15:08:52 +0300 |
commit | 05b5c609cb8c260b10c2eb1b92b711dc82d32c3f (patch) | |
tree | 05253c66806b17c5b1f9f13addab59524d536fc4 /app/assets/javascripts/repository | |
parent | 1078b7bf25c2cb6e03c57da9ae25b0512858556f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/repository')
4 files changed, 10 insertions, 3 deletions
diff --git a/app/assets/javascripts/repository/components/last_commit.vue b/app/assets/javascripts/repository/components/last_commit.vue index c0c599f4b3c..968bd9af84f 100644 --- a/app/assets/javascripts/repository/components/last_commit.vue +++ b/app/assets/javascripts/repository/components/last_commit.vue @@ -108,7 +108,12 @@ export default { class="avatar-cell" /> <span v-else class="avatar-cell user-avatar-link"> - <img :src="$options.defaultAvatarUrl" width="40" height="40" class="avatar s40" /> + <img + :src="commit.authorGravatar || $options.defaultAvatarUrl" + width="40" + height="40" + class="avatar s40" + /> </span> <div class="commit-detail flex-list"> <div class="commit-content qa-commit-content"> diff --git a/app/assets/javascripts/repository/components/table/row.vue b/app/assets/javascripts/repository/components/table/row.vue index f97c8ae1f74..8703796b116 100644 --- a/app/assets/javascripts/repository/components/table/row.vue +++ b/app/assets/javascripts/repository/components/table/row.vue @@ -1,4 +1,5 @@ <script> +import { escapeRegExp } from 'lodash'; import { GlBadge, GlLink, GlSkeletonLoading, GlTooltipDirective, GlLoadingIcon } from '@gitlab/ui'; import { visitUrl } from '~/lib/utils/url_utility'; import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; @@ -105,7 +106,7 @@ export default { return this.isFolder ? 'router-link' : 'a'; }, fullPath() { - return this.path.replace(new RegExp(`^${this.currentPath}/`), ''); + return this.path.replace(new RegExp(`^${escapeRegExp(this.currentPath)}/`), ''); }, shortSha() { return this.sha.slice(0, 8); diff --git a/app/assets/javascripts/repository/graphql.js b/app/assets/javascripts/repository/graphql.js index 6936c08d852..265df20636b 100644 --- a/app/assets/javascripts/repository/graphql.js +++ b/app/assets/javascripts/repository/graphql.js @@ -48,7 +48,7 @@ const defaultClient = createDefaultClient( case 'TreeEntry': case 'Submodule': case 'Blob': - return `${obj.flatPath}-${obj.id}`; + return `${escape(obj.flatPath)}-${obj.id}`; default: // If the type doesn't match any of the above we fallback // to using the default Apollo ID diff --git a/app/assets/javascripts/repository/queries/pathLastCommit.query.graphql b/app/assets/javascripts/repository/queries/pathLastCommit.query.graphql index c812614e94d..a22cadf0e8d 100644 --- a/app/assets/javascripts/repository/queries/pathLastCommit.query.graphql +++ b/app/assets/javascripts/repository/queries/pathLastCommit.query.graphql @@ -10,6 +10,7 @@ query pathLastCommit($projectPath: ID!, $path: String, $ref: String!) { webUrl authoredDate authorName + authorGravatar author { name avatarUrl |