-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pro 4257 modal property #2
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9415b9e
Export: add context menu and batch operation
falkodev 0228905
Export: add exclusion
falkodev 448c96b
Improve readibility
falkodev 26f2888
Improve readibility
falkodev d9954cc
Custom modal AposExportPiecesModal
falkodev 19cd495
Simplify export modal
falkodev ff307a2
Merge branch 'main' into pro-4257-modal-property
falkodev 131c5ad
Add operation prop
falkodev 2c8ddba
Display module label and count in basic modal
falkodev 32526cc
Lint
falkodev 1877a79
Rename variable criteria to operation
falkodev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"export": "Export", | ||
"exporting": "Exporting" | ||
"exporting": "Exporting", | ||
"exportModalDescription": "You've selected {{ count }} {{ type }} for export" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,160 @@ | ||
<template> | ||
<AposModal | ||
:modal="modal" | ||
class="apos-export-pieces" | ||
v-on="{ esc: cancel }" | ||
@no-modal="$emit('safe-close')" | ||
@inactive="modal.active = false" | ||
@show-modal="modal.showModal = true" | ||
@ready="ready" | ||
> | ||
<template #main> | ||
<AposModalBody> | ||
<template #bodyMain> | ||
<h2 class="apos-export-pieces__heading"> | ||
{{ $t('aposImportExport:export') }} {{ moduleLabel }} | ||
</h2> | ||
<p | ||
class="apos-export-pieces__description" | ||
> | ||
{{ $t('aposImportExport:exportModalDescription', { count, type: moduleLabel }) }} | ||
</p> | ||
<div class="apos-export-pieces__btns"> | ||
<AposButton | ||
class="apos-export-pieces__btn" | ||
label="apostrophe:cancel" | ||
@click="cancel" | ||
/> | ||
<AposButton | ||
ref="exportPieces" | ||
class="apos-export-pieces__btn" | ||
label="aposImportExport:export" | ||
type="primary" | ||
@click="exportPieces" | ||
/> | ||
</div> | ||
</template> | ||
</AposModalBody> | ||
</template> | ||
</AposModal> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
moduleName: { | ||
type: String, | ||
default: '' | ||
}, | ||
count: { | ||
type: Number, | ||
default: 1 | ||
} | ||
}, | ||
|
||
emits: [ 'safe-close', 'modal-result' ], | ||
|
||
data() { | ||
return { | ||
modal: { | ||
active: false, | ||
showModal: false, | ||
disableHeader: true | ||
}, | ||
formValues: null | ||
}; | ||
}, | ||
|
||
computed: { | ||
moduleLabel() { | ||
const moduleOptions = window.apos.modules[this.moduleName]; | ||
const label = this.count > 1 ? moduleOptions.pluralLabel : moduleOptions.label; | ||
return this.$t(label).toLowerCase(); | ||
} | ||
}, | ||
|
||
async mounted() { | ||
this.modal.active = true; | ||
}, | ||
|
||
methods: { | ||
ready() { | ||
falkodev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
this.$refs.exportPieces.$el.querySelector('button').focus(); | ||
}, | ||
exportPieces() { | ||
this.modal.showModal = false; | ||
const result = true; | ||
this.$emit('modal-result', result); | ||
}, | ||
async cancel() { | ||
this.modal.showModal = false; | ||
this.$emit('modal-result', false); | ||
} | ||
} | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.apos-export-pieces { | ||
z-index: $z-index-modal; | ||
position: fixed; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
::v-deep .apos-modal__inner { | ||
top: auto; | ||
right: auto; | ||
bottom: auto; | ||
left: auto; | ||
max-width: 700px; | ||
height: auto; | ||
text-align: center; | ||
} | ||
|
||
::v-deep .apos-modal__overlay { | ||
.apos-modal+.apos-export-pieces & { | ||
display: block; | ||
} | ||
} | ||
|
||
::v-deep .apos-modal__body { | ||
padding: 60px; | ||
} | ||
|
||
::v-deep .apos-modal__body-main { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: baseline; | ||
} | ||
|
||
.apos-export-pieces__heading { | ||
@include type-title; | ||
line-height: var(--a-line-tall); | ||
margin: 0; | ||
text-transform: capitalize; | ||
} | ||
|
||
.apos-export-pieces__description { | ||
@include type-base; | ||
max-width: 370px; | ||
line-height: var(--a-line-tallest); | ||
} | ||
|
||
::v-deep .apos-schema .apos-field { | ||
margin-bottom: $spacing-base; | ||
} | ||
|
||
.apos-export-pieces__btns { | ||
display: flex; | ||
justify-content: space-between; | ||
margin-top: 10px; | ||
width: 100%; | ||
gap: 20px; | ||
} | ||
</style> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
criteria is not a good name for this.
operation
would be good.