Skip to content

Commit

Permalink
Merge branch 'main' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
monotasker committed Dec 10, 2024
2 parents 3ab69d9 + 43c3ee1 commit a6daae9
Show file tree
Hide file tree
Showing 18 changed files with 163 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Knowledge Commons Works is a collaborative tool for storing and sharing academic research. It is part of Knowledge Commons and is built on an instance of the InvenioRDM repository system.

Version 0.3.2-beta5

## Copyright

Copyright 2023-24 Mesh Research. Released under the MIT license. (See the included LICENSE.txt file.)
Expand Down
6 changes: 6 additions & 0 deletions assets/less/site/elements/list.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@
&:hover {
background-color: transparent;
}
}

.details-list {
dd {
overflow-wrap: break-word;
}
}
41 changes: 36 additions & 5 deletions assets/less/site/globals/site.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ html.cover-page {
margin-bottom: 0.25rem;
margin-top: 1rem;
}
dd {
overflow-wrap: break-word;
}
}
.record-details-tab {
&.ui.attached.segment {
Expand Down Expand Up @@ -680,6 +683,7 @@ html.cover-page {
margin-bottom: 1rem;
.ui.button.icon.right.labeled {
padding-left: 1rem !important;
text-align: left;
}
}
#record-details-download {
Expand Down Expand Up @@ -717,19 +721,46 @@ html.cover-page {
margin-bottom: 1rem;
}
&#social-sharing {
.button {
margin-bottom: 0.25rem;
.icon {
color: @primaryTextColor;
svg {
height: 1em;
width: 1em;
fill: @primaryTextColor;
}
}
&:hover,
&:focus,
&:active {
.icon {
color: @ivy !important;
svg {
fill: @ivy !important;
}
}
}
}
.mastodon-popup {
width: 2.75rem;
height: 0.25rem;
display: inline-block;
position: absolute;
background-color: transparent;
}
.button {
margin-bottom: 0.25rem;
.icon.bluesky {
svg {
position: relative;
top: 1.5px;
}
}
.icon.mastodon {
svg {
height: 1em;
width: 1em;
fill: @primaryColor;
position: relative;
top: -0.5px;
height: 1.15em;
width: 1.15em;
}
}
}
Expand Down
50 changes: 50 additions & 0 deletions invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -548,18 +548,68 @@ RDM_FACETS = {
},
}

RDM_SORT_OPTIONS = {
"bestmatch": dict(
title=_("Best match"),
fields=["_score"], # search defaults to desc on `_score` field
),
"newest": dict(
title=_("Newest"),
fields=["-created"],
),
"oldest": dict(
title=_("Oldest"),
fields=["created"],
),
"published-desc": dict(
title=_("Most recently published"),
fields=["-metadata.publication_date"],
),
"published-asc": dict(
title=_("Earliest published"),
fields=["metadata.publication_date"],
),
"version": dict(
title=_("Version"),
fields=["-versions.index"],
),
"updated-desc": dict(
title=_("Recently updated"),
fields=["-updated"],
),
"updated-asc": dict(
title=_("Least recently updated"),
fields=["updated"],
),
"mostviewed": dict(
title=_("Most viewed"), fields=["-stats.all_versions.unique_views"]
),
"mostdownloaded": dict(
title=_("Most downloaded"), fields=["-stats.all_versions.unique_downloads"]
),
}

RDM_SEARCH = {
"facets": ["resource_type", "language", "file_type", "access_status"],
"sort": [
"bestmatch",
"newest",
"oldest",
"published-desc",
"published-asc",
"version",
"mostviewed",
"mostdownloaded",
],
}

RDM_SEARCH_USER_COMMUNITIES = {
"facets": ["visibility", "type"],
"sort": ["bestmatch", "newest", "oldest"],
"sort_default": "bestmatch",
"sort_default_no_query": "newest",
}
"""User communities search configuration (i.e list of user communities)"""

# Invenio-App-RDM
# ===============
Expand Down
52 changes: 52 additions & 0 deletions site/CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!-- This file is part of Knowledge Commons Works. -->
<!-- Copyright (C) 2024 Mesh Research. -->

# Changes

## 0.3.2-beta5 (2024-12-11)

- Added Bluesky sharing option to detail page
- Fixed line wrapping of long values in record sidebar details
- Added OpenGraph image metadata property to record detail page
- This allows social media platforms to display the KCWorks logo instead of a random image they might find on the page.

## 0.3.1-beta4 (2024-12-10)

- Added sort options for publication date to record search
- This allows users to sort records by the date they were published.
- It also allows publication-date sorting in API requests to the search API. Among other things, this allows users' KC profiles to display records in publication date order.
- Community selection modal bug fixes
- This affects the modal that appears both during record submission on the upload form and during collection management on the detail page.
- Fixed the sort order of search results in the modal. These were being sorted by record creation date, leading to a confusing sort order. It now sorts by "best match". This allows, e.g., "Knowledge Commons" to find the main KC collection.
- Also fixed the handling of '/' in the search query string. This allows, e.g., "ARLIS/NA" to find the ARLIS/NA collection, where previously it would produce an error.

## 0.3.0-beta3 (2024-11-30)

- Record detail page
- Added ui for collection management
- A new menu appears in the detail page sidebar when a user has permission to edit a record. This
allows users to manage the record's collections right from the detail page.
- With this menu users can now
- submit a request to have an existing published record added to a collection.
- add a record to multiple collections
- remove a record from some or all of its collections
- view pending collection submissions for the record
- change which collection appears as the primary collection for the record (i.e., the collection whose logo appears in the record's detail page sidebar)
- Refactored record management menu
- Refactored all sidebar menus (including the record management menu) to allow accessible
keyboard navigation
- Fixed display of event metadata
- Added display for work doi as well as version doi
- Each record has at least two DOIs: a work DOI and a version DOI. The work DOI is the DOI for the record as a whole. It always points to the most recent version of the work, even if the user creates new versions in the future. The other identifier is the version DOI, which will always point to the specific version of the work that the user is currently viewing. Previously, only the version DOI was displayed, which could be confusing if the user created a new version of the work.

- Upload form
- Added proper messages to collections widget for published records
- since collections for published records are now managed from the detail page, the collections widget now displays messages to users pointing them to the detail page to manage collections.
- Added clearer titles to form when editing an existing record
or creating a new version
- Previously, the form would display "Editing Published Record" both when editing the metadata of an existing published version *and* when creating a new version. The header now displays "Creating New Version" when creating a new version, and "Editing Published Record" when editing the metadata of an existing published version.
- Changed default publisher from "unknown" to "Knowledge Commons"
- Previously, the default publisher was "unknown". This was especially confusing for resource types where the publisher field is hidden on the upload form. Now, the default publisher is "Knowledge Commons".

- Solved collection links bug with custom routes
- This is a back-end technical fix that should not be visible to users.
2 changes: 2 additions & 0 deletions site/kcworks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
# invenio-app-rdm package for more details.

"""KCWorks customizations to InvenioRDM."""

__version__ = "0.3.2-beta5"
4 changes: 3 additions & 1 deletion site/kcworks/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def create_api_blueprint(app):
lambda e: make_response(
jsonify(
{
"message": "You are not authorized to perform this action",
"message": (
"You are not authorized to perform this action"
),
"status": 403,
}
),
Expand Down
2 changes: 1 addition & 1 deletion site/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "kcworks"
dynamic = ["version"]
version = "0.3.2-beta5"

[project.optional-dependencies]
tests = ["pytest-invenio>=2.1.0,<3.0.0"]
Expand Down
3 changes: 3 additions & 0 deletions static/images/bluesky.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed static/images/hc-icon.jpg
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
{# <meta name="citation_lastpage" content="{{record.custom_fields['journal:journal'].pages}}" /> #}

{{- meta_opengraph(meta_title, meta_description, url=meta_url) }}
<meta property="og:image" content="{{config['SITE_UI_URL']}}{{url_for('static', filename=config['THEME_LOGO'])}}" />

{{- meta_twittercard(meta_title, meta_description) }}

Expand Down

0 comments on commit a6daae9

Please sign in to comment.