Skip to content

Commit a34d7fd

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 5f89187 commit a34d7fd

File tree

72 files changed

+1290
-308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1290
-308
lines changed

app/assets/javascripts/analytics/product_analytics/activity_charts_bundle.js

-28
This file was deleted.

app/assets/javascripts/analytics/product_analytics/components/activity_chart.vue

-45
This file was deleted.

app/assets/javascripts/api/bulk_imports_api.js

+15
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@ import { buildApiUrl } from '~/api/api_utils';
22
import axios from '~/lib/utils/axios_utils';
33

44
const BULK_IMPORT_ENTITIES_PATH = '/api/:version/bulk_imports/entities';
5+
const BULK_IMPORT_ENTITIES_FAILURES_PATH =
6+
'/api/:version/bulk_imports/:id/entities/:entity_id/failures';
57

68
export const getBulkImportsHistory = (params) =>
79
axios.get(buildApiUrl(BULK_IMPORT_ENTITIES_PATH), { params });
10+
11+
export const getBulkImportFailures = (id, entityId, { page, perPage }) => {
12+
const failuresPath = buildApiUrl(BULK_IMPORT_ENTITIES_FAILURES_PATH)
13+
.replace(':id', encodeURIComponent(id))
14+
.replace(':entity_id', encodeURIComponent(entityId));
15+
16+
return axios.get(failuresPath, {
17+
params: {
18+
page,
19+
per_page: perPage,
20+
},
21+
});
22+
};

app/assets/javascripts/import/constants.js

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
22
import { __, s__ } from '~/locale';
33

4+
export const BULK_IMPORT_STATIC_ITEMS = {
5+
badges: __('Badge'),
6+
boards: s__('IssueBoards|Board'),
7+
epics: __('Epic'),
8+
issues: __('Issue'),
9+
labels: __('Label'),
10+
members: __('Member'),
11+
merge_requests: __('Merge request'),
12+
milestones: __('Milestone'),
13+
project: __('Project'),
14+
};
15+
416
const STATISTIC_ITEMS = {
517
diff_note: __('Diff notes'),
618
issue: __('Issues'),
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,44 @@
11
<script>
2+
import { __ } from '~/locale';
23
import ImportDetailsTable from '~/import/details/components/import_details_table.vue';
34
45
export default {
56
name: 'BulkImportDetailsApp',
67
components: { ImportDetailsTable },
8+
9+
fields: [
10+
{
11+
key: 'relation',
12+
label: __('Type'),
13+
tdClass: 'gl-white-space-nowrap',
14+
},
15+
{
16+
key: 'source_title',
17+
label: __('Title'),
18+
tdClass: 'gl-md-w-30 gl-word-break-word',
19+
},
20+
{
21+
key: 'error',
22+
label: __('Error'),
23+
},
24+
{
25+
key: 'correlation_id_value',
26+
label: __('Correlation ID'),
27+
},
28+
],
29+
30+
LOCAL_STORAGE_KEY: 'gl-bulk-import-details-page-size',
731
};
832
</script>
933

1034
<template>
1135
<div>
1236
<h1>{{ s__('Import|GitLab Migration details') }}</h1>
13-
<import-details-table />
37+
38+
<import-details-table
39+
bulk-import
40+
:fields="$options.fields"
41+
:local-storage-key="$options.LOCAL_STORAGE_KEY"
42+
/>
1443
</div>
1544
</template>
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,44 @@
11
<script>
2+
import { __ } from '~/locale';
23
import ImportDetailsTable from './import_details_table.vue';
34
45
export default {
6+
name: 'ImportDetailsApp',
57
components: { ImportDetailsTable },
8+
9+
fields: [
10+
{
11+
key: 'type',
12+
label: __('Type'),
13+
tdClass: 'gl-white-space-nowrap',
14+
},
15+
{
16+
key: 'title',
17+
label: __('Title'),
18+
tdClass: 'gl-md-w-30 gl-word-break-word',
19+
},
20+
{
21+
key: 'provider_url',
22+
label: __('URL'),
23+
tdClass: 'gl-white-space-nowrap',
24+
},
25+
{
26+
key: 'details',
27+
label: __('Details'),
28+
},
29+
],
30+
31+
LOCAL_STORAGE_KEY: 'gl-import-details-page-size',
632
};
733
</script>
834

935
<template>
1036
<div>
1137
<h1>{{ s__('Import|GitHub import details') }}</h1>
12-
<import-details-table />
38+
39+
<import-details-table
40+
:fields="$options.fields"
41+
:local-storage-key="$options.LOCAL_STORAGE_KEY"
42+
/>
1343
</div>
1444
</template>

app/assets/javascripts/import/details/components/import_details_table.vue

+63-33
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<script>
22
import { GlEmptyState, GlIcon, GlLink, GlLoadingIcon, GlTable } from '@gitlab/ui';
3-
import { __, s__ } from '~/locale';
3+
import { s__ } from '~/locale';
44
import { createAlert } from '~/alert';
55
import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils';
66
import { getParameterValues } from '~/lib/utils/url_utility';
77
88
import PaginationBar from '~/vue_shared/components/pagination_bar/pagination_bar.vue';
9-
import { STATISTIC_ITEMS } from '../../constants';
9+
import { getBulkImportFailures } from '~/rest_api';
10+
import { BULK_IMPORT_STATIC_ITEMS, STATISTIC_ITEMS } from '../../constants';
1011
import { fetchImportFailures } from '../api';
1112
1213
const DEFAULT_PAGE_SIZE = 20;
@@ -21,28 +22,6 @@ export default {
2122
PaginationBar,
2223
},
2324
STATISTIC_ITEMS,
24-
LOCAL_STORAGE_KEY: 'gl-import-details-page-size',
25-
fields: [
26-
{
27-
key: 'type',
28-
label: __('Type'),
29-
tdClass: 'gl-white-space-nowrap',
30-
},
31-
{
32-
key: 'title',
33-
label: __('Title'),
34-
tdClass: 'gl-md-w-30 gl-word-break-word',
35-
},
36-
{
37-
key: 'provider_url',
38-
label: __('URL'),
39-
tdClass: 'gl-white-space-nowrap',
40-
},
41-
{
42-
key: 'details',
43-
label: __('Details'),
44-
},
45-
],
4625
4726
i18n: {
4827
fetchErrorMessage: s__('Import|An error occurred while fetching import details.'),
@@ -55,6 +34,25 @@ export default {
5534
},
5635
},
5736
37+
props: {
38+
bulkImport: {
39+
type: Boolean,
40+
required: false,
41+
default: false,
42+
},
43+
44+
fields: {
45+
type: Array,
46+
required: true,
47+
},
48+
49+
localStorageKey: {
50+
type: String,
51+
required: false,
52+
default: '',
53+
},
54+
},
55+
5856
data() {
5957
return {
6058
items: [],
@@ -97,18 +95,28 @@ export default {
9795
this.loadImportFailures();
9896
},
9997
98+
fetchFn(params) {
99+
return this.bulkImport
100+
? getBulkImportFailures(
101+
getParameterValues('id')[0],
102+
getParameterValues('entity_id')[0],
103+
params,
104+
)
105+
: fetchImportFailures(this.failuresPath, {
106+
projectId: getParameterValues('project_id')[0],
107+
...params,
108+
});
109+
},
110+
100111
async loadImportFailures() {
101-
if (!this.failuresPath) {
112+
if (!this.bulkImport && !this.failuresPath) {
102113
return;
103114
}
104115
105116
this.loading = true;
117+
106118
try {
107-
const response = await fetchImportFailures(this.failuresPath, {
108-
projectId: getParameterValues('project_id')[0],
109-
page: this.page,
110-
perPage: this.perPage,
111-
});
119+
const response = await this.fetchFn({ page: this.page, perPage: this.perPage });
112120
113121
const { page, perPage, totalPages, total } = parseIntPagination(
114122
normalizeHeaders(response.headers),
@@ -123,13 +131,17 @@ export default {
123131
}
124132
this.loading = false;
125133
},
134+
135+
itemTypeText(type) {
136+
return (this.bulkImport ? BULK_IMPORT_STATIC_ITEMS[type] : STATISTIC_ITEMS[type]) || type;
137+
},
126138
},
127139
};
128140
</script>
129141

130142
<template>
131143
<div>
132-
<gl-table :fields="$options.fields" :items="items" class="gl-mt-5" :busy="loading" show-empty>
144+
<gl-table :fields="fields" :items="items" class="gl-mt-5" :busy="loading" show-empty>
133145
<template #table-busy>
134146
<gl-loading-icon size="lg" class="gl-my-5" />
135147
</template>
@@ -139,20 +151,38 @@ export default {
139151
</template>
140152

141153
<template #cell(type)="{ item: { type } }">
142-
{{ $options.STATISTIC_ITEMS[type] }}
154+
{{ itemTypeText(type) }}
143155
</template>
144156
<template #cell(provider_url)="{ item: { provider_url } }">
145157
<gl-link v-if="provider_url" :href="provider_url" target="_blank">
146158
{{ provider_url }}
147159
<gl-icon name="external-link" />
148160
</gl-link>
149161
</template>
162+
163+
<template #cell(relation)="{ item: { relation } }">
164+
{{ itemTypeText(relation) }}
165+
</template>
166+
<template #cell(source_title)="{ item: { source_title, source_url } }">
167+
<gl-link v-if="source_url" :href="source_url" target="_blank">
168+
{{ source_title }}
169+
<gl-icon name="external-link" />
170+
</gl-link>
171+
<span v-else>
172+
{{ source_title }}
173+
</span>
174+
</template>
175+
<template #cell(error)="{ item: { exception_class, exception_message } }">
176+
<strong>{{ exception_class }}</strong>
177+
<p>{{ exception_message }}</p>
178+
</template>
150179
</gl-table>
180+
151181
<pagination-bar
152182
v-if="hasItems"
153183
:page-info="pageInfo"
154184
class="gl-mt-5"
155-
:storage-key="$options.LOCAL_STORAGE_KEY"
185+
:storage-key="localStorageKey"
156186
@set-page="setPage"
157187
@set-page-size="setPageSize"
158188
/>

app/assets/javascripts/pages/import/bulk_imports/details/index.js

-5
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,9 @@ export const initBulkImportDetails = () => {
88
return null;
99
}
1010

11-
const { failuresPath } = el.dataset;
12-
1311
return new Vue({
1412
el,
1513
name: 'BulkImportDetailsRoot',
16-
provide: {
17-
failuresPath,
18-
},
1914
render(createElement) {
2015
return createElement(BulkImportDetailsApp);
2116
},

app/assets/javascripts/pages/projects/product_analytics/graphs/index.js

-3
This file was deleted.

0 commit comments

Comments
 (0)