-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feature/3573 autocheck article uploaded #2377
Open
philipkcl
wants to merge
23
commits into
develop
Choose a base branch
from
feature/3573_autocheck_article_uploaded
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b0dfc6b
draft articleinfo
philipkcl edcd98a
implement ArticleInfo
philipkcl c90cda0
update dictionary
philipkcl dcd962a
setup article_info widgets
philipkcl 969c687
implement query of journal_article_info
philipkcl 3dcc38d
add checking before init
philipkcl 96ac2eb
add test cases
philipkcl d2f234d
wording
philipkcl f5c4c8e
merge develop 240419
philipkcl 9532667
naming
philipkcl e52ca45
use multiple checkbox for styles only
philipkcl 628ecf4
Merge remote-tracking branch 'origin/develop' into feature/3573_autoc…
philipkcl f415303
update checkbox title
philipkcl b1daabf
Merge branch 'develop' into feature/3573_autocheck_article_uploaded
Steven-Eardley ee1b642
fix for seal form field
philipkcl 56a56ea
avoid send request by invalid id
philipkcl f768d1b
support in_doaj for count_by_issns query
philipkcl 5e9f946
change ArticleInfo result layout
philipkcl c8f3e73
support admin_site_search redirection
philipkcl a05f6f6
merge develop 240708
philipkcl ad0c19c
Reverted submodule edges to develop_edges1
philipkcl 161a013
Merge remote-tracking branch 'origin/develop' into feature/3573_autoc…
philipkcl c12c2ab
change edges HEAD to same as develop 990f4220163a3e18880f0bdc3ad5c80d…
philipkcl 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
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 |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
} | ||
|
||
SEAL_FORM_EXPANDED = { | ||
"doaj_seal": False, | ||
"doaj_seal": [], | ||
} | ||
|
||
JOURNAL_LIKE_BIBJSON = { | ||
|
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import json | ||
|
||
from doajtest import helpers | ||
from doajtest.fixtures import JournalFixtureFactory | ||
from doajtest.fixtures.accounts import create_maned_a | ||
from doajtest.helpers import DoajTestCase | ||
from portality import models | ||
from portality.util import url_for | ||
|
||
|
||
class TestViewAdmin(DoajTestCase): | ||
|
||
def setUp(self): | ||
super().setUp() | ||
self.acc = create_maned_a(save=True) | ||
|
||
def test_journal_article_info(self): | ||
journal = models.Journal( | ||
**JournalFixtureFactory.make_journal_source() | ||
) | ||
journal.save(blocking=True) | ||
models.Journal.refresh() | ||
|
||
with self.app_test.test_client() as client: | ||
resp = helpers.login(client, self.acc.email, 'password') | ||
assert resp.status_code == 200 | ||
|
||
resp = client.get(url_for("admin.journal_article_info", journal_id=journal.id)) | ||
assert resp.status_code == 200 | ||
assert json.loads(resp.data) == {'n_articles': 0} | ||
|
||
def test_journal_article_info__not_found(self): | ||
with self.app_test.test_client() as client: | ||
helpers.login(client, self.acc.email, 'password') | ||
|
||
resp = client.get(url_for("admin.journal_article_info", journal_id='aksjdlaksjdlkajsdlkajsdlk')) | ||
assert resp.status_code == 404 |
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,11 +1,11 @@ | ||
| Short | Description | | ||
|---------|------------------------------| | ||
| bgjob | background job | | ||
| noti | notification | | ||
| noqa | NO-QA (NO Quality Assurance) | | ||
| inst | instance | | ||
| fmt | format | | ||
| exparam | extra parameter | | ||
| maned | Managing Editor | | ||
| gsheet | Google Sheet | | ||
| svc | service | | ||
| Short | Description | | ||
|----------|------------------------------| | ||
| bgjob | background job | | ||
| noti | notification | | ||
| noqa | NO-QA (NO Quality Assurance) | | ||
| inst | instance | | ||
| fmt | format | | ||
| exparam | extra parameter | | ||
| maned | Managing Editor | | ||
| gsheet | Google Sheet | | ||
| svc,serv | service | |
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 |
---|---|---|
|
@@ -1692,8 +1692,13 @@ class FieldDefinitions: | |
# ~~->$ DOAJSeal:FormField~~ | ||
DOAJ_SEAL = { | ||
"name": "doaj_seal", | ||
"label": "The journal may have fulfilled all the criteria for the Seal. Award the Seal?", | ||
"label": "The journal may have fulfilled all the criteria for the Seal.", | ||
"multiple": True, | ||
"input": "checkbox", | ||
"options": [ | ||
{"display": "Award the Seal?", "value": 'y'}, | ||
], | ||
|
||
"validate": [ | ||
{ | ||
"only_if": { | ||
|
@@ -1715,7 +1720,10 @@ class FieldDefinitions: | |
"the journal must use a persistent identifier" | ||
} | ||
} | ||
] | ||
], | ||
"widgets": [ | ||
"article_info", | ||
], | ||
} | ||
|
||
# FIXME: this probably shouldn't be in the admin form fieldsets, rather its own separate form | ||
|
@@ -1976,7 +1984,7 @@ class FieldDefinitions: | |
"entry_template": "application_form/_entry_group.html", | ||
"widgets": [ | ||
{"infinite_repeat": {"enable_on_repeat": ["textarea"]}}, | ||
"note_modal" | ||
"note_modal", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extraneous comma added |
||
], | ||
"merge_disabled": "merge_disabled_notes", | ||
} | ||
|
@@ -3167,7 +3175,8 @@ def wtforms(field, settings): | |
"trim_whitespace": "formulaic.widgets.newTrimWhitespace", # ~~-> TrimWhitespace:FormWidget~~ | ||
"note_modal": "formulaic.widgets.newNoteModal", # ~~-> NoteModal:FormWidget~~, | ||
"autocheck": "formulaic.widgets.newAutocheck", # ~~-> Autocheck:FormWidget~~ | ||
"issn_link": "formulaic.widgets.newIssnLink" # ~~-> IssnLink:FormWidget~~, | ||
"issn_link" : "formulaic.widgets.newIssnLink", # ~~-> IssnLink:FormWidget~~, | ||
"article_info": "formulaic.widgets.newArticleInfo", # ~~-> ArticleInfo:FormWidget~~ | ||
} | ||
|
||
|
||
|
@@ -3375,10 +3384,8 @@ def wtform(formulaic_context, field, wtfargs): | |
HiddenFieldBuilder | ||
] | ||
|
||
ApplicationFormFactory = Formulaic(APPLICATION_FORMS, WTFORMS_BUILDERS, function_map=PYTHON_FUNCTIONS, | ||
javascript_functions=JAVASCRIPT_FUNCTIONS) | ||
JournalFormFactory = Formulaic(JOURNAL_FORMS, WTFORMS_BUILDERS, function_map=PYTHON_FUNCTIONS, | ||
javascript_functions=JAVASCRIPT_FUNCTIONS) | ||
ApplicationFormFactory = Formulaic(APPLICATION_FORMS, WTFORMS_BUILDERS, function_map=PYTHON_FUNCTIONS, javascript_functions=JAVASCRIPT_FUNCTIONS) | ||
JournalFormFactory = Formulaic(JOURNAL_FORMS, WTFORMS_BUILDERS, function_map=PYTHON_FUNCTIONS, javascript_functions=JAVASCRIPT_FUNCTIONS) | ||
|
||
if __name__ == "__main__": | ||
""" | ||
|
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
Oops, something went wrong.
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.
Probably worth adding a comment here that the article_info back-end is only accessible to admins. The DOAJ_SEAL also only appears in the admin form context, so that's all good, but I suppose we could change that at some point and not notice.