Skip to content

Commit

Permalink
Merge pull request #1251 from ugent-library/fix_issue_1237
Browse files Browse the repository at this point in the history
Fix issue 1237
  • Loading branch information
nics authored Oct 11, 2023
2 parents 8974ae9 + e6b2cd3 commit 1f48513
Show file tree
Hide file tree
Showing 26 changed files with 685 additions and 27 deletions.
18 changes: 17 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,21 @@
"protoc": {
"options": ["-I ./api/v1"]
},
"cSpell.words": ["biblio", "Biblio", "briefcase", "CYPRESSTEST", "liblogin", "Moreels"]
"cSpell.words": [
"arxiv",
"Arxiv",
"biblio",
"Biblio",
"briefcase",
"CYPRESSTEST",
"eisbn",
"eissn",
"esci",
"isbn",
"issn",
"liblogin",
"Moreels",
"pubmed",
"tagify"
]
}
641 changes: 641 additions & 0 deletions cypress/e2e/issues/issue-1237.cy.ts

Large diffs are not rendered by default.

Binary file added cypress/fixtures/empty-pdf.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion views/form/cols/contributor_name.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{end}}
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<input name="{{.Name}}" type="text" value="{{.Value}}"
<input id="{{.Name}}" name="{{.Name}}" type="text" value="{{.Value}}"
class="form-control{{if .Error}} is-invalid{{end}} form-control-auto-focus"
{{if .Readonly}}readonly{{end}}
hx-get="{{.Vars.SuggestURL}}"
Expand Down
2 changes: 1 addition & 1 deletion views/form/cols/date.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{end}}
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<input class="form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}" type="date"
<input class="form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}" type="date"
value="{{.Value}}"{{with .Min}} min="{{.}}"{{end}}{{with .Max}} max="{{.}}"{{end}}{{if .Disabled}} disabled{{end}}>
{{if .Error}}<small class="invalid-feedback">{{.Error}}</small>{{end}}
</div>
2 changes: 1 addition & 1 deletion views/form/cols/select.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{end}}
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}>
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}>
{{if .EmptyOption}}<option></option>{{end}}
{{range .Options}}
<option value="{{.Value}}"{{if eq .Value $.Value}} selected{{end}}>{{.Label}}</option>
Expand Down
6 changes: 3 additions & 3 deletions views/form/cols/select_repeat.gohtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="mb-6 col{{if .Error}} is-invalid{{end}}">
<label class="col-form-label" for="{{.Name}}">
<label class="col-form-label" for="{{.Name}}-0">
{{.Label}}
{{with .Tooltip}}
<a class="text-muted mx-2" href="#" data-bs-container="body" data-bs-toggle="popover" data-trigger="focus" data-bs-placement="right" data-bs-content="{{.}}">
Expand All @@ -13,7 +13,7 @@
<div class="form-values">
{{range $i, $v := .Values}}
<div class="d-flex mb-3 form-value">
<select class="custom-select form-control" name="{{$.Name}}">
<select class="custom-select form-control" name="{{$.Name}}" id="{{$.Name}}-{{$i}}" data-tmpl-id="{{.Name}}-{i}">
{{if $.EmptyOption}}<option></option>{{end}}
{{range $.Options}}
<option value="{{.Value}}"{{if eq .Value $v}} selected{{end}}>{{.Label}}</option>
Expand All @@ -27,7 +27,7 @@
{{end}}

<div class="d-flex mb-3 form-value">
<select class="custom-select form-control" name="{{.Name}}">
<select class="custom-select form-control" name="{{.Name}}" id="{{.Name}}-{{len .Values}}" data-tmpl-id="{{.Name}}-{i}">
{{if .EmptyOption}}<option></option>{{end}}
{{range .Options}}
<option value="{{.Value}}">{{.Label}}</option>
Expand Down
2 changes: 1 addition & 1 deletion views/form/cols/text.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{end}}
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<input class="form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}" type="text" value="{{.Value}}"
<input class="form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}" type="text" value="{{.Value}}"
{{if .Readonly}}readonly{{end}}
>
{{with .Error}}<small class="invalid-feedback">{{.}}</small>{{end}}
Expand Down
2 changes: 1 addition & 1 deletion views/form/cols/text_area.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{end}}
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<textarea class="form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}" rows="{{.Rows}}">{{.Value}}</textarea>
<textarea class="form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}" rows="{{.Rows}}">{{.Value}}</textarea>
{{with .Error}}<small class="invalid-feedback">{{.}}</small>{{end}}
{{with .Help}}<small class="form-text text-muted">{{.}}</small>{{end}}
</div>
2 changes: 1 addition & 1 deletion views/form/cols/text_repeat.gohtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="mb-6 col form-text-multiple{{if .Error}} is-invalid{{end}}">
<label class="col-form-label" for="{{.Name}}">
<label class="col-form-label" for="{{.Name}}-0">
{{.Label}}
{{with .Tooltip}}
<a class="text-muted mx-2" href="#" data-bs-container="body" data-bs-toggle="popover" data-trigger="focus" data-bs-placement="right" data-bs-content="{{.}}">
Expand Down
2 changes: 1 addition & 1 deletion views/form/default/dataset/access_level.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<div class="col-lg-{{.Cols}}">
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}
hx-put="{{pathFor "dataset_edit_file_refresh_form" "id" .Vars.ID}}"
hx-include=".modal-body"
hx-swap="none scroll:.modal-body:bottom"
Expand Down
2 changes: 1 addition & 1 deletion views/form/default/dataset/license.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<div class="col-lg-{{.Cols}}">
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}
hx-put="{{pathFor "dataset_edit_file_refresh_form" "id" .Vars.ID}}"
hx-include=".modal-body"
hx-swap="none scroll:.modal-body:bottom"
Expand Down
2 changes: 1 addition & 1 deletion views/form/default/date.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<div class="col-lg-{{.Cols}}">
<input class="form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}" type="date"
<input class="form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}" type="date"
value="{{.Value}}"{{with .Min}} min="{{.}}"{{end}}{{with .Max}} max="{{.}}"{{end}}{{if .Disabled}} disabled{{end}}>
{{if .Error}}<small class="invalid-feedback">{{.Error}}</small>{{end}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion views/form/default/publication/file_document_type.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<div class="col-lg-{{.Cols}}">
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}
hx-get="{{pathFor "publication_edit_file_refresh_form" "id" $.Vars.ID "file_id" $.Vars.FileID}}"
hx-swap="none"
hx-include=".file-attributes"
Expand Down
1 change: 1 addition & 0 deletions views/form/default/publication/type.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<select
class="form-select form-control{{if .Error}} is-invalid{{end}}"
name="{{.Name}}"
id="{{.Name}}"
{{if .Disabled}} disabled{{end}}
hx-get="{{pathFor "publication_confirm_update_type" "id" .Vars.Publication.ID}}"
hx-headers='{"If-Match": "{{.Vars.Publication.SnapshotID}}"}'
Expand Down
2 changes: 1 addition & 1 deletion views/form/default/select.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<div class="col-lg-{{.Cols}}">
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}>
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}>
{{if .EmptyOption}}<option></option>{{end}}
{{range .Options}}
<option value="{{.Value}}"{{if eq .Value $.Value}} selected{{end}}>{{.Label}}</option>
Expand Down
6 changes: 3 additions & 3 deletions views/form/default/select_repeat.gohtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="mb-6 row">
<label class="col-lg-3 col-form-label mt-2" for="{{.Name}}">
<label class="col-lg-3 col-form-label mt-2" for="{{.Name}}-0">
{{.Label}}
{{if .Tooltip}}
<a class="text-muted mx-2" href="#" data-bs-container="body" data-bs-toggle="popover" data-trigger="focus" data-bs-placement="right" data-bs-content="{{.Tooltip}}">
Expand All @@ -12,7 +12,7 @@
<div class="col-lg-{{.Cols}} form-values">
{{range $i, $v := .Values}}
<div class="d-flex mb-3 form-value">
<select class="custom-select form-control" name="{{$.Name}}">
<select class="custom-select form-control" name="{{$.Name}}" id="{{$.Name}}-{{$i}}" data-tmpl-id="{{$.Name}}-{i}">
{{if $.EmptyOption}}<option></option>{{end}}
{{range $.Options}}
<option value="{{.Value}}"{{if eq .Value $v}} selected{{end}}>{{.Label}}</option>
Expand All @@ -26,7 +26,7 @@
{{end}}

<div class="d-flex mb-3 form-value">
<select class="custom-select form-control" name="{{.Name}}">
<select class="custom-select form-control" id="{{.Name}}-{{len .Values}}" name="{{.Name}}" data-tmpl-id="{{$.Name}}-{i}">
{{if .EmptyOption}}<option></option>{{end}}
{{range .Options}}
<option value="{{.Value}}">{{.Label}}</option>
Expand Down
2 changes: 1 addition & 1 deletion views/form/default/text.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<div class="col-lg-{{.Cols}} {{if .AutocompleteURL}} autocomplete{{end}}"{{if .AutocompleteURL}} data-bs-target="[name={{.Name}}]"{{end}}>
<input class="form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}" type="text" value="{{.Value}}"
<input class="form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}" type="text" value="{{.Value}}"
{{if .AutocompleteURL}}
autocomplete="off"
hx-get="{{.AutocompleteURL}}"
Expand Down
2 changes: 1 addition & 1 deletion views/form/default/text_area.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<div class="col-lg-{{.Cols}}">
<textarea class="form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}" rows="{{.Rows}}">{{.Value}}</textarea>
<textarea class="form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}" rows="{{.Rows}}">{{.Value}}</textarea>
{{with .Error}}<small class="invalid-feedback">{{.}}</small>{{end}}
{{with .Help}}<small class="form-text text-muted">{{.}}</small>{{end}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion views/form/default/text_repeat.gohtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="mb-6 row form-text-multiple{{if .Error}} is-invalid{{end}}">
<label class="col-lg-3 col-form-label mt-2" for="{{.Name}}">
<label class="col-lg-3 col-form-label mt-2" for="{{.Name}}-0">
{{.Label}}
{{with .Tooltip}}
<a class="text-muted mx-2" href="#" data-bs-container="body" data-bs-toggle="popover" data-trigger="focus" data-bs-placement="right" data-bs-content="{{.}}">
Expand Down
2 changes: 1 addition & 1 deletion views/form/file/document_type.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{end}}
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}
hx-get="{{pathFor "publication_edit_file_refresh_form" "id" $.Vars.ID "file_id" $.Vars.FileID}}"
hx-swap="none"
hx-include=".file-attributes"
Expand Down
2 changes: 1 addition & 1 deletion views/form/file/embargo_after.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{end}}
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}>
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}>
{{if .EmptyOption}}<option></option>{{end}}
{{range .Options}}
<option value="{{.Value}}"{{if eq .Value $.Value}} selected{{end}}>{{.Label}}</option>
Expand Down
2 changes: 1 addition & 1 deletion views/form/file/embargo_during.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{end}}
{{if .Required}}&nbsp;<abbr class="required" title="Required">*</abbr>{{end}}
</label>
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}>
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}>
{{if .EmptyOption}}<option></option>{{end}}
{{range .Options}}
<option value="{{.Value}}"{{if eq .Value $.Value}} selected{{end}}>{{.Label}}</option>
Expand Down
2 changes: 1 addition & 1 deletion views/form/file/embargo_end.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{end}}
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<input class="form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}" type="date"
<input class="form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}" type="date"
value="{{.Value}}"{{with .Min}} min="{{.}}"{{end}}{{with .Max}} max="{{.}}"{{end}}{{if .Disabled}} disabled{{end}}>
<small>More information about <a href="https://onderzoektips.ugent.be/en/tips/00002097" target="_blank">embargo periods</a>.</small>
{{if .Error}}<small class="invalid-feedback">{{.Error}}</small>{{end}}
Expand Down
2 changes: 1 addition & 1 deletion views/form/file/license.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{end}}
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}>
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}>
{{if .EmptyOption}}<option></option>{{end}}
{{range .Options}}
<option value="{{.Value}}"{{if eq .Value $.Value}} selected{{end}}>{{.Label}}</option>
Expand Down
2 changes: 1 addition & 1 deletion views/form/file/publication_version.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{end}}
{{if .Required}}&nbsp;<span class="badge badge-outline-primary badge-sm">Required</span>{{end}}
</label>
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}>
<select class="form-select form-control{{if .Error}} is-invalid{{end}}" id="{{.Name}}" name="{{.Name}}"{{if .Disabled}} disabled{{end}}>
{{if .EmptyOption}}<option></option>{{end}}
{{range .Options}}
<option value="{{.Value}}"{{if eq .Value $.Value}} selected{{end}}>{{.Label}}</option>
Expand Down

0 comments on commit 1f48513

Please sign in to comment.