diff --git a/cms/sass/themes/_editorial-form.scss b/cms/sass/themes/_editorial-form.scss index f16df08cc8..9ae25e0255 100644 --- a/cms/sass/themes/_editorial-form.scss +++ b/cms/sass/themes/_editorial-form.scss @@ -109,22 +109,38 @@ color: $white; } - .icon-container--unable_to_access { - background: $grapefruit; + .icon-container--success { + background: $mid-green; } - .icon-container--not_found, - .icon-container--not_validated, - .icon-container--missing, - .icon-container--outdated { + .icon-container--error { background: $sanguine; } - .icon-container--fully_validated, - .icon-container--present { - background: $mid-green; + .icon-container--warn { + background: $grapefruit; } + .icon-container--info { + background: $mid-grey; + } + + //.icon-container--unable_to_access { + // background: $grapefruit; + //} + // + //.icon-container--not_found, + //.icon-container--not_validated, + //.icon-container--missing, + //.icon-container--outdated { + // background: $sanguine; + //} + // + //.icon-container--fully_validated, + //.icon-container--present { + // background: $mid-green; + //} + .parsley-errors-list { padding: $spacing-03; border-radius: $spacing-01; diff --git a/doajtest/testdrive/autocheck.py b/doajtest/testdrive/autocheck.py index 58bb002f40..7e9bf4fbbe 100644 --- a/doajtest/testdrive/autocheck.py +++ b/doajtest/testdrive/autocheck.py @@ -20,11 +20,22 @@ def setup(self) -> dict: acc.set_password(pw) acc.save() + ################################################## + ## Setup and Application with the following features + ## + ## - Print ISSN registered at ISSN.org + ## - Electronic ISSN not registered at ISSN.org + ## - 3 preservation services: + ## - CLOCKSS - currently archived + ## - LOCKSS - not currently archived + ## - PMC - not registered source = ApplicationFixtureFactory.make_application_source() ap = models.Application(**source) ap.application_type = constants.APPLICATION_TYPE_NEW_APPLICATION ap.remove_current_journal() ap.remove_related_journal() + apbj = ap.bibjson() + apbj.set_preservation(["CLOCKSS", "LOCKSS", "PMC", "PKP PN"], "http://policy.example.com") ap.set_id(ap.makeid()) ap.save() @@ -34,9 +45,9 @@ def setup(self) -> dict: thisyear = datetime.utcnow().year - issn_data = ISSNOrgData({ + pissn_data = ISSNOrgData({ "mainEntityOfPage": { - "version": "Register" + "version": "Register" # this means the ISSN is registered at ISSN.org }, "subjectOf": [ { @@ -51,7 +62,29 @@ def setup(self) -> dict: "holdingArchive": { "@id": "http://issn.org/organization/keepers#lockss" }, + "temporalCoverage": "2019/2020" + } + ] + }) + + eissn_data = ISSNOrgData({ + "mainEntityOfPage": { + "version": "Pending" # this means the ISSN is not registered at ISSN.org + }, + "subjectOf": [ + { + "@type": "ArchiveComponent", + "holdingArchive": { + "@id": "http://issn.org/organization/keepers#clockss" + }, "temporalCoverage": "2022/" + str(thisyear) + }, + { + "@type": "ArchiveComponent", + "holdingArchive": { + "@id": "http://issn.org/organization/keepers#lockss" + }, + "temporalCoverage": "2019/2020" } ] }) @@ -60,11 +93,11 @@ def setup(self) -> dict: ISSNChecker.retrieve_from_source = lambda *args, **kwargs: ( eissn, "https://portal.issn.org/resource/ISSN/2682-4396", - issn_data, + eissn_data, False, pissn, "https://portal.issn.org/resource/ISSN/2682-4396", - issn_data, + pissn_data, False) acSvc = DOAJ.autochecksService( @@ -76,6 +109,16 @@ def setup(self) -> dict: ) ac1 = acSvc.autocheck_application(ap) + ################################################## + ## Setup a Journal with the following features + ## + ## - Print ISSN registered at ISSN.org + ## - Electronic ISSN not found + ## - 3 preservation services: + ## - CLOCKSS - currently archived + ## - LOCKSS - not currently archived + ## - PMC - not registered + source = JournalFixtureFactory.make_journal_source() j = models.Journal(**source) j.remove_current_application() @@ -88,12 +131,12 @@ def setup(self) -> dict: ISSNChecker.retrieve_from_source = lambda *args, **kwargs: ( eissn, - "https://portal.issn.org/resource/ISSN/2682-4396", - issn_data, + "https://portal.issn.org/resource/ISSN/9999-000X", + None, # Don't pass in any data, so we get the Not Found response False, pissn, "https://portal.issn.org/resource/ISSN/2682-4396", - issn_data, + pissn_data, False) ac2 = acSvc.autocheck_journal(j) diff --git a/portality/autocheck/checkers/keepers_registry.py b/portality/autocheck/checkers/keepers_registry.py index 17b89a5243..c722c2d864 100644 --- a/portality/autocheck/checkers/keepers_registry.py +++ b/portality/autocheck/checkers/keepers_registry.py @@ -19,6 +19,7 @@ class KeepersRegistry(ISSNChecker): MISSING = "missing" PRESENT = "present" OUTDATED = "outdated" + NOT_RECORDED = "not_recorded" def _get_archive_components(self, eissn_data, pissn_data): acs = [] @@ -62,6 +63,14 @@ def check(self, form: dict, for service in services: id = self.ID_MAP.get(service) if not id: + logger("Service {x} is not recorded by Keepers Registry".format(x=service)) + autochecks.add_check( + field="preservation_service", + advice=self.NOT_RECORDED, + reference_url=url, + context={"service": service}, + checked_by=self.__identity__ + ) continue coverage = ad.get(id) diff --git a/portality/static/js/autochecks.js b/portality/static/js/autochecks.js index 8dad0d673d..396c1dff2e 100644 --- a/portality/static/js/autochecks.js +++ b/portality/static/js/autochecks.js @@ -17,13 +17,22 @@ doaj.autocheckers.ISSNActive = class { "not_validated": "x-circle" } + STYLE = { + "unable_to_access": "error", + "not_found": "error", + "fully_validated": "success", + "not_validated": "warn" + } + draw(autocheck) { let icon = this.ICONS[autocheck.advice]; let message = this.MESSAGES[autocheck.advice]; message = message.replace("{{ISSN}}", autocheck.original_value); - let frag = `
- ${message} (see record).
`; + let style = this.STYLE[autocheck.advice]; + + let frag = `
+ ${message} (see record)
`; return frag; } } @@ -32,13 +41,22 @@ doaj.autocheckers.KeepersRegistry = class { MESSAGES = { "missing": "Keepers does not show any content archived in {service}.", "present": "The journal content is actively archived in {service}.", - "outdated": "The journal has content archived in {service} but it's not current." + "outdated": "The journal has content archived in {service} but it's not current.", + "not_recorded": "Keepers Registry does not currently record information about {service}." } ICONS = { "missing": "x-circle", "present": "check-circle", - "outdated": "x-circle" + "outdated": "x-circle", + "not_recorded": "info" + } + + STYLE = { + "missing": "error", + "present": "success", + "outdated": "error", + "not_recorded": "info" } draw(autocheck) { @@ -48,8 +66,10 @@ doaj.autocheckers.KeepersRegistry = class { let context = JSON.parse(autocheck.context); message = message.replace("{service}", context.service); - let frag = `
- ${message} (see record).
`; + let style = this.STYLE[autocheck.advice]; + + let frag = `
+ ${message} (see record)
`; return frag; } }