Skip to content

Commit

Permalink
Merge pull request #1809 from catsoup11789/24.06.00
Browse files Browse the repository at this point in the history
initial swiper/accessible browse categories
  • Loading branch information
mdnoble73 committed May 20, 2024
2 parents 203fe45 + 17f6cf1 commit 491b561
Show file tree
Hide file tree
Showing 40 changed files with 12,211 additions and 164 deletions.
4 changes: 2 additions & 2 deletions code/aspen_app/app-configs/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "24.05.00",
"build": "238",
"version": "24.06.00",
"build": "245",
"patch": "0"
}
12 changes: 6 additions & 6 deletions code/aspen_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"@react-aria/ssr": "^3.9.2",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/datetimepicker": "7.6.3",
"@react-navigation/bottom-tabs": "^6.5.7",
"@react-navigation/devtools": "^6.0.18",
"@react-navigation/drawer": "^6.6.2",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"@react-navigation/stack": "^6.3.16",
"@react-navigation/bottom-tabs": "^6.5.20",
"@react-navigation/devtools": "^6.0.26",
"@react-navigation/drawer": "^6.6.15",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"@react-navigation/stack": "^6.3.29",
"@rneui/base": "^4.0.0-rc.7",
"@rneui/themed": "^4.0.0-rc.7",
"@sentry/react-native": "~5.20.0",
Expand Down
32 changes: 30 additions & 2 deletions code/aspen_app/src/screens/MyAccount/TitlesOnHold/MyHold.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import { Image } from 'expo-image';
import _ from 'lodash';
import { Actionsheet, Box, Button, Center, Checkbox, HStack, Icon, Pressable, Text, useDisclose, VStack } from 'native-base';
import React from 'react';
import { popAlert } from '../../../components/loadError';
import { HoldsContext, LanguageContext, LibrarySystemContext, UserContext } from '../../../context/initialContext';
import { getAuthor, getBadge, getCleanTitle, getExpirationDate, getFormat, getOnHoldFor, getPickupLocation, getPosition, getStatus, getTitle, getType } from '../../../helpers/item';
import { navigateStack } from '../../../helpers/RootNavigator';
import { getTermFromDictionary, getTranslationsWithValues } from '../../../translations/TranslationService';
import { cancelHold, cancelHolds, cancelVdxRequest, thawHold, thawHolds } from '../../../util/accountActions';
import { formatDiscoveryVersion } from '../../../util/loadLibrary';
import { checkoutItem } from '../../../util/recordActions';
import { SelectPickupLocation } from './SelectPickupLocation';
import { SelectThawDate } from './SelectThawDate.js';

Expand All @@ -27,6 +29,7 @@ export const MyHold = (props) => {
const { holds, updateHolds } = React.useContext(HoldsContext);
const { language } = React.useContext(LanguageContext);
const [cancelling, startCancelling] = React.useState(false);
const [checkingOut, startCheckingOut] = React.useState(false);
const [thawing, startThawing] = React.useState(false);
let label, method, icon, canCancel;
const version = formatDiscoveryVersion(library.discoveryVersion);
Expand Down Expand Up @@ -155,6 +158,30 @@ export const MyHold = (props) => {
}
};

const createCheckoutHoldAction = () => {
if (hold.source === 'overdrive' && hold.available) {
return (
<Actionsheet.Item
isLoading={checkingOut}
isLoadingText={getTermFromDictionary(language, 'checking_out', true)}
onPress={async () => {
startCheckingOut(true);
await checkoutItem(library.baseUrl, hold.recordId, hold.source, hold.userId, '', '', '').then((result) => {
popAlert(result.title, result.message, result.success ? 'success' : 'error');
resetGroup();
onClose();
startCheckingOut(false);
});
}}
startIcon={<Icon as={MaterialIcons} name="cart" color="trueGray.400" mr="1" size="6" />}>
{getTermFromDictionary(language, 'checkout_title')}
</Actionsheet.Item>
);
}

return null;
};

const createCancelHoldAction = () => {
if (canCancel && allowLinkedAccountAction) {
let label = getTermFromDictionary(language, 'cancel_hold');
Expand All @@ -172,7 +199,7 @@ export const MyHold = (props) => {
startCancelling(true);
cancelHold(hold.cancelId, hold.recordId, hold.source, library.baseUrl, hold.userId).then((r) => {
resetGroup();
onClose(onClose);
onClose();
startCancelling(false);
});
}}>
Expand All @@ -189,7 +216,7 @@ export const MyHold = (props) => {
startCancelling(true);
cancelVdxRequest(library.baseUrl, hold.sourceId, hold.cancelId).then((r) => {
resetGroup();
onClose(onClose);
onClose();
startCancelling(false);
});
}}>
Expand Down Expand Up @@ -270,6 +297,7 @@ export const MyHold = (props) => {
{getTitle(hold.title)}
</Text>
</Box>
{createCheckoutHoldAction()}
{createOpenGroupedWorkAction()}
{createCancelHoldAction()}
{createFreezeHoldAction()}
Expand Down
91 changes: 43 additions & 48 deletions code/aspen_app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4473,81 +4473,81 @@
invariant "^2.2.4"
nullthrows "^1.1.1"

"@react-navigation/bottom-tabs@^6.5.7":
version "6.5.7"
resolved "https://registry.yarnpkg.com/@react-navigation/bottom-tabs/-/bottom-tabs-6.5.7.tgz#08470c96e0d11481422214bb98f0ff034038856c"
integrity sha512-9oZYyRu2z7+1pr2dX5V54rHFPmlj4ztwQxFe85zwpnGcPtGIsXj7VCIdlHnjRHJBBFCszvJGQpYY6/G2+DfD+A==
"@react-navigation/bottom-tabs@^6.5.20":
version "6.5.20"
resolved "https://registry.yarnpkg.com/@react-navigation/bottom-tabs/-/bottom-tabs-6.5.20.tgz#5335e75b02c527ef0569bd97d4f9185d65616e49"
integrity sha512-ow6Z06iS4VqBO8d7FP+HsGjJLWt2xTWIvuWjpoCvsM/uQXzCRDIjBv9HaKcXbF0yTW7IMir0oDAbU5PFzEDdgA==
dependencies:
"@react-navigation/elements" "^1.3.17"
"@react-navigation/elements" "^1.3.30"
color "^4.2.3"
warn-once "^0.1.0"

"@react-navigation/core@^6.4.8":
version "6.4.8"
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-6.4.8.tgz#a18e106d3c59cdcfc4ce53f7344e219ed35c88ed"
integrity sha512-klZ9Mcf/P2j+5cHMoGyIeurEzyBM2Uq9+NoSFrF6sdV5iCWHLFhrCXuhbBiQ5wVLCKf4lavlkd/DDs47PXs9RQ==
"@react-navigation/core@^6.4.16":
version "6.4.16"
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-6.4.16.tgz#f9369a134805174536b9aa0f0f483b930511caf9"
integrity sha512-UDTJBsHxnzgFETR3ZxhctP+RWr4SkyeZpbhpkQoIGOuwSCkt1SE0qjU48/u6r6w6XlX8OqVudn1Ab0QFXTHxuQ==
dependencies:
"@react-navigation/routers" "^6.1.8"
"@react-navigation/routers" "^6.1.9"
escape-string-regexp "^4.0.0"
nanoid "^3.1.23"
query-string "^7.1.3"
react-is "^16.13.0"
use-latest-callback "^0.1.5"
use-latest-callback "^0.1.9"

"@react-navigation/devtools@^6.0.18":
version "6.0.18"
resolved "https://registry.yarnpkg.com/@react-navigation/devtools/-/devtools-6.0.18.tgz#91eb9f80520a708c22026b2f065f6a025c81a5c5"
integrity sha512-xII7CMPdhXFWtbMWFSKq/zG8993ISd1lSnlM9PeWQssoNydZjBffM/qH0Md1uu6XqjTdrHd+wrH2Vz4xeSWqLg==
"@react-navigation/devtools@^6.0.26":
version "6.0.26"
resolved "https://registry.yarnpkg.com/@react-navigation/devtools/-/devtools-6.0.26.tgz#c422c05edfb998d6939317a74a324dd598a2f13b"
integrity sha512-jbIb+678wb75Z1OiA/zP2g7ZuAviL9IFFTiadEcGog713n7XTm5xRr6uiCPWohalUJOvt8e9B8A2wRGmgELjHw==
dependencies:
deep-equal "^2.0.5"
nanoid "^3.1.23"
stacktrace-parser "^0.1.10"

"@react-navigation/drawer@^6.6.2":
version "6.6.2"
resolved "https://registry.yarnpkg.com/@react-navigation/drawer/-/drawer-6.6.2.tgz#8206d00a4b89f1f30640147e0c230267bb83d9ed"
integrity sha512-6qt4guBdz7bkdo/8BLSCcFNdQdSPYyNn05D9cD+VCY3mGThSiD8bRiP9ju+64im7LsSU+bNWXaP8RxA/FtTVQg==
"@react-navigation/drawer@^6.6.15":
version "6.6.15"
resolved "https://registry.yarnpkg.com/@react-navigation/drawer/-/drawer-6.6.15.tgz#fcedba68f735103dbc035911f5959ce926081d62"
integrity sha512-GLkFQNxjtmxB/qXSHmu1DfoB89jCzW64tmX68iPndth+9U+0IP27GcCCaMZxQfwj+nI8Kn2zlTlXAZDIIHE+DQ==
dependencies:
"@react-navigation/elements" "^1.3.17"
"@react-navigation/elements" "^1.3.30"
color "^4.2.3"
warn-once "^0.1.0"

"@react-navigation/elements@^1.3.17":
version "1.3.17"
resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-1.3.17.tgz#9cb95765940f2841916fc71686598c22a3e4067e"
integrity sha512-sui8AzHm6TxeEvWT/NEXlz3egYvCUog4tlXA4Xlb2Vxvy3purVXDq/XsM56lJl344U5Aj/jDzkVanOTMWyk4UA==
"@react-navigation/elements@^1.3.30":
version "1.3.30"
resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-1.3.30.tgz#a81371f599af1070b12014f05d6c09b1a611fd9a"
integrity sha512-plhc8UvCZs0UkV+sI+3bisIyn78wz9O/BiWZXpounu72k/R/Sj5PuZYFJ1fi6psvriUveMCGh4LeZckAZu2qiQ==

"@react-navigation/native-stack@^6.9.12":
version "6.9.12"
resolved "https://registry.yarnpkg.com/@react-navigation/native-stack/-/native-stack-6.9.12.tgz#a09fe43ab2fc4c82a1809e3953021d1da4ead85c"
integrity sha512-kS2zXCWP0Rgt7uWaCUKrRl7U2U1Gp19rM1kyRY2YzBPXhWGVPjQ2ygBp88CTQzjgy8M07H/79jvGiZ0mlEJI+g==
"@react-navigation/native-stack@^6.9.26":
version "6.9.26"
resolved "https://registry.yarnpkg.com/@react-navigation/native-stack/-/native-stack-6.9.26.tgz#90facf7783c9927f094bc9f01c613af75b6c241e"
integrity sha512-++dueQ+FDj2XkZ902DVrK79ub1vp19nSdAZWxKRgd6+Bc0Niiesua6rMCqymYOVaYh+dagwkA9r00bpt/U5WLw==
dependencies:
"@react-navigation/elements" "^1.3.17"
"@react-navigation/elements" "^1.3.30"
warn-once "^0.1.0"

"@react-navigation/native@^6.1.6":
version "6.1.6"
resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-6.1.6.tgz#84ff5cf85b91f660470fa9407c06c8ee393d5792"
integrity sha512-14PmSy4JR8HHEk04QkxQ0ZLuqtiQfb4BV9kkMXD2/jI4TZ+yc43OnO6fQ2o9wm+Bq8pY3DxyerC2AjNUz+oH7Q==
"@react-navigation/native@^6.1.17":
version "6.1.17"
resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-6.1.17.tgz#439f15a99809d26ea4682d2a3766081cf2ca31cf"
integrity sha512-mer3OvfwWOHoUSMJyLa4vnBH3zpFmCwuzrBPlw7feXklurr/ZDiLjLxUScOot6jLRMz/67GyilEYMmP99LL0RQ==
dependencies:
"@react-navigation/core" "^6.4.8"
"@react-navigation/core" "^6.4.16"
escape-string-regexp "^4.0.0"
fast-deep-equal "^3.1.3"
nanoid "^3.1.23"

"@react-navigation/routers@^6.1.8":
version "6.1.8"
resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-6.1.8.tgz#ae56b2678dbb5abca5bd7c95d6a8d1abc767cba2"
integrity sha512-CEge+ZLhb1HBrSvv4RwOol7EKLW1QoqVIQlE9TN5MpxS/+VoQvP+cLbuz0Op53/iJfYhtXRFd1ZAd3RTRqto9w==
"@react-navigation/routers@^6.1.9":
version "6.1.9"
resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-6.1.9.tgz#73f5481a15a38e36592a0afa13c3c064b9f90bed"
integrity sha512-lTM8gSFHSfkJvQkxacGM6VJtBt61ip2XO54aNfswD+KMw6eeZ4oehl7m0me3CR9hnDE4+60iAZR8sAhvCiI3NA==
dependencies:
nanoid "^3.1.23"

"@react-navigation/stack@^6.3.16":
version "6.3.16"
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-6.3.16.tgz#cf94e3c8c1587455515743e91d328beef722e0ab"
integrity sha512-KTOn9cNuZ6p154Htbl2DiR95Wl+c7niLPRiGs7gjOkyVDGiaGQF9ODNQTYBDE1OxZGHe/EyYc6T2CbmiItLWDg==
"@react-navigation/stack@^6.3.29":
version "6.3.29"
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-6.3.29.tgz#b03b2f2baa36c06e4c9e8c7da80d62f83ad0b835"
integrity sha512-tzlGkoRgB6P7vgw7rHuWo3TL7Gzu6xh5LMf+zSdCuEiKp/qASzxYfnTEr9tOLbVs/gf+qeukEDheCSAJKVpBXw==
dependencies:
"@react-navigation/elements" "^1.3.17"
"@react-navigation/elements" "^1.3.30"
color "^4.2.3"
warn-once "^0.1.0"

Expand Down Expand Up @@ -12866,11 +12866,6 @@ url@^0.11.0:
punycode "1.3.2"
querystring "0.2.0"

use-latest-callback@^0.1.5:
version "0.1.5"
resolved "https://registry.yarnpkg.com/use-latest-callback/-/use-latest-callback-0.1.5.tgz#a4a836c08fa72f6608730b5b8f4bbd9c57c04f51"
integrity sha512-HtHatS2U4/h32NlkhupDsPlrbiD27gSH5swBdtXbCAlc6pfOFzaj0FehW/FO12rx8j2Vy4/lJScCiJyM01E+bQ==

use-latest-callback@^0.1.9:
version "0.1.9"
resolved "https://registry.yarnpkg.com/use-latest-callback/-/use-latest-callback-0.1.9.tgz#10191dc54257e65a8e52322127643a8940271e2a"
Expand Down
11 changes: 9 additions & 2 deletions code/web/RecordDrivers/CourseReservesRecordDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,18 @@ public function getBrowseResult() {

$interface->assign('bookCoverUrl', $this->getBookcoverUrl('small'));

if ($appliedTheme != null && $appliedTheme->browseCategoryImageSize == 1) {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('large'));
$accessibleBrowseCategories = 0;
if ($appliedTheme) {
if($appliedTheme->browseCategoryImageSize == 1) {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('large'));
} else {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('medium'));
}
$accessibleBrowseCategories = $appliedTheme->accessibleBrowseCategories;
} else {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('medium'));
}
$interface->assign('accessibleBrowseCategories', $accessibleBrowseCategories);

return 'RecordDrivers/CourseReserve/cover_result.tpl';
}
Expand Down
11 changes: 9 additions & 2 deletions code/web/RecordDrivers/EbscoRecordDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,18 @@ public function getBrowseResult() {

$interface->assign('bookCoverUrl', $this->getBookcoverUrl('small'));

if ($appliedTheme != null && $appliedTheme->browseCategoryImageSize == 1) {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('large'));
$accessibleBrowseCategories = 0;
if ($appliedTheme) {
if($appliedTheme->browseCategoryImageSize == 1) {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('large'));
} else {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('medium'));
}
$accessibleBrowseCategories = $appliedTheme->accessibleBrowseCategories;
} else {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('medium'));
}
$interface->assign('accessibleBrowseCategories', $accessibleBrowseCategories);

return 'RecordDrivers/EBSCO/browse_result.tpl';
}
Expand Down
12 changes: 10 additions & 2 deletions code/web/RecordDrivers/EbscohostRecordDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,19 @@ public function getBrowseResult() {

$interface->assign('bookCoverUrl', $this->getBookcoverUrl('small'));

if ($appliedTheme != null && $appliedTheme->browseCategoryImageSize == 1) {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('large'));
$accessibleBrowseCategories = 0;
if ($appliedTheme) {
if($appliedTheme->browseCategoryImageSize == 1) {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('large'));
} else {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('medium'));
}
$accessibleBrowseCategories = $appliedTheme->accessibleBrowseCategories;
} else {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('medium'));
}
$interface->assign('accessibleBrowseCategories', $accessibleBrowseCategories);

return 'RecordDrivers/EBSCOhost/browse_result.tpl';
}

Expand Down
28 changes: 26 additions & 2 deletions code/web/RecordDrivers/GroupedWorkDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,37 +520,55 @@ function getBookcoverUrl($size = 'small', $absolutePath = false) {

public function getBrowseResult() {
global $interface;
$item = [];
$id = $this->getUniqueID();
$interface->assign('summId', $id);
$item['summId'] = $id;

$url = $this->getMoreInfoLinkUrl();

$interface->assign('summUrl', $url);
$item['summUrl'] = $url;

$shortTitle = $this->getShortTitle();
if (empty($shortTitle)) {
$interface->assign('summTitle', $this->getTitle());
$interface->assign('summSubTitle', '');
$item['summTitle'] = $this->getTitle();
$item['summSubTitle'] = '';
} else {
$interface->assign('summTitle', $this->getShortTitle());
$interface->assign('summSubTitle', $this->getSubtitle());
$item['summTitle'] = $this->getShortTitle();
$item['summSubTitle'] = $this->getSubtitle();
}
$interface->assign('summAuthor', $this->getPrimaryAuthor());
$item['summAuthor'] = $this->getPrimaryAuthor();

//Get Rating
$interface->assign('ratingData', $this->getRatingData());
$item['ratingData'] = $this->getRatingData();

//Get cover image size
global $interface;
$appliedTheme = $interface->getAppliedTheme();

$interface->assign('bookCoverUrl', $this->getBookcoverUrl('small'));
$item['bookCoverUrl'] = $this->getBookcoverUrl('large');
$accessibleBrowseCategories = 0;

if ($appliedTheme != null && $appliedTheme->browseCategoryImageSize == 1) {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('large'));
if ($appliedTheme != null) {
if($appliedTheme->browseCategoryImageSize == 1) {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('large'));
} else {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('medium'));
}
$accessibleBrowseCategories = $appliedTheme->accessibleBrowseCategories;
} else {
$interface->assign('bookCoverUrlMedium', $this->getBookcoverUrl('medium'));
}


// Rating & Browse Mode Settings
global $library;
global $location;
Expand All @@ -568,6 +586,12 @@ public function getBrowseResult() {

$interface->assign('browseCategoryRatingsMode', $browseCategoryRatingsMode);

$item['browseMode'] = $browseMode;
$item['browseCategoryRatingsMode'] = $browseCategoryRatingsMode;
/*if($accessibleBrowseCategories == 1) {
return $item;
}*/

return 'RecordDrivers/GroupedWork/browse_result.tpl';
}

Expand Down

0 comments on commit 491b561

Please sign in to comment.