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

Epic/pelagos 5113 add standardized keywords #1396

Merged
merged 201 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 200 commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
3792d4c
Need PHP 8.1 for Enums
mickel1138 Mar 22, 2023
2256852
added Keyword and enum
mickel1138 Mar 22, 2023
2bb5125
remove unneeded line
mickel1138 Mar 22, 2023
300ae5e
WIP
mickel1138 Mar 24, 2023
60a1102
WIP 3
mickel1138 Apr 3, 2023
3ea0067
WIP
mickel1138 Apr 5, 2023
a832030
WIP 4
mickel1138 Apr 5, 2023
0c4d32e
Use relative URL.
fightingtexasaggie Apr 6, 2023
bf7aa16
Merge branch 'develop' into feature/PELAGOS-5134-create-keyword-impor…
mickel1138 Apr 6, 2023
87ab62f
WIP
mickel1138 Apr 11, 2023
e1b3094
GCMD importer WIP
mickel1138 Apr 11, 2023
e6ea599
WIP import tool
mickel1138 Apr 11, 2023
0a4ab11
WIP
mickel1138 Apr 13, 2023
7ead829
WIP enums
mickel1138 Apr 13, 2023
c60d8e5
Fixed enum
mickel1138 Apr 17, 2023
fad0c07
Keyword experiments
mickel1138 Apr 18, 2023
bc58cef
Changed docuimentation
mickel1138 Apr 18, 2023
5c9ecc0
Docblock cleanup
mickel1138 Apr 18, 2023
a6364f0
Make serializer better for mixed
mickel1138 Apr 18, 2023
c97d323
Merge pull request #1391 from griidc/feature/PELAGOS-5134-create-keyw…
mickel1138 Apr 19, 2023
25c9819
Path stuff WIP
mickel1138 Apr 24, 2023
6f22169
Remove flush
mickel1138 Apr 24, 2023
9b3e3d3
Name improved
mickel1138 Apr 25, 2023
6fee082
GCS fixes
mickel1138 Apr 25, 2023
032d689
This fixes missing path
mickel1138 Apr 25, 2023
c65dbf8
New API serializer
mickel1138 Apr 25, 2023
563f962
Merge pull request #1400 from griidc/feature/PELAGOS-5134-create-keyw…
mickel1138 Apr 26, 2023
4d5ba31
added selection list
mickel1138 Apr 26, 2023
0eb86fa
Add entire array
mickel1138 Apr 27, 2023
dd3df06
Added display.
mickel1138 Apr 27, 2023
f6a8080
Added side display.
mickel1138 Apr 27, 2023
3d9d3ee
WIP hover button
mickel1138 Apr 28, 2023
103ef65
Merge branch 'develop' into epic/PELAGOS-5113-Add-Standardized-Keywords
fightingtexasaggie Apr 28, 2023
9a6a24d
Cleanup better button.
mickel1138 Apr 28, 2023
bd4626f
added selection list
mickel1138 Apr 26, 2023
f59e00a
Add entire array
mickel1138 Apr 27, 2023
d2105cb
Added display.
mickel1138 Apr 27, 2023
14d3976
Added side display.
mickel1138 Apr 27, 2023
53e5ac1
WIP hover button
mickel1138 Apr 28, 2023
dbd9a35
Cleanup better button.
mickel1138 Apr 28, 2023
ee105ed
WIP link Keywords to DIF
mickel1138 May 1, 2023
8b6fb66
Display path filter for GCMD Science Keywords
mickel1138 May 3, 2023
d8da62a
Merge branch 'feature/PELAGOS-5151-add-selected-list' into feature/PE…
mickel1138 May 3, 2023
9340e42
WIP keyword to DIF linked
mickel1138 May 4, 2023
045af1a
WIP
mickel1138 May 5, 2023
cdcd29b
Merge pull request #1401 from griidc/feature/PELAGOS-5151-add-selecte…
mickel1138 May 9, 2023
c207c7a
Working selector with list,
mickel1138 May 12, 2023
f9fe6ba
mostly works, remove and pop list for keywords
mickel1138 May 12, 2023
fd4fba4
Merge branch 'epic/PELAGOS-5113-Add-Standardized-Keywords' into featu…
mickel1138 May 16, 2023
3409a3f
Merge branch 'develop' into epic/PELAGOS-5113-Add-Standardized-Keywords
mickel1138 May 16, 2023
57c7127
Merge branch 'epic/PELAGOS-5113-Add-Standardized-Keywords' into featu…
mickel1138 May 16, 2023
278dfc2
Have an empty collection for keywords
mickel1138 May 17, 2023
4567d76
load only on devextreme
mickel1138 May 17, 2023
4d5ee58
Fix maybe issue for list error
mickel1138 May 17, 2023
1549e5a
Try using includes instead
mickel1138 May 17, 2023
b91b6c4
Code cleanup
mickel1138 May 17, 2023
7b8e9bd
some GCS fixes
mickel1138 May 22, 2023
4a0f406
Merge pull request #1404 from griidc/feature/PELAGOS-5152-link-keywor…
mickel1138 May 22, 2023
39cada3
WIP
mickel1138 May 22, 2023
1adcb5d
Expand now works
mickel1138 May 23, 2023
6df0316
GCS fix
mickel1138 May 23, 2023
0bba4db
Added order
mickel1138 May 23, 2023
752a350
Some clenaup
mickel1138 May 23, 2023
023b3af
WIP
mickel1138 Jun 1, 2023
519f2a4
Turned into options
mickel1138 Jun 1, 2023
722d0fe
Reset working ok now it seems
mickel1138 Jun 5, 2023
9d7b176
Fixed mini bug
mickel1138 Jun 5, 2023
1d2f484
Merge pull request #1406 from griidc/feature/PELAGOS-5160-add-expansi…
mickel1138 Jun 5, 2023
ffea55f
Merge branch 'epic/PELAGOS-5113-Add-Standardized-Keywords' into featu…
mickel1138 Jun 5, 2023
178dc3b
Collapse on first load and reset
mickel1138 Jun 12, 2023
02fea4c
Merge pull request #1409 from griidc/feature/PELAGOS-5164-clear-list-…
mickel1138 Jun 13, 2023
ce6c2ee
Moved keywords to another section.
mickel1138 Jun 13, 2023
77dfd31
Merge pull request #1411 from griidc/feature/PELAGOS-5161-move-discip…
mickel1138 Jun 14, 2023
371e71c
Added disablle for keywords
mickel1138 Jun 14, 2023
cf1e89d
Merge branch 'develop' into epic/PELAGOS-5113-Add-Standardized-Keywords
fightingtexasaggie Jun 16, 2023
0d93640
Merge pull request #1413 from griidc/feature/PELAGOS-5168-lock-when-k…
mickel1138 Jun 26, 2023
afcd150
Make keywords required.
mickel1138 Jun 26, 2023
d92e543
Added help text for Keywords
mickel1138 Jun 27, 2023
25d08e8
Initial new keywords on DS
mickel1138 Jul 3, 2023
5c6a32a
Merge branch 'develop' into epic/PELAGOS-5113-Add-Standardized-Keywords
mickel1138 Jul 3, 2023
c8c288d
Merge pull request #1415 from griidc/feature/PELAGOS-5169-make-keywor…
mickel1138 Jul 3, 2023
e09667c
Merge branch 'epic/PELAGOS-5113-Add-Standardized-Keywords' into featu…
mickel1138 Jul 3, 2023
b8a9953
WIP
mickel1138 Jul 8, 2023
2190c89
Added form items
mickel1138 Jul 10, 2023
35c58b5
Added help text and expand
mickel1138 Jul 11, 2023
56e70a4
Open link in new window
mickel1138 Jul 14, 2023
a8fbcb5
Merge pull request #1417 from griidc/feature/PELAGOS-5158-fix-various…
mickel1138 Jul 31, 2023
5896545
Added bash script to drive import of gcmd and anzsrc keywords.
fightingtexasaggie Aug 11, 2023
0907302
Merge branch 'develop' into epic/PELAGOS-5113-Add-Standardized-Keywords
mickel1138 Aug 16, 2023
0a2cd57
Merge branch 'epic/PELAGOS-5113-Add-Standardized-Keywords' into featu…
mickel1138 Aug 16, 2023
f768ada
Add templates and logic for ANZSRC keywords.
fightingtexasaggie Aug 16, 2023
466bbd2
WIP
mickel1138 Aug 18, 2023
103f614
Loading keywords Sync
mickel1138 Aug 18, 2023
4cd3aa5
One list working ok
mickel1138 Aug 22, 2023
ad92482
Remove console log
mickel1138 Aug 22, 2023
fb56b55
Looks like GCMD now works too.
mickel1138 Aug 24, 2023
ef386ee
Minor cleanup per PR.
fightingtexasaggie Aug 28, 2023
49d6b69
Added gcmd keywords to mdgen twig templates.
fightingtexasaggie Aug 28, 2023
0a47824
Move tag into ifblock for descriptiveKeywords.
fightingtexasaggie Aug 28, 2023
635e6f2
Initial new keywords on DS
mickel1138 Jul 3, 2023
e992652
WIP
mickel1138 Jul 8, 2023
f8d0bfb
Added form items
mickel1138 Jul 10, 2023
ace5a3d
Added bash script to drive import of gcmd and anzsrc keywords.
fightingtexasaggie Aug 11, 2023
2b5f4e0
WIP
mickel1138 Aug 18, 2023
b700a03
Loading keywords Sync
mickel1138 Aug 18, 2023
b6aaf56
One list working ok
mickel1138 Aug 22, 2023
8c2660f
Remove console log
mickel1138 Aug 22, 2023
c974cba
Looks like GCMD now works too.
mickel1138 Aug 24, 2023
df049ce
keywords Added to Review
mickel1138 Aug 29, 2023
f1a87a5
Merge pull request #1418 from griidc/feature/PELAGOS-5172-add-keyword…
mickel1138 Aug 29, 2023
9ecd450
Merge pull request #1438 from griidc/feature/PELAGOS-5191-add-anzsrc-…
mickel1138 Aug 29, 2023
49ebcdb
Merge branch 'epic/PELAGOS-5113-Add-Standardized-Keywords' into featu…
mickel1138 Aug 29, 2023
7ff8768
Merge branch 'epic/PELAGOS-5113-Add-Standardized-Keywords' into featu…
fightingtexasaggie Aug 29, 2023
2536f9d
Merge branch 'develop' into epic/PELAGOS-5113-Add-Standardized-Keywords
fightingtexasaggie Aug 29, 2023
82d9d45
Merge branch 'epic/PELAGOS-5113-Add-Standardized-Keywords' into featu…
fightingtexasaggie Aug 29, 2023
67f7b07
WIP
mickel1138 Aug 31, 2023
87ffd3a
Change back to 'revision' in template.
fightingtexasaggie Sep 6, 2023
c23bc4c
Merge pull request #1442 from griidc/feature/PELAGOS-5191-add-anzsrc-…
mickel1138 Sep 7, 2023
2101056
Merge pull request #1441 from griidc/feature/PELAGOS-5194-add-keyword…
mickel1138 Sep 7, 2023
1ecf859
Merge branch 'epic/PELAGOS-5113-Add-Standardized-Keywords' into featu…
fightingtexasaggie Sep 8, 2023
bd79d30
WIP
mickel1138 Sep 11, 2023
4d288ff
Make field required
mickel1138 Sep 14, 2023
bbffbb0
Clean up help text
mickel1138 Sep 15, 2023
7476be6
not needed
mickel1138 Sep 15, 2023
88b1044
Add nested keyword label to elastic index.
fightingtexasaggie Sep 18, 2023
78a03a6
Remove padding for dx-list-items
mickel1138 Sep 18, 2023
2d2ddc2
WIP
mickel1138 Sep 19, 2023
33ac652
Added simple picker
mickel1138 Sep 19, 2023
c44e8c4
Almost working right with addShoulds.
fightingtexasaggie Sep 19, 2023
3d03d00
Removed separate nested search, used config.
fightingtexasaggie Sep 20, 2023
ec3d2bf
Code cleanup
mickel1138 Sep 20, 2023
30ef259
Merge pull request #1446 from griidc/feature/PELAGOS-5201-make-standa…
mickel1138 Sep 22, 2023
592fd0a
Undo Easy admin
mickel1138 Sep 25, 2023
c929199
Rmove templates
mickel1138 Sep 25, 2023
7bf5d6c
Remove un needed use
mickel1138 Sep 25, 2023
e2b9acb
Changed docblock
mickel1138 Sep 25, 2023
dfef6e1
Added dataset selector/list
mickel1138 Sep 25, 2023
020cc81
Merge pull request #1447 from griidc/feature/PELAGOS-5173-include-std…
mickel1138 Sep 26, 2023
99a9ae8
WIP edit page
mickel1138 Sep 26, 2023
4d2d4c6
Merge branch 'epic/PELAGOS-5113-Add-Standardized-Keywords' into featu…
mickel1138 Sep 26, 2023
b96ea18
Added view/update page
mickel1138 Sep 27, 2023
48f6e88
unused use
mickel1138 Sep 28, 2023
62fa46a
Cleanup, moved CSS and JS
mickel1138 Sep 28, 2023
3e51ea3
Add to admin links
mickel1138 Sep 28, 2023
c4f629f
Fixed label
mickel1138 Sep 29, 2023
b48ccb9
removed height and scrollbar
mickel1138 Sep 29, 2023
1ad3cde
Two scrollable columns works ok now
mickel1138 Sep 29, 2023
58ce2e9
Changes CSS for scoll column
mickel1138 Sep 29, 2023
298b927
Default keyword filter is 0
mickel1138 Oct 2, 2023
de5c5fa
Fixed padding and margins
mickel1138 Oct 2, 2023
d94453d
Merge branch 'epic/PELAGOS-5113-Add-Standardized-Keywords' into featu…
fightingtexasaggie Oct 3, 2023
5134b41
Use displaypath.
fightingtexasaggie Oct 3, 2023
f0dea52
Added revision to GCMD keyword section of metadata. Added to ini.
fightingtexasaggie Oct 3, 2023
73c184e
Add year to GCMD. Rename vars to 'version'.
fightingtexasaggie Oct 3, 2023
983966d
Use short display path.
fightingtexasaggie Oct 4, 2023
4b7b590
Collapse after reset field
mickel1138 Oct 5, 2023
7e900ea
Updated button not to post on Enter button
mickel1138 Oct 5, 2023
27c620b
remove extra line
mickel1138 Oct 5, 2023
984bec5
WIP
mickel1138 Sep 19, 2023
5bc2ec0
Added simple picker
mickel1138 Sep 19, 2023
5726241
Code cleanup
mickel1138 Sep 20, 2023
3120e94
Undo Easy admin
mickel1138 Sep 25, 2023
7d643dd
Rmove templates
mickel1138 Sep 25, 2023
7ddddd3
Remove un needed use
mickel1138 Sep 25, 2023
d53424e
Changed docblock
mickel1138 Sep 25, 2023
45bec17
Added dataset selector/list
mickel1138 Sep 25, 2023
0304a0b
WIP edit page
mickel1138 Sep 26, 2023
10f8b78
Added view/update page
mickel1138 Sep 27, 2023
af9dcfc
unused use
mickel1138 Sep 28, 2023
4eecb31
Cleanup, moved CSS and JS
mickel1138 Sep 28, 2023
25aaa9d
Add to admin links
mickel1138 Sep 28, 2023
12549c6
Fixed label
mickel1138 Sep 29, 2023
1220e0c
removed height and scrollbar
mickel1138 Sep 29, 2023
4713165
Two scrollable columns works ok now
mickel1138 Sep 29, 2023
0130008
Changes CSS for scoll column
mickel1138 Sep 29, 2023
d1e1ca8
Default keyword filter is 0
mickel1138 Oct 2, 2023
6763c2c
Fixed padding and margins
mickel1138 Oct 2, 2023
92b0844
Updated button not to post on Enter button
mickel1138 Oct 5, 2023
76267f3
remove extra line
mickel1138 Oct 5, 2023
0caa271
Merge pull request #1448 from griidc/feature/PELAGOS-5208-make-keywor…
mickel1138 Oct 10, 2023
2073a0b
Merge pull request #1443 from griidc/feature/PELAGOS-5195-add-gcmd-ke…
fightingtexasaggie Oct 10, 2023
11210d2
Merge pull request #1449 from griidc/feature/PELAGOS-5210-collapse-af…
mickel1138 Oct 10, 2023
702990b
Merge branch 'epic/PELAGOS-5113-Add-Standardized-Keywords' into HEAD
mickel1138 Oct 10, 2023
a0319a6
Made it look like a tagbox
mickel1138 Oct 9, 2023
20184ab
Fixed delete
mickel1138 Oct 10, 2023
8f31241
WIP standard keywords on DL
mickel1138 Oct 11, 2023
a51fe10
Added place, change order, word cap
mickel1138 Oct 12, 2023
7bd9ae1
Truncated long tags on small screens
mickel1138 Oct 12, 2023
c681a11
Merge pull request #1452 from griidc/feature/PELAGOS-5212-add-keyword…
mickel1138 Oct 18, 2023
90f6a07
Merge pull request #1451 from griidc/feature/PELAGOS-5211-change-list…
mickel1138 Oct 18, 2023
25224ec
Temporary disable standard keywords
mickel1138 Oct 18, 2023
6b01f34
Don't show keywords on submission
mickel1138 Oct 18, 2023
69028b2
Remove new keywords from Dataland.
fightingtexasaggie Oct 18, 2023
5497043
Disabled new keywords from MDGen.
fightingtexasaggie Oct 19, 2023
f51168b
Fix possible nulls in template.
fightingtexasaggie Oct 23, 2023
64c1745
Merge pull request #1455 from griidc/feature/PELAGOS-5217-remove-keyw…
mickel1138 Nov 6, 2023
72efad3
Merge pull request #1456 from griidc/feature/PELAGOS-5218-remove-from…
mickel1138 Nov 6, 2023
df1e22c
Merge pull request #1457 from griidc/feature/PELAGOS-5219-Remove-from…
mickel1138 Nov 6, 2023
57c0955
Merge pull request #1458 from griidc/feature/PELAGOS-5220-Remove-from…
mickel1138 Nov 6, 2023
c339d02
Merge branch 'develop' into epic/PELAGOS-5113-Add-Standardized-Keywords
mickel1138 Nov 6, 2023
c5573c2
Merge branch 'develop' into epic/PELAGOS-5113-Add-Standardized-Keywords
mickel1138 Nov 13, 2023
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
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ ANONYMOUS_FTP_USER=user
ANONYMOUS_FTP_PASS=pass
DOWNLOAD_PATH="path/to/zip"
INGEST_API_URL="https://ingest-server:port/api-name"
GCMD_VERSION="16.9"
GCMD_VERSION_YEAR="2023"
ANZSRC_VERSION="2020"

###> INDEX NAMES ###
DISCOVERY_INDEX=pelagos_instancename
Expand Down
5 changes: 5 additions & 0 deletions assets/static/css/dataset-submission.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,8 @@ table.dataTable.stripe tbody tr:hover {
#clearLargeFilePath {
margin-left: 30px;
}

.dx-list-item-content {
padding-top: 0px;
padding-bottom: 0px;
}
42 changes: 42 additions & 0 deletions assets/static/css/keyword-dataset-edit.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
html, body {
overflow: hidden;
}
.main {
height: 100%;
}
.left {
float: left;
width: 50%;
height: 100%;
overflow-y: scroll;
position: absolute;
top: 300px;
bottom: 0;
left: 0;
padding-inline: 20px;
padding-bottom: 300px;
}
.right {
float: left;
width: 50%;
height: 100%;
overflow-y: scroll;
overflow-x: hidden;
position: absolute;
top: 300px;
bottom: 0;
right: 0;
padding-inline: 20px;
padding-bottom: 300px;
}
.tab-table tr:nth-child(even) {
background-color: #FFF
}

.tab-table tr:nth-child(odd) {
background-color: #FFF
}

pre {
white-space: pre-wrap;
}
21 changes: 20 additions & 1 deletion assets/static/js/dataset-submission.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ $(function() {
$("html").show();

$("#funderList").trigger("fundersAdded", {"disabled": defaultFunderTagBoxDisabled});
$("#keywordList").trigger("keywordsAdded", {"disabled": false});

$("#keywordList").on("change", function(event){
$('[id^="keywords_"]').remove();
var maxKeywordId = 0;
$.each(($("#keywordList").val().split(',')), function(key, value) {
if (value === "") { return; }
var newElement = document.createElement("input");
var keywordId = value;
newElement.id = `keywords_${maxKeywordId}`;
newElement.name = `keywords[${maxKeywordId}]`;
newElement.value = keywordId;
newElement.type = "hidden";
$('[id="keyword-items"]').append(newElement);
maxKeywordId++;
})
});

$("label").next("input[required],textarea[required],select[required]").prev().addClass("emRequired");
//Setup qTip
Expand Down Expand Up @@ -191,7 +208,9 @@ $(function() {
},
funderList: {
require_from_group: "This field is required. Please select a funder from the dropdown or add it under Additional Funders."
}
},
keywordListAnzsrc: "Please select at least one ANZSRC keyword.",
keywordListGcmd: "Please select at least one GCMD keyword.",
},
ignore: ".ignore,.prototype",
submitHandler: function(form) {
Expand Down
17 changes: 17 additions & 0 deletions assets/static/js/datasetReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@ $(document).ready(function(){
"use strict";

$("#funderList").trigger("fundersAdded", {"disabled": false});
$("#keywordList").trigger("keywordsAdded", {"disabled": false});

$("#keywordList").on("change", function(event){
$('[id^="keywords_"]').remove();
var maxKeywordId = 0;
$.each(($("#keywordList").val().split(',')), function(key, value) {
if (value === "") { return; }
var newElement = document.createElement("input");
var keywordId = value;
newElement.id = `keywords_${maxKeywordId}`;
newElement.name = `keywords[${maxKeywordId}]`;
newElement.value = keywordId;
newElement.type = "hidden";
$('[id="keyword-items"]').append(newElement);
maxKeywordId++;
})
});

$("#udiLoadReviewform").on("change keyup mouseout", function() {
var udiTextBox = $("#udiReview");
Expand Down
29 changes: 29 additions & 0 deletions assets/static/js/dif.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@ $(document).ready(function()
});

$("#funderList").trigger("fundersAdded", {"disabled": false});
$("#keywordList").trigger("keywordsAdded", {"disabled": false});

$("#keywordList").on("change", function(event){
$('[id^="keywords_"]').remove();
var maxKeywordId = 0;
$.each(($("#keywordList").val().split(',')), function(key, value) {
if (value === "") { return; }
var newElement = document.createElement("input");
var keywordId = value;
newElement.id = `keywords_${maxKeywordId}`;
newElement.name = `keywords[${maxKeywordId}]`;
newElement.value = keywordId;
newElement.type = "hidden";
$('[id="keyword-items"]').append(newElement);
maxKeywordId++;
})
});

$("#btnDS").button({
disabled : true
Expand Down Expand Up @@ -168,6 +185,9 @@ $(document).ready(function()
},
funderList: {
require_from_group: "This field is required. Please select a funder from the dropdown or add it under Additional Funders."
},
keywordList: {
required: "This field is required. Please select at least one keyword."
}
},
submitHandler: function(form) {
Expand Down Expand Up @@ -464,6 +484,7 @@ function setFormStatus()
$("#btnSubmit").prop("disabled",true);
$("#btnSave").prop("disabled",true);
$("#funderList").trigger("fundersAdded", {"disabled": true});
$("#keywordList").trigger("keywordsAdded", {"disabled": true});
if (Status == "2")
{
$("#btnReqUnlock").show();
Expand Down Expand Up @@ -802,6 +823,8 @@ function formReset(dontScrollToTop)
$("#status").val(0).change();
$("#funderTagBox").data('dxTagBox').reset();
$("#funderList").trigger("fundersAdded", {"disabled": false});
$("#keywordList").val('').trigger("change").trigger('keywordsAdded', {"disabled": false});

//formHash = $("#difForm").serialize();
formHash = undefined;
geowizard.cleanMap();
Expand Down Expand Up @@ -1082,6 +1105,7 @@ function fillForm(Form, UDI, ID)
if (json.dataset.funders != null) {
var funders = json.dataset.funders;
var addedFunders = [];
$('[id^="funders_"]').remove();
$.each(funders, function(key, value) {
var newElement = document.createElement("input");
var funderId = value.id;
Expand All @@ -1097,6 +1121,11 @@ function fillForm(Form, UDI, ID)
$("#funderList").val(addedFunders.toString()).trigger("fundersAdded", {"disabled": false});
}

if (json.keywords != null) {
var keywords = json.keywords;
$("#keywordList").val(keywords.map(keyword => keyword["id"]).toString()).trigger("change").trigger("keywordsAdded", {"disabled": false});
}

loadPOCs(json.dataset.researchGroup.id, primaryPointOfContact, secondaryPointOfContact);
$.each(json, function(name,value) {
var element = $("[name="+name+"]");
Expand Down
58 changes: 58 additions & 0 deletions assets/static/js/keyword-dataset-edit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
$(function() {
$("#btnUpdate").on('click', function(event) {
var formData = $("form[datasetsubmission]").serialize();
var url = $("form[datasetsubmission]").attr("action")

$.ajax({
url: url,
method: "POST",
data: formData,
success: function(data, textStatus, jqXHR) {
var n = noty(
{
layout: "top",
theme: "relax",
type: "success",
text: "Your changes have been saved!",
timeout: 4000,
modal: false,
}
);
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(jqXHR, textStatus, errorThrown);
var n = noty(
{
layout: "top",
theme: "relax",
type: "error",
text: textStatus,
modal: true,
}
);
},
});
});

$("#btnBack").on('click', function(event) {
location.href = `${Routing.generate('pelagos_app_ui_list_keyword_dataset')}`;
});

$("#keywordList").trigger("keywordsAdded", {"disabled": false});

$("#keywordList").on("change", function(event){
$('[id^="keywords_"]').remove();
var maxKeywordId = 0;
$.each(($("#keywordList").val().split(',')), function(key, value) {
if (value === "") { return; }
var newElement = document.createElement("input");
var keywordId = value;
newElement.id = `keywords_${maxKeywordId}`;
newElement.name = `keywords[${maxKeywordId}]`;
newElement.value = keywordId;
newElement.type = "hidden";
$('[id="keyword-items"]').append(newElement);
maxKeywordId++;
})
});
});
57 changes: 57 additions & 0 deletions assets/static/js/keyword-dataset-list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
$(() => {
$('#gridContainer').dxDataGrid({
dataSource: `${Routing.generate('pelagos_app_api_keyword_dataset')}`,
columns: [
{
type: 'buttons',
width: 110,
buttons: [{
hint: 'Edit',
icon: 'edit',
onClick(e) {
const udi = e.row.data.udi;
e.event.preventDefault();
window.open(`${Routing.generate('pelagos_app_ui_edit_keyword_dataset')}/${udi}`);
},
}],
},
{
dataField: 'udi',
caption: 'UDI',
width: 200,
},
{
dataField: 'title',
caption: 'Title',
},
{
dataField: 'acceptedDate',
caption: 'Accepted Date',
dataType: 'date',
width: 250,
},
{
dataField: 'keywords',
caption: 'Number of Keywords',
width: 150,
filterValue: 0,
},
],
showBorders: true,
showColumnLines: true,
showRowLines: true,
rowAlternationEnabled: true,
filterPanel: {
visible: true,
},
filterRow: {
visible: true,
},
summary: {
totalItems: [{
column: 'udi',
summaryType: 'count',
}],
},
});
});
Loading
Loading