Skip to content
代码片段 群组 项目
提交 7af59d4f 编辑于 作者: Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
浏览文件

Merge branch 'revert-363436-due-to-breaking-changes' into 'master'

Revert "Merge branch '363436-incorrect-timestamps-and-messages' into 'master'"

See merge request gitlab-org/gitlab!91315
No related branches found
No related tags found
无相关合并请求
......@@ -35,7 +35,7 @@ const fetchData = (projectPath, path, ref, offset) => {
gon.relative_url_root || '/',
projectPath,
'/-/refs/',
encodeURIComponent(ref),
ref,
'/logs_tree/',
encodeURIComponent(removeLeadingSlash(path)),
);
......
......@@ -2,7 +2,6 @@
import { GlSkeletonLoader, GlButton } from '@gitlab/ui';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { sprintf, __ } from '~/locale';
import { cleanLeadingSeparator } from '~/lib/utils/url_utility';
import getRefMixin from '../../mixins/get_ref';
import projectPathQuery from '../../queries/project_path.query.graphql';
import TableHeader from './header.vue';
......@@ -104,14 +103,13 @@ export default {
return this.rowNumbers[key];
},
getCommit(flatPath, type) {
getCommit(fileName, type) {
if (!this.glFeatures.lazyLoadCommits) {
return {};
}
return this.commits.find(
(commitEntry) =>
cleanLeadingSeparator(commitEntry.filePath) === flatPath && commitEntry.type === type,
(commitEntry) => commitEntry.fileName === fileName && commitEntry.type === type,
);
},
},
......@@ -154,7 +152,7 @@ export default {
:loading-path="loadingPath"
:total-entries="totalEntries"
:row-number="generateRowNumber(entry.flatPath, entry.id, index)"
:commit-info="getCommit(entry.flatPath, entry.type)"
:commit-info="getCommit(entry.name, entry.type)"
v-on="$listeners"
/>
</template>
......
......@@ -39,11 +39,10 @@ describe('commits service', () => {
expect(axios.get).toHaveBeenCalledWith(testUrl, { params: { format: 'json', offset } });
});
it('encodes the path and ref correctly', async () => {
await requestCommits(1, 'some-project', 'with $peci@l ch@rs/', 'r€f-#');
it('encodes the path correctly', async () => {
await requestCommits(1, 'some-project', 'with $peci@l ch@rs/');
const encodedUrl =
'/some-project/-/refs/r%E2%82%ACf-%23/logs_tree/with%20%24peci%40l%20ch%40rs%2F';
const encodedUrl = '/some-project/-/refs/main/logs_tree/with%20%24peci%40l%20ch%40rs%2F';
expect(axios.get).toHaveBeenCalledWith(encodedUrl, expect.anything());
});
......
......@@ -11,7 +11,7 @@ const MOCK_BLOBS = [
{
id: '123abc',
sha: '123abc',
flatPath: 'main/blob.md',
flatPath: 'blob',
name: 'blob.md',
type: 'blob',
webPath: '/blob',
......@@ -19,7 +19,7 @@ const MOCK_BLOBS = [
{
id: '124abc',
sha: '124abc',
flatPath: 'main/blob2.md',
flatPath: 'blob2',
name: 'blob2.md',
type: 'blob',
webUrl: 'http://test.com',
......@@ -27,7 +27,7 @@ const MOCK_BLOBS = [
{
id: '125abc',
sha: '125abc',
flatPath: 'main/blob3.md',
flatPath: 'blob3',
name: 'blob3.md',
type: 'blob',
webUrl: 'http://test.com',
......@@ -37,21 +37,21 @@ const MOCK_BLOBS = [
const MOCK_COMMITS = [
{
filePath: 'main/blob.md',
fileName: 'blob.md',
type: 'blob',
commit: {
message: 'Updated blob.md',
},
},
{
filePath: 'main/blob2.md',
fileName: 'blob2.md',
type: 'blob',
commit: {
message: 'Updated blob2.md',
},
},
{
filePath: 'main/blob3.md',
fileName: 'blob3.md',
type: 'blob',
commit: {
message: 'Updated blob3.md',
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册