Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add spinner and update export modal state handling and styles
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Apr 13, 2022
commit d0e9a9d0c6fec9cc085c6e37b30090425a15da44
55 changes: 31 additions & 24 deletions src/components/ExportSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
</CheckboxRadioSwitch>
<em class="section__description">{{ description }}</em>
</div>
<!-- TODO since TrashbinMigrator depends on FilesMigrator server should have some sort of migrator dependency API -->
</div>

<!-- <span>Migrators: {{ selectedMigrators }}</span> -->
Expand All @@ -60,13 +59,15 @@
</template>
{{ t('user_migration', 'Export') }}
</Button>
<Button v-else
type="secondary"
:aria-label="t('user_migration', 'Show export status')"
:disabled="status.current === 'import'"
@click.stop.prevent="openModal">
{{ t('user_migration', 'Show status')}}
</Button>
<div class="section__status" v-else>
<Button type="secondary"
:aria-label="t('user_migration', 'Show export status')"
:disabled="status.current === 'import'"
@click.stop.prevent="openModal">
{{ t('user_migration', 'Show status')}}
</Button>
<span class="settings-hint">{{ t('user_migration', 'Export in progress…') }}</span>
</div>

<Modal v-if="modalOpened"
@close="closeModal">
Expand All @@ -81,10 +82,7 @@
</template>
</EmptyContent>
<!-- TODO show list of data currently being exported -->
<!-- TODO use spinner as percentage of export complete cannot be queried from server -->
<ProgressBar size="medium"
:value="60"
:error="error" />
<div class="section__loading icon-loading" />
</div>
</Modal>
</div>
Expand All @@ -101,7 +99,6 @@ import EmptyContent from '@nextcloud/vue/dist/Components/EmptyContent'
import CheckboxRadioSwitch from '@nextcloud/vue/dist/Components/CheckboxRadioSwitch'
import Modal from '@nextcloud/vue/dist/Components/Modal'
import PackageDown from 'vue-material-design-icons/PackageDown'
import ProgressBar from '@nextcloud/vue/dist/Components/ProgressBar'

import { APP_ID } from '../shared/constants'

Expand All @@ -121,11 +118,10 @@ export default {

components: {
Button,
CheckboxRadioSwitch,
EmptyContent,
PackageDown,
Modal,
ProgressBar,
CheckboxRadioSwitch,
PackageDown,
},

data() {
Expand Down Expand Up @@ -185,14 +181,25 @@ export default {
}
}

.section__modal {
align-self: center;
margin: 20px auto;
width: 80%;
height: 80%;
.section__status {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 0 20px;

.settings-hint {
margin: auto 0;
};
}

.section__modal {
margin: 110px auto;

&::v-deep .empty-content {
margin-top: 0;
}

.section__loading {
height: 40px;
margin-top: 20px;
}
}
</style>