Skip to content
Snippets Groups Projects

CE Improve import status table UI

Closed Luke Bennett requested to merge import-go-to-project-cta into master
9 unresolved threads
Compare and Show latest version
8 files
+ 64
60
Compare changes
  • Side-by-side
  • Inline
Files
8
<script>
<script>
import { mapActions, mapState } from 'vuex';
import { mapActions, mapState, mapGetters } from 'vuex';
import ImportedProjectTableRow from './imported_project_table_row.vue';
import ImportedProjectTableRow from './imported_project_table_row.vue';
import ProviderRepoTableRow from './provider_repo_table_row.vue';
import ProviderRepoTableRow from './provider_repo_table_row.vue';
 
import simplePoll from '../../lib/utils/simple_poll';
 
import LoadingButton from '../../vue_shared/components/loading_button.vue';
 
import eventHub from '../event_hub';
export default {
export default {
name: 'Import',
name: 'Import',
@@ -9,6 +12,7 @@
@@ -9,6 +12,7 @@
components: {
components: {
ImportedProjectTableRow,
ImportedProjectTableRow,
ProviderRepoTableRow,
ProviderRepoTableRow,
 
LoadingButton,
},
},
props: {
props: {
@@ -19,18 +23,23 @@
@@ -19,18 +23,23 @@
},
},
computed: {
computed: {
...mapState(['importedProjects', 'providerRepos', 'isLoadingRepos'])
...mapState(['importedProjects', 'providerRepos', 'isLoadingRepos']),
 
...mapGetters(['isLoadingAnyImport']),
},
},
mounted() {
mounted() {
this.fetchRepos();
return this.fetchRepos().then(this.pollJobs);
},
},
methods: {
methods: {
...mapActions(['fetchRepos']),
...mapActions(['fetchRepos', 'fetchJobs']),
importAll() {
importAll() {
console.log('import all');
eventHub.$emit('importAll');
 
},
 
 
pollJobs() {
 
return simplePoll((continuePolling) => this.fetchJobs().then(() => continuePolling()), 3000, Infinity)
},
},
},
},
}
}
@@ -42,13 +51,12 @@
@@ -42,13 +51,12 @@
<p class="light text-nowrap mt-2 my-sm-0">
<p class="light text-nowrap mt-2 my-sm-0">
{{ s__('Import|Select the projects you want to import') }}
{{ s__('Import|Select the projects you want to import') }}
</p>
</p>
<button
<loading-button
 
:loading="isLoadingAnyImport"
 
:label="s__('Import|Import all repositories')"
type="button"
type="button"
class="btn btn-success"
@click="importAll"
@click="importAll"
>
/>
{{ s__('Import|Import all repositories') }}
</button>
</div>
</div>
<gl-loading-icon
<gl-loading-icon
v-if="isLoadingRepos"
v-if="isLoadingRepos"
Loading