From 13bcc6816b054da67a3d6145520201d1c268cd7b Mon Sep 17 00:00:00 2001 From: dleadbetter Date: Thu, 19 Dec 2024 07:50:46 -0500 Subject: [PATCH 1/3] BASIRA #286 - Fixing issue with image info layout --- client/src/components/RecordPage.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/src/components/RecordPage.js b/client/src/components/RecordPage.js index 413db54..bba225f 100644 --- a/client/src/components/RecordPage.js +++ b/client/src/components/RecordPage.js @@ -11,7 +11,8 @@ import React, { import { Link } from 'react-router-dom'; import { Button, - Container, Grid, + Container, + Grid, Header as SemanticHeader, Loader, Menu, @@ -172,9 +173,6 @@ const Image = (props: ImageProps) => ( - ); @@ -203,6 +201,13 @@ const Header = (props: HeaderProps) => ( > { props.children } + + + ); From 071c3ce7d6557e2020d9552eba36e182b68dca25 Mon Sep 17 00:00:00 2001 From: dleadbetter Date: Thu, 19 Dec 2024 09:38:50 -0500 Subject: [PATCH 2/3] BASIRA #286 - Modifying fields on related locations and creators on artwork page --- app/serializers/places_serializer.rb | 2 +- client/src/components/ArtworkCreators.js | 11 ++--- client/src/components/Locations.js | 56 ++++++++++++------------ client/src/components/RolesView.js | 17 ++++--- client/src/i18n/en.json | 6 ++- 5 files changed, 50 insertions(+), 42 deletions(-) diff --git a/app/serializers/places_serializer.rb b/app/serializers/places_serializer.rb index d114eb7..1f56416 100644 --- a/app/serializers/places_serializer.rb +++ b/app/serializers/places_serializer.rb @@ -1,5 +1,5 @@ class PlacesSerializer < BaseSerializer - index_attributes :id, :name, :place_type, :lat, :long, :city, :state, :country + index_attributes :id, :name, :place_type, :lat, :long, :city, :state, :country, :url show_attributes :id, :name, :place_type, :lat, :long, :city, :state, :country, :url, :database_value, :notes, :same_as, :part_of, :authorized_vocabulary_url, qualifications: QualificationsSerializer diff --git a/client/src/components/ArtworkCreators.js b/client/src/components/ArtworkCreators.js index 0e726b0..83dc803 100644 --- a/client/src/components/ArtworkCreators.js +++ b/client/src/components/ArtworkCreators.js @@ -39,12 +39,9 @@ const ArtworkCreators = (props: Props) => { - - { Qualifiables.getValueListValue(item.person, 'Person', 'Nationality') } - { - { item.certainty && ( { /> )} + ))} diff --git a/client/src/components/Locations.js b/client/src/components/Locations.js index 8b1be2b..f198ece 100644 --- a/client/src/components/Locations.js +++ b/client/src/components/Locations.js @@ -1,10 +1,9 @@ // @flow -import React from 'react'; +import React, { useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { Header, Item } from 'semantic-ui-react'; import _ from 'underscore'; -import CertaintyLabel from './CertaintyLabel'; import type { Location } from '../types/Location'; import RolesView from './RolesView'; import Qualifiables from '../utils/Qualifiables'; @@ -15,9 +14,22 @@ type Props = { items: Array }; +const LOCATION_SEPARATOR = ', '; + const Locations = (props: Props) => { const { t } = useTranslation(); + /** + * Concatenates the city, state, and country attributes for the passed place. + * + * @type {function(*): *} + */ + const getLocationView = useCallback((place) => _.compact([ + place.city, + place.state, + place.country + ]).join(LOCATION_SEPARATOR), []); + if (!props.items) { return null; } @@ -43,40 +55,30 @@ const Locations = (props: Props) => { - - - - - { item.certainty && ( - - - - )} - { item.repository_work_url && ( - + { item.place?.url && ( + - { t('Common.buttons.viewSource') } + { t('Locations.labels.viewInstitution') } - + )} + + + ))} diff --git a/client/src/components/RolesView.js b/client/src/components/RolesView.js index c2754d8..f2a91f9 100644 --- a/client/src/components/RolesView.js +++ b/client/src/components/RolesView.js @@ -1,23 +1,28 @@ // @flow import React from 'react'; +import { Label } from 'semantic-ui-react'; import _ from 'underscore'; type Props = { - value: Array + items: Array }; -const ROLES_SEPARATOR = ', '; - const RolesView = (props: Props) => { - const value = _.compact(props.value); + const items = _.compact(props.items); - if (_.isEmpty(value)) { + if (_.isEmpty(items)) { return null; } return ( - { value.join(ROLES_SEPARATOR) } + + { _.map(items, (item) => ( + ); }; diff --git a/client/src/i18n/en.json b/client/src/i18n/en.json index 87c2909..3db259e 100644 --- a/client/src/i18n/en.json +++ b/client/src/i18n/en.json @@ -159,7 +159,6 @@ "buttons": { "back": "Back", "cancel": "Cancel", - "viewSource": "View Source", "save": "Save" }, "errors": { @@ -323,6 +322,11 @@ "edit": "Edit Location" } }, + "Locations": { + "labels": { + "viewInstitution": "View Institution" + } + }, "NotesModal": { "title": "Internal Notes" }, From 187914ef5b140c944b50029b53bcf4f4296ba408 Mon Sep 17 00:00:00 2001 From: dleadbetter Date: Fri, 20 Dec 2024 06:50:25 -0500 Subject: [PATCH 3/3] BASIRA #286 - Adjusting CSS of artwork titles --- client/src/components/ArtworkTitles.css | 9 +++++++-- client/src/components/ArtworkTitles.js | 22 +++++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/client/src/components/ArtworkTitles.css b/client/src/components/ArtworkTitles.css index f8f8663..d228dfb 100644 --- a/client/src/components/ArtworkTitles.css +++ b/client/src/components/ArtworkTitles.css @@ -1,5 +1,10 @@ -.artwork-titles .icon.white { - color: #FFFFFF; +.artwork-titles.list > .item > .content > .list-header { + display: flex; + align-items: center; +} + +.artwork-titles.list > .item > .content > .list-header > .icon { + margin-left: 0.5em; } .artwork-titles.list > .item > .content > .description { diff --git a/client/src/components/ArtworkTitles.js b/client/src/components/ArtworkTitles.js index 29f83b9..e4277c1 100644 --- a/client/src/components/ArtworkTitles.js +++ b/client/src/components/ArtworkTitles.js @@ -1,10 +1,10 @@ // @flow import React from 'react'; -import { List } from 'semantic-ui-react'; +import { Header, Icon, List } from 'semantic-ui-react'; import _ from 'underscore'; -import Qualifiables from '../utils/Qualifiables'; import type { ArtworkTitle } from '../types/ArtworkTitle'; +import Qualifiables from '../utils/Qualifiables'; import './ArtworkTitles.css'; type Props = { @@ -24,14 +24,22 @@ const ArtworkTitles = (props: Props) => { > { _.map(props.items, (item) => ( - + > +
+ { item.primary && ( + + )} +