-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
made ImportResults into reusable component
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
- Loading branch information
Showing
5 changed files
with
99 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,80 @@ | ||
<template> | ||
<NcDialog :name="t('tables', 'Result')" :open.sync="show" size="small"> | ||
<template #actions> | ||
<NcButton :aria-label="t('tables', 'Close')" @click="hideDialog"> | ||
{{ t('tables', 'Close') }} | ||
</NcButton> | ||
</template> | ||
<table class="file_import__results"> | ||
<caption> | ||
{{ t('tables', 'Result') }} | ||
</caption> | ||
|
||
<table class="import_modal__results"> | ||
<tbody> | ||
<tr> | ||
<td>{{ t('tables', 'Found columns') }}</td> | ||
<td>{{ results.found_columns_count }}</td> | ||
</tr> | ||
<tbody> | ||
<tr> | ||
<td>{{ t('tables', 'Found columns') }}</td> | ||
<td>{{ results.found_columns_count }}</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>{{ t('tables', 'Matching columns') }}</td> | ||
<td>{{ results.matching_columns_count }}</td> | ||
</tr> | ||
<tr> | ||
<td>{{ t('tables', 'Matching columns') }}</td> | ||
<td>{{ results.matching_columns_count }}</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>{{ t('tables', 'Created columns') }}</td> | ||
<td>{{ results.created_columns_count }}</td> | ||
</tr> | ||
<tr> | ||
<td>{{ t('tables', 'Created columns') }}</td> | ||
<td>{{ results.created_columns_count }}</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>{{ t('tables', 'Inserted rows') }}</td> | ||
<td>{{ results.inserted_rows_count }}</td> | ||
</tr> | ||
<tr> | ||
<td>{{ t('tables', 'Inserted rows') }}</td> | ||
<td>{{ results.inserted_rows_count }}</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>{{ t('tables', 'Value parsing errors') }}</td> | ||
<td>{{ results.errors_parsing_count }}</td> | ||
</tr> | ||
<tr> | ||
<td>{{ t('tables', 'Value parsing errors') }}</td> | ||
<td>{{ results.errors_parsing_count }}</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>{{ t('tables', 'Row creation errors') }}</td> | ||
<td>{{ results.errors_count }}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</NcDialog> | ||
<tr> | ||
<td>{{ t('tables', 'Row creation errors') }}</td> | ||
<td>{{ results.errors_count }}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</template> | ||
|
||
<script> | ||
import { NcDialog, NcButton } from '@nextcloud/vue' | ||
import { translate as t } from '@nextcloud/l10n' | ||
export default { | ||
name: 'ImportResults', | ||
components: { | ||
NcDialog, | ||
NcButton, | ||
}, | ||
props: { | ||
t: { | ||
type: Function, | ||
default: null, | ||
}, | ||
results: { | ||
found_columns_count: 0, | ||
matching_columns_count: 0, | ||
created_columns_count: 0, | ||
inserted_rows_count: 0, | ||
errors_parsing_count: 0, | ||
errors_count: 0, | ||
type: Object, | ||
default() { | ||
return { | ||
found_columns_count: 0, | ||
matching_columns_count: 0, | ||
created_columns_count: 0, | ||
inserted_rows_count: 0, | ||
errors_parsing_count: 0, | ||
errors_count: 0, | ||
} | ||
}, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
show: true, | ||
} | ||
}, | ||
methods: { | ||
hideDialog() { | ||
this.show = false | ||
}, | ||
t, | ||
}, | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.import_modal__results { | ||
width: 100%; | ||
margin-bottom: 10px; | ||
.file_import__results { | ||
margin: auto; | ||
min-width: 350px; | ||
max-width: 600px; | ||
& caption { | ||
font-weight: bold; | ||
margin: calc(var(--default-grid-baseline) * 2) auto; | ||
} | ||
} | ||
</style> |