diff options
Diffstat (limited to 'app/assets/javascripts/repository')
7 files changed, 24 insertions, 12 deletions
diff --git a/app/assets/javascripts/repository/components/breadcrumbs.vue b/app/assets/javascripts/repository/components/breadcrumbs.vue index 886e9d76cca..45c343c3f7f 100644 --- a/app/assets/javascripts/repository/components/breadcrumbs.vue +++ b/app/assets/javascripts/repository/components/breadcrumbs.vue @@ -242,7 +242,7 @@ export default { </li> <li v-if="renderAddToTreeDropdown" class="breadcrumb-item"> <gl-dropdown toggle-class="add-to-tree qa-add-to-tree ml-1"> - <template slot="button-content"> + <template #button-content> <span class="sr-only">{{ __('Add to tree') }}</span> <icon name="plus" :size="16" class="float-left" /> <icon name="chevron-down" :size="16" class="float-left" /> diff --git a/app/assets/javascripts/repository/components/last_commit.vue b/app/assets/javascripts/repository/components/last_commit.vue index a13f8ac65cf..010fc9a5d1a 100644 --- a/app/assets/javascripts/repository/components/last_commit.vue +++ b/app/assets/javascripts/repository/components/last_commit.vue @@ -121,9 +121,8 @@ export default { :href="commit.webUrl" :class="{ 'font-italic': !commit.message }" class="commit-row-message item-title" - > - {{ commit.title }} - </gl-link> + v-html="commit.titleHtml" + /> <gl-deprecated-button v-if="commit.description" :class="{ open: showDescription }" diff --git a/app/assets/javascripts/repository/components/table/row.vue b/app/assets/javascripts/repository/components/table/row.vue index f741a6df5d9..34424121390 100644 --- a/app/assets/javascripts/repository/components/table/row.vue +++ b/app/assets/javascripts/repository/components/table/row.vue @@ -167,9 +167,8 @@ export default { :href="commit.commitPath" :title="commit.message" class="str-truncated-100 tree-commit-link" - > - {{ commit.message }} - </gl-link> + v-html="commit.titleHtml" + /> <gl-skeleton-loading v-else :lines="1" class="h-auto" /> </td> <td class="tree-time-ago text-right cursor-default"> diff --git a/app/assets/javascripts/repository/queries/commit.fragment.graphql b/app/assets/javascripts/repository/queries/commit.fragment.graphql index 9bb13c475c7..be6897b9a16 100644 --- a/app/assets/javascripts/repository/queries/commit.fragment.graphql +++ b/app/assets/javascripts/repository/queries/commit.fragment.graphql @@ -1,6 +1,7 @@ fragment TreeEntryCommit on LogTreeCommit { sha message + titleHtml committedDate commitPath fileName diff --git a/app/assets/javascripts/repository/queries/pathLastCommit.query.graphql b/app/assets/javascripts/repository/queries/pathLastCommit.query.graphql index a22cadf0e8d..f54f09fd647 100644 --- a/app/assets/javascripts/repository/queries/pathLastCommit.query.graphql +++ b/app/assets/javascripts/repository/queries/pathLastCommit.query.graphql @@ -5,6 +5,7 @@ query pathLastCommit($projectPath: ID!, $path: String, $ref: String!) { lastCommit { sha title + titleHtml description message webUrl diff --git a/app/assets/javascripts/repository/router.js b/app/assets/javascripts/repository/router.js index 49e024ca4ff..c5646c32850 100644 --- a/app/assets/javascripts/repository/router.js +++ b/app/assets/javascripts/repository/router.js @@ -7,17 +7,28 @@ import TreePage from './pages/tree.vue'; Vue.use(VueRouter); export default function createRouter(base, baseRef) { + const treePathRoute = { + component: TreePage, + props: route => ({ + path: route.params.path?.replace(/^\//, '') || '/', + }), + }; + return new VueRouter({ mode: 'history', base: joinPaths(gon.relative_url_root || '', base), routes: [ { - path: `(/-)?/tree/${baseRef}/:path*`, + name: 'treePathDecoded', + // Sometimes the ref needs decoding depending on how the backend sends it to us + path: `(/-)?/tree/${decodeURI(baseRef)}/:path*`, + ...treePathRoute, + }, + { name: 'treePath', - component: TreePage, - props: route => ({ - path: route.params.path?.replace(/^\//, '') || '/', - }), + // Support without decoding as well just in case the ref doesn't need to be decoded + path: `(/-)?/tree/${baseRef}/:path*`, + ...treePathRoute, }, { path: '/', diff --git a/app/assets/javascripts/repository/utils/commit.js b/app/assets/javascripts/repository/utils/commit.js index 3973798605d..90ac01c5874 100644 --- a/app/assets/javascripts/repository/utils/commit.js +++ b/app/assets/javascripts/repository/utils/commit.js @@ -3,6 +3,7 @@ export function normalizeData(data, path, extra = () => {}) { return data.map(d => ({ sha: d.commit.id, message: d.commit.message, + titleHtml: d.commit_title_html, committedDate: d.commit.committed_date, commitPath: d.commit_path, fileName: d.file_name, |