Skip to content
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

eslint vue #885

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
33 changes: 22 additions & 11 deletions frontend/javascript/components/docupload/document-uploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
v-if="debug"
type="button"
@click="refreshAttachments"
style="font-size: 50%">
style="font-size: 50%"
>
DEBUG: refresh
</button>
<div v-if="imageDocuments.length > 0" class="images mt-5">
Expand All @@ -24,25 +25,29 @@
@namechanged="doc.name = $event"
@docupdated="documentUpdated(doc, $event)"
@pageupdated="pageUpdated"
@notnew="doc.new = false" />
@notnew="doc.new = false"
/>
</div>
<component
v-if="pdfDocuments.length > 0 && (!hidePdf || debug)"
:is="hidePdf && debug ? 'details' : 'div'"
class="documents mt-5">
class="documents mt-5"
>
<summary v-if="debug && hidePdf" class="debug">
DEBUG: pdf documents
</summary>
<django-slot name="documents" />
<div class="mt-3 mb-3">
<div
class="row bg-body-secondary pb-2 pt-2 mb-2 border-bottom"
v-if="!hideStatusTools || !hideSelectionBar">
v-if="!hideStatusTools || !hideSelectionBar"
>
<div class="col-auto me-md-auto" v-if="!hideSelectionBar">
<input
v-model="selectAll"
type="checkbox"
@click="clickSelectAll" />
@click="clickSelectAll"
/>
</div>
<div class="col-auto ms-auto" v-if="!hideStatusTools">
<button
Expand All @@ -51,7 +56,8 @@
:class="{ 'btn-success': canMakeResult }"
:disabled="!canMakeResult"
:title="i18n.makeResultsExplanation"
@click="makeResults">
@click="makeResults"
>
<i class="fa fa-certificate" />
{{ i18n.markAllAsResult }}
</button>
Expand All @@ -60,7 +66,8 @@
class="btn btn-sm ms-2"
:class="{ 'btn-success': canApprove }"
:disabled="!canApprove"
@click="approveSelected">
@click="approveSelected"
>
<i class="fa fa-check" />
{{ i18n.approveAll }}
</button>
Expand All @@ -82,15 +89,17 @@
@namechanged="doc.name = $event"
@docupdated="documentUpdated(doc, $event)"
@pageupdated="pageUpdated"
@notnew="doc.new = false" />
@notnew="doc.new = false"
/>
</div>
</component>
<div style="color: red" v-else-if="debug">DEBUG: no pdf documents</div>

<component
v-if="otherAttachments.length > 0 && (!hideOther || debug)"
:is="hideOther ? 'details' : 'div'"
class="mt-5">
class="mt-5"
>
<summary v-if="hideOther && debug" class="debug">
DEBUG: other attachments
</summary>
Expand All @@ -105,7 +114,8 @@
:basic-operations="fileBasicOperations"
@docupdated="documentUpdated(doc, $event)"
@makerelevant="makeRelevant(doc)"
@notnew="doc.new = false" />
@notnew="doc.new = false"
/>
</component>

<div v-if="canUpload && showUpload" class="upload mt-5">
Expand All @@ -115,7 +125,8 @@
:config="config"
:auto-proceed="true"
:allowed-file-types="config.settings.allowed_filetypes"
@upload-success="uploadSuccess" />
@upload-success="uploadSuccess"
/>
</div>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ onMounted(() => {
<button
class="btn btn-outline-dark me-1"
disabled
@click="renameAttachment">
@click="renameAttachment"
>
<i class="fa fa-pencil" />
</button>
<button
class="btn btn-outline-dark"
:disabled="!canDelete"
@click="deleteAttachment">
@click="deleteAttachment"
>
<i class="fa fa-trash" />
</button>
</div>
Expand Down
69 changes: 41 additions & 28 deletions frontend/javascript/components/docupload/file-document.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@
<div
:id="attachmentId"
class="document mb-1"
:class="{ 'is-new': document.new }">
:class="{ 'is-new': document.new }"
>
<div class="row" @click.self="toggleSelected">
<div class="col-auto">
<input
v-if="ready && !hideSelection"
v-model="selected"
type="checkbox" />
type="checkbox"
/>
<div
v-if="!ready"
class="spinner-border spinner-border-sm"
role="status">
role="status"
>
<span class="visually-hidden">{{ i18n.loading }}</span>
</div>
</div>
<div
v-if="iconStyle === 'icon'"
class="col-auto ps-0"
@click="toggleSelected">
@click="toggleSelected"
>
<i class="fa fa-file-o"></i>
</div>
<div v-else-if="iconStyle === 'thumbnail'" class="col-auto ps-0">
Expand All @@ -33,23 +37,26 @@
class="badge rounded-pill text-bg-secondary"
data-bs-toggle="tooltip"
data-bs-placement="top"
:title="i18n.notPublic">
:title="i18n.notPublic"
>
&nbsp;
</span>
<span
v-if="isRedacted"
class="badge rounded-pill text-bg-dark"
data-bs-toggle="tooltip"
data-bs-placement="top"
:title="i18n.redacted">
:title="i18n.redacted"
>
&nbsp;
</span>
<span
v-if="isProtected"
class="badge rounded-pill text-bg-info"
data-bs-toggle="tooltip"
data-bs-placement="top"
:title="i18n.protectedOriginalExplanation">
:title="i18n.protectedOriginalExplanation"
>
&nbsp;
</span>
</template>
Expand All @@ -71,21 +78,17 @@
:href="attachment.site_url"
:title="i18n.openAttachmentPage"
target="_blank"
class="px-2">
class="px-2"
>
<i class="fa fa-external-link" />
<span class="visually-hidden">{{ i18n.openAttachmentPage }}</span>
</a>

<div
v-if="highlightRedaction">
<span
v-if="isRedacted"
class="badge text-bg-success"
>geschwärzt</span>
<span
v-else
class="badge text-bg-warning"
>ungeschwärzt</span>
<div v-if="highlightRedaction">
<span v-if="isRedacted" class="badge text-bg-success"
>geschwärzt</span
>
<span v-else class="badge text-bg-warning">ungeschwärzt</span>
</div>

<div
Expand All @@ -94,28 +97,32 @@
role="progressbar"
:aria-valuenow="document.progress"
aria-valuemin="0"
aria-valuemax="100">
aria-valuemax="100"
>
<div
class="progress-bar"
:class="{
'progress-bar-animated progress-bar-striped':
progressAlmostComplete,
'bg-info progress-bar-striped': progressUnknown
}"
:style="{ width: progressPercentLabel }" />
:style="{ width: progressPercentLabel }"
/>
</div>
</div>
<div
v-if="!hideAdvancedOperations"
class="col-12 col-sm-auto mt-2 mt-sm-0 text-end text-sm-center">
class="col-12 col-sm-auto mt-2 mt-sm-0 text-end text-sm-center"
>
<button
v-if="canMakeResult"
class="btn btn-sm btn-outline-success"
:disabled="attachment.document || document.creatingDocument"
data-bs-toggle="tooltip"
data-bs-placement="top"
:title="i18n.makeResultExplanation"
@click="makeResult">
@click="makeResult"
>
<i class="fa fa-certificate" />
{{ i18n.isResult }}
</button>
Expand All @@ -126,7 +133,8 @@
'btn-outline-secondary': !editDocumentMeta,
'btn-secondary': editDocumentMeta
}"
@click.prevent="editDocumentMeta = !editDocumentMeta">
@click.prevent="editDocumentMeta = !editDocumentMeta"
>
<span class="visually-hidden">{{ i18n.edit }}</span>
<i class="fa fa-edit" />
</button>
Expand All @@ -135,16 +143,19 @@
:config="config"
:document="document"
@docupdated="updateDocument"
@makerelevant="$emit('makerelevant')" />
@makerelevant="$emit('makerelevant')"
/>
</div>
<div
v-if="showBasicOperations"
class="col-12 col-sm-auto mt-2 mt-sm-0 text-end text-sm-center">
class="col-12 col-sm-auto mt-2 mt-sm-0 text-end text-sm-center"
>
<file-basic-operations
v-if="ready"
:config="config"
:document="document"
@docupdated="updateDocument" />
@docupdated="updateDocument"
/>
</div>
<!-- <div class="col-auto">
<button
Expand Down Expand Up @@ -178,7 +189,8 @@
v-model="title"
type="text"
class="form-control"
:placeholder="i18n.title" />
:placeholder="i18n.title"
/>
<small class="form-text text-body-secondary">{{
i18n.documentTitleHelp
}}</small>
Expand All @@ -195,7 +207,8 @@
:id="'doc-description' + doc.id"
v-model="description"
class="form-control"
rows="3" />
rows="3"
/>
<small class="form-text text-body-secondary">{{
i18n.descriptionHelp
}}</small>
Expand Down
24 changes: 16 additions & 8 deletions frontend/javascript/components/docupload/file-review.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@
<div
class="btn-group btn-group-sm"
role="group"
aria-label="Button group with nested dropdown">
aria-label="Button group with nested dropdown"
>
<button
v-if="canApprove"
class="btn btn-sm btn-outline-success"
:disabled="working"
@click="approve">
@click="approve"
>
<i class="fa fa-check" />
{{ i18n.approve }}
</button>

<a
v-if="canReview && !approved"
class="btn btn-sm btn-outline-primary"
:href="reviewUrl">
:href="reviewUrl"
>
<i class="fa fa-eye" />
{{ i18n.review }}
</a>
Expand All @@ -27,14 +30,17 @@
ref="dropdown"
data-bs-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false" />
aria-expanded="false"
/>
<div
class="dropdown-menu dropdown-menu-right"
:aria-labelledby="'docupload-dropdown-' + attachment.id">
:aria-labelledby="'docupload-dropdown-' + attachment.id"
>
<a
v-if="canReview && approved"
class="dropdown-item btn btn-sm btn-dark"
:href="reviewUrl">
:href="reviewUrl"
>
<i class="fa fa-paint-brush" />
{{ i18n.redact }}
</a>
Expand All @@ -43,14 +49,16 @@
v-if="canDelete"
class="dropdown-item"
:disabled="working"
@click="deleteAttachment">
@click="deleteAttachment"
>
<i class="fa fa-ban" />
{{ i18n.delete }}
</button>
<button
v-if="attachment.is_irrelevant && attachment.is_image"
class="dropdown-item btn-danger"
@click="makeRelevant">
@click="makeRelevant"
>
{{ i18n.makeRelevant }}
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ useSortable(pagesEl, pages, { animation: 200 })
:hide-rotate="dense"
:hide-split="dense"
@pageupdated="emit('pageupdated', $event)"
@splitpages="emit('splitpages', $event)" />
@splitpages="emit('splitpages', $event)"
/>
</div>
</template>
Loading