Skip to content

Commit 68b82f2

Browse files
authored
Merge pull request #9 from HSG-Library/develop
Release v2022.02.16
2 parents ab84a9f + 79f9410 commit 68b82f2

24 files changed

+543
-25
lines changed

css/eth-locations-filter.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ prm-location-items prm-service-button .md-button.button-as-link {
3131

3232
html#primoExploreRoot {
3333
overflow-y: auto !important;
34-
}
34+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.hsg-collapsed {
2+
overflow: hidden;
3+
}
4+
5+
.hsg-expanded {
6+
overflow: hidden;
7+
}
8+
9+
.hsg-collapsed .hsg-foldable-item {
10+
display: none;
11+
}
12+
13+
.hsg-collapsed .hsg-foldable-item-longtext {
14+
text-overflow: ellipsis;
15+
overflow: hidden;
16+
display: -webkit-box !important;
17+
-webkit-line-clamp: 4;
18+
-webkit-box-orient: vertical;
19+
white-space: normal;
20+
}
21+
22+
.hsg-expand-button,
23+
.hsg-collapse-button {
24+
display: inline-block;
25+
cursor: pointer;
26+
line-height: 23px;
27+
border-radius: 2px;
28+
border: 1px solid rgba(0, 0, 0, 0.59);
29+
padding: 1px 10px 1px 0px;
30+
margin-top: 10px;
31+
}
32+
33+
.hsg-expand-button {
34+
margin-bottom: 10px;
35+
}
36+
37+
.hsg-expand-button:hover,
38+
.hsg-collapse-button:hover {
39+
background-color: #ddd;
40+
}
41+
42+
.hsg-fold-icon-collapse {
43+
transform: rotate(180deg);
44+
margin-top: -5px;
45+
}

js/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import { hsgHowovpAfterModule } from './modules/alma-howovp-after/hsg-howovp-after.module';
3+
import { hsgHtgiSvcAfterModule } from './modules/alma-htgi-svc-after/hsg-htgi-svc-after.module';
34
import { hsgAlertMessageModule } from './modules/hsg-alert-message/hsg-alert-message.module';
45
import { hsgExceptionHandlerModule } from './modules/hsg-exception-handler/hsg-exception-handler.module';
56
import { hsgAlmaViewitAfterModule } from './modules/prm-alma-viewit-after/hsg-alma-viewit-after.module';
@@ -10,6 +11,7 @@ import { hsgLocationsAfterModule } from './modules/prm-locations-after/hsg-locat
1011
import { hsgPersonalInfoAfterModule } from './modules/prm-personal-info-after/hsg-personal-info-after.module';
1112
import { hsgRequestAfterModule } from './modules/prm-request-after/hsg-request-after.module';
1213
import { hsgSearchResultAvailabilityLineAfterModule } from './modules/prm-search-result-availability-line-after/hsg-search-result-availabilty-line-after.module';
14+
//import { hsgServiceDetailsAfterModule } from './modules/prm-service-details-after/hsg-service-details-after.module';
1315
import { hsgStackMapAfterModule } from './modules/prm-stack-map-after/hsg-stack-map-after.module';
1416
import { hsgUserAreaExpandableAfterModule } from './modules/prm-user-area-expandable-after/hsg-user-ara-expandable-after.module';
1517
import { slspHttpInterceptRequestsModule } from './modules/slsp-http-intercept-requests/slsp-http-intercept-requests.module';
@@ -19,6 +21,7 @@ let app = angular.module('viewCustom', ['angularLoad']);
1921
app.requires.push(hsgAlertMessageModule.name);
2022
app.requires.push(hsgExceptionHandlerModule.name);
2123
app.requires.push(hsgHowovpAfterModule.name);
24+
app.requires.push(hsgHtgiSvcAfterModule.name);
2225
app.requires.push(hsgAlmaViewitAfterModule.name);
2326
app.requires.push(hsgJournalsAfterModule.name);
2427
app.requires.push(hsgLoanAfterModule.name);
@@ -27,6 +30,7 @@ app.requires.push(hsgLocationsAfterModule.name);
2730
app.requires.push(hsgPersonalInfoAfterModule.name);
2831
app.requires.push(hsgRequestAfterModule.name);
2932
app.requires.push(hsgSearchResultAvailabilityLineAfterModule.name);
33+
//app.requires.push(hsgServiceDetailsAfterModule.name);
3034
app.requires.push(hsgStackMapAfterModule.name);
3135
app.requires.push(hsgUserAreaExpandableAfterModule.name);
3236
app.requires.push(slspHttpInterceptRequestsModule.name);

js/modules/README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,75 @@
22
* **`alma-howovp-after`** *hook*
33
* **`slsp-ill-signin-order-alert`** *module*\
44
Adapted from SLSP, see: https://github.com/Swiss-Library-Service-Platform/Swisscovery-Network-Zone/tree/main/41SLSP_NETWORK-VU1_UNION/js/slsp-ill-signin-order-alert
5+
6+
* **`alma-htgi-svc-after`** *hook*
7+
* **`slsp-archives-htgi`** *module*\
8+
Adapted from SLSP, see: https://github.com/Swiss-Library-Service-Platform/central-customization-package/tree/main/41SLSP_NETWORK-CENTRAL_PACKAGE/js/slsp-archives-htgi
9+
510
* **`hsg-alert-message`** *global module*\
611
Module used on the homepage to display (alert) messages to the users. The messages can be edited in SharePoint, and will be retrieved via ajax.
12+
713
* **`hsg-exception-handler`** *global module*\
814
Global exception handler which logs exceptions and adds a marker (`**HSG-SWISSCOVERY**`) in front of all console logs if the error originates from a custom file.\
915
There is a proof of concept to report exceptions to a remote serivce via http, in order to centrally collect and analyze errors.
16+
1017
* **`prm-alma-viewit-after`** *hook*
1118
* **`hsg-off-campus-info`** *module*\
1219
Info message, that licensed e-ressources are only accessible from the HSG network. Very similar to the [BCUF solution](https://github.com/BCUF/bcufr-primo-views/tree/master/41SLSP_BCUFR-DFR/js/modules/prm-alma-viewit-after/bcu-off-campus) and the [ETHZ Solution](https://gitlab.com/ethlibrary/slsp/customization-eth-view/-/tree/master/js/modules/prm-alma-delivery-after/eth-fullview-offcampus-warning)
1320
* **`hsg-report-broken-link`** *module* \
1421
Link which reports a broken link to an e-ressource. The link triggers a modal popup and automatically sends an email and adds the broken link into an Excel file via a Microsoft [PowerAutomate flow](https://emea.flow.microsoft.com/manage/environments/Default-a7262e59-1b56-4f5a-a412-6f07181f48ee/flows/f2987d08-631f-4e91-a320-318b0793d158/details). Similar to the [BCUF solution](https://github.com/BCUF/bcufr-primo-views/tree/master/41SLSP_BCUFR-DFR/js/modules/prm-alma-viewit-after/bcu-online-feedback) and the [ETHZ Solution](https://gitlab.com/ethlibrary/slsp/customization-eth-view/-/tree/master/js/modules/prm-alma-delivery-after/eth-online-feedback-mail)
22+
* **`slsp-archives-viewit`** *module*\
23+
Adapted from SLSP, see: https://github.com/Swiss-Library-Service-Platform/central-customization-package/tree/main/41SLSP_NETWORK-CENTRAL_PACKAGE/js/slsp-archives-viewit
24+
1525
* **`prm-journals-after`** *hook*
1626
* **`hsg-journals-startpage`** *module*\
1727
Start page for the journals search, similar to the [ETHZ Solution](https://gitlab.com/ethlibrary/slsp/customization-eth-view/-/tree/master/js/modules/prm-journals-after/eth-journals-startpage)
28+
1829
* **`prm-loans-after`** *hook*
1930
* **`slsp-renew-item-text`** *module*\
2031
New way to display reasons why an item is not renewable [SLSP Solution](https://github.com/Swiss-Library-Service-Platform/swisscovery/tree/main/41SLSP_NETWORK-VU1_UNION/js/prm-loan-after/slsp-renew-item-text)
32+
2133
* **`prm-location-items-after`** *hook*
34+
* **`eth-location-items-filter`** *module*\
35+
Adapted from [ETHZ Solution](https://gitlab.com/ethlibrary/slsp/customization-eth-view/-/tree/master/js/modules/prm-location-items-after/eth-location-items-filter) as suggested by [SLSP](https://github.com/Swiss-Library-Service-Platform/swisscovery/tree/main/41SLSP_NETWORK-VU1_UNION/js/prm-location-items-after).
2236
* **`slsp-i-button`** *module*\
2337
Adapted from SLSP, see: https://github.com/Swiss-Library-Service-Platform/Swisscovery-Network-Zone/tree/main/41SLSP_NETWORK-VU1_UNION/js/slsp-i-button
38+
2439
* **`prm-locations-after`** *hook*
2540
* **`eth-locations-filter`** *module*\
2641
Adapted from [ETHZ Solution](https://gitlab.com/ethlibrary/slsp/customization-eth-view/-/tree/master/js/modules/prm-locations-after/eth-locations-filter) as suggested by [SLSP](https://github.com/Swiss-Library-Service-Platform/swisscovery/tree/main/41SLSP_NETWORK-VU1_UNION/js/prm-locations-after)
42+
2743
* **`prm-personal-info-after`** *hook*
2844
* **`slsp-edit-personal-details`** *module*\
2945
Adapted from SLSP, see: https://github.com/Swiss-Library-Service-Platform/Swisscovery-Network-Zone/tree/main/41SLSP_NETWORK-VU1_UNION/js/slsp-edit-personal-details
46+
3047
* **`prm-request-after`** *hook*
3148
* **`hsg-reading-room-info` (not active)** *module*\
3249
Message which is displayed if all available items are unvailable, but there is a 'reading room only' item which a user can request without waiting: *"The loanable items are not available. To order the non-loanable copy to the Service Point for viewing, select the pick-up location HSG Reading Room. If you choose the pick-up location HSG, you will be placed on the waiting list."*
3350
* **`sls-courier-info`** *module*\
3451
Adapted from SLSP, see: https://github.com/Swiss-Library-Service-Platform/Swisscovery-Network-Zone/tree/main/41SLSP_NETWORK-VU1_UNION/js/slsp-courier-info
52+
53+
* **`prm-search-result-availability-line-after`** *hook*
54+
* **`hsg-browzine-integration`** *module*\
55+
BrowZine integration
56+
* **`slsp-archives-availability-line`** *module*\
57+
Adapted from SLSP, see: https://github.com/Swiss-Library-Service-Platform/central-customization-package/tree/main/41SLSP_NETWORK-CENTRAL_PACKAGE/js/slsp-archives-viewit
58+
59+
* **`prm-service-details-after`** *hook*
60+
* **`hsg-service-details-foldable-items`** *module*\
61+
Overly long service details entries, eg. table of contents, are collapsed and can be expandend
62+
3563
* **`prm-stack-map-after`** *hook*
3664
* **`hsg-stack-map-link`** *module*\
3765
The stack map (MediaScout) opens in a modal dialog instead of a new tab/window.
66+
3867
* **`prm-user-area-expandable-after`** *hook*
3968
* **`bcu-lang-switch`** *module*\
4069
Adapted from SLSP, see: https://github.com/Swiss-Library-Service-Platform/swisscovery/tree/main/41SLSP_NETWORK-VU1_UNION/js/prm-user-area-expandable-after/bcu-lang-switch \
4170
Slight modification in the CSS, as well as the code structure.
4271
* **`sls-ill-signin-order-logged-out`** *module*\
4372
Adapted from SLSP, see: https://github.com/Swiss-Library-Service-Platform/Swisscovery-Network-Zone/tree/main/41SLSP_NETWORK-VU1_UNION/js/slsp-ill-signin-order-logged-out
73+
4474
* **`slsp-http-intercept-requests`** *global module*\
4575
Adapted from SLSP see: https://github.com/Swiss-Library-Service-Platform/swisscovery/tree/main/41SLSP_NETWORK-VU1_UNION/js/slsp-http-intercept-requests \
46-
Users are now allowed to cancel a request or a digitization request only if the process is "not started" or "process started". If the process is "in process", "in transit" and “on hold shelf”, the user cannot cancel a request or a digitization.
76+
Users are now allowed to cancel a request or a digitization request only if the process is "not started" or "process started". If the process is "in process", "in transit" and “on hold shelf”, the user cannot cancel a request or a digitization.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { slspArchivesHtgiModule } from './slsp-archives-htgi/slsp-archives-htgi.module';
2+
3+
export const hsgHtgiSvcAfterModule = angular
4+
.module('hsgHtgiSvcAfterModule', [])
5+
.component('almaHtgiSvcAfter', {
6+
bindings: { parentCtrl: '<' },
7+
template: `
8+
<slsp-archives-htgi-component after-ctrl="$ctrl"></slsp-archives-htgi-component>
9+
`
10+
});
11+
12+
hsgHtgiSvcAfterModule.requires.push(slspArchivesHtgiModule.name);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
export class slspArchivesHtgiController {
2+
3+
constructor() {
4+
this.parentCtrl = this.afterCtrl.parentCtrl;
5+
}
6+
7+
$onInit() {
8+
console.log('archives yo');
9+
if (!this.parentCtrl.item.pnx.display.source || this.parentCtrl.item.pnx.display.source.length === 0) {
10+
return;
11+
}
12+
this.source = this.parentCtrl.item.pnx.display.source[0];
13+
// CMI STAR sources
14+
if (this.source === 'ETH_MaxFrischArchiv' || this.source === 'ETH_ThomasMannArchiv') {
15+
// hide content of htgi section
16+
let section = document.getElementById('full-view-container');
17+
section.classList.add('slsp-archives-hide');
18+
19+
// get guid of CMIStar
20+
let sourceid = this.parentCtrl.item.pnx.control.originalsourceid[0];
21+
let guid = sourceid.substring(sourceid.lastIndexOf(':') + 1);
22+
23+
// different sources: concat url
24+
if (this.source === 'ETH_ThomasMannArchiv') {
25+
this.url = 'http://www.online.tma.ethz.ch/home/#/content/' + guid;
26+
// only for test
27+
//this.label = 'Detailed information in Thomas Mann-Archiv Online (metadata only)';
28+
}
29+
else if (this.source === 'ETH_MaxFrischArchiv') {
30+
this.url = 'http://maxfrischarchiv-online.ethz.ch/home/#/content/' + guid;
31+
// only for test
32+
//this.label = 'Request via Max Frisch-Archiv Online';
33+
}
34+
}
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<div class="slsp-archives" ng-if="$ctrl.url">
2+
<md-list layout="column" class="separate-list-items md-primoExplore-theme layout-column" role="list">
3+
<md-list-item role="listitem" ng-href="{{$ctrl.url}}" target="_blank">
4+
<span>{{('customized.archives.' + $ctrl.source + '.linktext' | translate)}}</span>
5+
<span>{{$ctrl.label}}</span>
6+
<div class="md-secondary">
7+
<prm-icon icon-type="svg" svg-icon-set="primo-ui" icon-definition="open-in-new" class="layout-margin" />
8+
</div>
9+
</md-list-item>
10+
</md-list>
11+
<div ng-if="$ctrl.source === 'ETH_ThomasMannArchiv'" class="slsp-archives-additional-hint">
12+
<div>
13+
<span translate="customized.archives.ETH_ThomasMannArchiv.text1">No request possible. The digitized item can
14+
be consulted in the Thomas Mann Archives reading room upon advance registration (</span>
15+
<a target="_blank" rel="noopener" ng-href="https://tma.ethz.ch/utils/kontakt.html">
16+
<span translate="customized.archives.ETH_ThomasMannArchiv.linktext2">Contact</span>
17+
<prm-icon external-link icon-type="svg" svg-icon-set="primo-ui" icon-definition="open-in-new">
18+
</prm-icon>
19+
</a>
20+
<span translate="customized.archives.ETH_ThomasMannArchiv.text2">).</span>
21+
</div>
22+
</div>
23+
<div ng-if="$ctrl.source === 'ETH_MaxFrischArchiv'" class="slsp-archives-additional-hint">
24+
<div>
25+
<span translate="customized.archives.ETH_MaxFrischArchiv.text1">Informationen zu Bestellung und Benutzung
26+
siehe</span>
27+
<a target="_blank" rel="noopener" ng-href="http://maxfrischarchiv-online.ethz.ch/home/#/manual">
28+
<span translate="customized.archives.ETH_MaxFrischArchiv.linktext2">Bedienungshinweise</span>
29+
<prm-icon external-link icon-type="svg" svg-icon-set="primo-ui" icon-definition="open-in-new">
30+
</prm-icon>
31+
</a>
32+
<span translate="customized.archives.ETH_MaxFrischArchiv.text2">.</span>
33+
</div>
34+
</div>
35+
</div>
36+
<slsp-htgi-svc-after parent-ctrl="$parent.$ctrl"></slsp-htgi-svc-after>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { slspArchivesHtgiController } from './slsp-archives-htgi.controller';
2+
import { slspArchivesHtgiHtml } from './slsp-archives-htgi.html';
3+
4+
export const slspArchivesHtgiModule = angular
5+
.module('slspArchivesHtgiModule', [])
6+
.controller('slspArchivesHtgiController', slspArchivesHtgiController)
7+
.component('slspArchivesHtgiComponent', {
8+
bindings: { afterCtrl: '<' },
9+
controller: 'slspArchivesHtgiController',
10+
template: slspArchivesHtgiHtml
11+
});
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import { hsgOffCampusInfoModule } from "./hsg-off-campus-info/hsg-off-campus-info.module";
22
import { hsgReportBrokenLinkModule } from "./hsg-report-broken-link/hsg-report-broken-link.module";
3+
import { slspArchivesViewitModule } from "./slsp-archives-viewit/slsp-archives-viewit.module";
34

45
export const hsgAlmaViewitAfterModule = angular
56
.module('hsgAlmaViewitAfterModule', [])
67
.component('prmAlmaViewitAfter', {
78
bindings: { parentCtrl: '<' },
89
template: `
10+
<slsp-archives-viewit-component after-ctrl="$ctrl"></slsp-archives-viewit-component>
911
<hsg-report-broken-link-component after-ctrl="$ctrl"></hsg-report-broken-link-component>
1012
<hsg-off-campus-info-component after-ctrl="$ctrl"></hsg-off-campus-info-component>
1113
`
1214
});
1315

16+
hsgAlmaViewitAfterModule.requires.push(slspArchivesViewitModule.name);
1417
hsgAlmaViewitAfterModule.requires.push(hsgReportBrokenLinkModule.name);
15-
hsgAlmaViewitAfterModule.requires.push(hsgOffCampusInfoModule.name);
18+
hsgAlmaViewitAfterModule.requires.push(hsgOffCampusInfoModule.name);
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
export class slspArchivesViewitController {
2+
3+
constructor($translate) {
4+
this.$translate = $translate;
5+
this.parentCtrl = this.afterCtrl.parentCtrl;
6+
}
7+
8+
$onInit() {
9+
if (!this.parentCtrl.item.pnx.display.source || this.parentCtrl.item.pnx.display.source.length === 0) {
10+
return;
11+
}
12+
this.source = this.parentCtrl.item.pnx.display.source[0];
13+
// CMI STAR sources
14+
if (this.source === 'ETH_Hochschularchiv') {
15+
if (this.parentCtrl.item.delivery.GetIt1 && this.parentCtrl.item.delivery.GetIt1.length > 0 && this.parentCtrl.item.delivery.GetIt1[0].links && this.parentCtrl.item.delivery.GetIt1[0].links.length > 0) {
16+
17+
// there is an online resource: return and do nothing
18+
let aOnlineLink = this.parentCtrl.item.delivery.GetIt1[0].links.filter(l => {
19+
if (l.isLinktoOnline && l.link !== '') {
20+
return true;
21+
}
22+
return false;
23+
});
24+
if (aOnlineLink.length > 0) {
25+
return;
26+
}
27+
28+
// there is no online resource
29+
// change section heading
30+
this.$translate('nui.getit.service_howtogetit').then((translation) => {
31+
let fullView = document.getElementById('fullView');
32+
angular.element(fullView.querySelector("h4[translate='nui.getit.service_viewit']")).text(translation);
33+
angular.element(fullView.querySelector("#services-index span[translate='nui.getit.service_viewit']")).text(translation);
34+
});
35+
36+
}
37+
// hide content of viewit section
38+
let section = document.getElementById('full-view-container');
39+
section.classList.add('slsp-archives-hide');
40+
41+
// get guid of CMIStar
42+
let sourceid = this.parentCtrl.item.pnx.control.originalsourceid[0];
43+
let guid = sourceid.substring(sourceid.lastIndexOf(':') + 1);
44+
45+
// different sources: concat url
46+
if (this.source === 'ETH_Hochschularchiv') {
47+
this.url = 'http://archivdatenbank-online.ethz.ch/hsa/#/content/' + guid;
48+
// only for test
49+
//this.label = 'Bestellen über Hochschularchiv Online';
50+
}
51+
}
52+
}
53+
}
54+
55+
slspArchivesViewitController.$inject = ['$translate'];

0 commit comments

Comments
 (0)