Commit 06157e05 authored by Illya Klymov's avatar Illya Klymov

Address reviewer comments

* switch from gon to provide
parent 59b84720
...@@ -39,6 +39,8 @@ export default { ...@@ -39,6 +39,8 @@ export default {
TimeAgo, TimeAgo,
}, },
inject: ['assets'],
data() { data() {
return { return {
loading: true, loading: true,
...@@ -122,8 +124,6 @@ export default { ...@@ -122,8 +124,6 @@ export default {
this.paginationConfig.page = 1; this.paginationConfig.page = 1;
}, },
}, },
gitlabLogo: window.gon.gitlab_logo,
}; };
</script> </script>
...@@ -133,7 +133,7 @@ export default { ...@@ -133,7 +133,7 @@ export default {
class="gl-border-solid gl-border-gray-200 gl-border-0 gl-border-b-1 gl-display-flex gl-align-items-center" class="gl-border-solid gl-border-gray-200 gl-border-0 gl-border-b-1 gl-display-flex gl-align-items-center"
> >
<h1 class="gl-my-0 gl-py-4 gl-font-size-h1"> <h1 class="gl-my-0 gl-py-4 gl-font-size-h1">
<img :src="$options.gitlabLogo" class="gl-w-6 gl-h-6 gl-mb-2 gl-display-inline gl-mr-2" /> <img :src="assets.gitlabLogo" class="gl-w-6 gl-h-6 gl-mb-2 gl-display-inline gl-mr-2" />
{{ s__('BulkImport|Project import history') }} {{ s__('BulkImport|Project import history') }}
</h1> </h1>
</div> </div>
......
...@@ -6,6 +6,12 @@ function mountImportHistoryApp(mountElement) { ...@@ -6,6 +6,12 @@ function mountImportHistoryApp(mountElement) {
return new Vue({ return new Vue({
el: mountElement, el: mountElement,
name: 'ImportHistoryRoot',
provide: {
assets: {
gitlabLogo: mountElement.dataset.logo,
},
},
render(createElement) { render(createElement) {
return createElement(ImportHistoryApp); return createElement(ImportHistoryApp);
}, },
......
- add_to_breadcrumbs _('Create a new project'), new_project_path - add_to_breadcrumbs _('Create a new project'), new_project_path
- page_title _('Import history') - page_title _('Import history')
#import-history-mount-element #import-history-mount-element{ data: { logo: asset_url('gitlab_logo.png') } }
...@@ -52,10 +52,10 @@ describe('ImportHistoryApp', () => { ...@@ -52,10 +52,10 @@ describe('ImportHistoryApp', () => {
function createComponent({ shallow = true } = {}) { function createComponent({ shallow = true } = {}) {
const mountFn = shallow ? shallowMount : mount; const mountFn = shallow ? shallowMount : mount;
wrapper = mountFn( wrapper = mountFn(ImportHistoryApp, {
ImportHistoryApp, provide: { assets: { gitlabLogo: 'http://dummy.host' } },
shallow ? { stubs: { GlTable: { ...stubComponent(GlTable), props: ['items'] } } } : {}, stubs: shallow ? { GlTable: { ...stubComponent(GlTable), props: ['items'] } } : {},
); });
} }
const originalApiVersion = gon.api_version; const originalApiVersion = gon.api_version;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment