Skip to content

Commit 51c6512

Browse files
authored
Merge pull request #41 from HSG-Library/develop
Release 2024.07.19 Sprint 6/24
2 parents 04ff8c3 + 905bdaf commit 51c6512

File tree

10 files changed

+70
-44
lines changed

10 files changed

+70
-44
lines changed

css/00-central-package.css

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,11 @@ md-card.cardbox.default-card.quicklinksbox._md.md-primoExplore-theme>md-card-con
11501150
}
11511151
*/
11521152

1153+
/* Fix color inversion for links after click */
1154+
.quicklinks .md-button.md-focused:not([disabled]),
1155+
.quicklinks .md-button:focus:not([disabled]) {
1156+
background: none !important;
1157+
}
11531158
/*230 Footer*/
11541159

11551160

@@ -1353,12 +1358,12 @@ div[data-facet-value="institution-5501"] {
13531358

13541359
/*Hide the "Open Knowledge Maps" link fully (facet group and okm link)*/
13551360
.okm-full {
1356-
display: block;
1361+
display: none;
13571362
}
13581363

13591364
/*Hide the "Open Knowledge Maps" link in the facet group*/
13601365
eth-okm-link-component {
1361-
display: block;
1366+
display: none;
13621367
}
13631368

13641369
/*320 Top Bar*/
@@ -4023,6 +4028,15 @@ prm-resource-type-filter-bar button.selectedResourceTypeOption prm-icon {
40234028

40244029
/*****************************************************************************/
40254030

4031+
/*Display "Open Knowledge Maps" link fully (facet group and okm link)*/
4032+
.okm-full {
4033+
display: block;
4034+
}
4035+
4036+
/*Display the "Open Knowledge Maps" link in the facet group*/
4037+
eth-okm-link-component {
4038+
display: block;
4039+
}
40264040

40274041
/*****************************************************************************/
40284042

@@ -4042,4 +4056,4 @@ prm-resource-type-filter-bar button.selectedResourceTypeOption prm-icon {
40424056
/*****************************************************************************/
40434057

40444058

4045-
/*****************************************************************************/
4059+
/*****************************************************************************/

css/hsg-search-in-journal.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*******************************/
2+
/****** Search in journal ******/
3+
/*******************************/
4+
5+
prm-search-within-journal .classic-input {
6+
min-width: 280px;
7+
width: 50%;
8+
max-width: 437px;
9+
}

js/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ app.requires.push(slspHttpInterceptRequestsModule.name)
9595

9696
app.run(function () { console.log('** app running **') })
9797

98+
app.config(['$sceDelegateProvider', function($sceDelegateProvider) {
99+
$sceDelegateProvider.resourceUrlWhitelist([
100+
'self',
101+
'https://api.seeip.org/**'
102+
]);
103+
}]);
104+
98105
window.isSandbox = function () {
99106
const sandboxView = "41SLSP_HSG:sandbox_jfu"
100107
const params = new URLSearchParams(window.location.search)

js/modules/prm-advanced-search-after/slsp-advanced-search-clear-button/slsp-advanced-search-clear-button.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class slspAdvancedSearchClearButtonController {
1010
$onInit() {
1111
this.$timeout(() => {
1212
this.afterCtrl = this.afterCtrl.parentCtrl
13-
this.afterCtrl.limit = 1
13+
this.afterCtrl.limit = 2
1414

1515
let incrementButton = angular.element(document.querySelector(`button[ng-click="$ctrl.incrementLimit()"`))
1616
let decrementButtonHtml = `

js/modules/prm-alma-viewit-after/hsg-off-campus-info/hsg-off-campus-info.controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ export class hsgOffCampusInfoController {
1111
$onInit() {
1212
this.processDoCheck = false
1313
this.deliveryCategory = []
14-
if (this.afterCtrl.parentCtrl.item.pnx.addata.openaccess && this.afterCtrl.parentCtrl.itm.pnx.addata.openaccess[0] === 'true') {
14+
this.onCampusService.getIpAndCheck()
15+
if (this.afterCtrl.parentCtrl.item.pnx.addata.openaccess && this.afterCtrl.parentCtrl.item.pnx.addata.openaccess[0] === 'true') {
1516
return
1617
}
1718
let delivery = this.afterCtrl.parentCtrl.item.delivery
1819
if (delivery && delivery.deliveryCategory && (delivery.deliveryCategory.indexOf('Alma-E') > -1 || delivery.deliveryCategory.indexOf('Remote Search Resource') > -1)) {
1920
this.deliveryCategory = delivery.deliveryCategory
20-
this.onCampusService.getIpAndCheck()
2121
this.processDoCheck = true
2222
}
2323
}

js/modules/prm-login-after/slsp-login-box/slsp-login-box.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class slspLoginBoxController {
1212
this.$timeout(() => {
1313
this.parentCtrl = this.afterCtrl.parentCtrl
1414

15-
let buttonHelp = '<a ng-href="https://help.switch.ch/eduid/faqs/?lang={{ $ctrl.getLanguage() }}" target="_blank" class="parallelLoginDescription"><span translate="parallel.login.description1"></span><svg width="100%" height="100%" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path></svg></a>'
15+
let buttonHelp = '<a ng-href="https://eduid.ch/help/?lang={{ $ctrl.getLanguage() }}"" target="_blank" class="parallelLoginDescription"><span translate="parallel.login.description1"></span><svg width="100%" height="100%" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path></svg></a>'
1616

1717
let infoLabel = '<p class="parallelLoginDescription" translate="parallel.login.description2"></p>'
1818

js/modules/prm-personal-info-after/slsp-edit-personal-details/slsp-edit-personal-details.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export class slspEditPersonalDetailsController {
22

33
constructor(hsgTranslatorService) {
44
let lang = hsgTranslatorService.getLang()
5-
this.detailsBaseEdu = "https:\/\/eduid.ch\/web\/change-account-data\/2\/?lang=" + lang
5+
this.detailsBaseEdu = "https:\/\/eduid.ch\/account\/profile\?lang=" + lang
66
this.detailsBaseReg = "https:\/\/registration.slsp.ch\/library-card\/?lang=" + lang
77
this.exclude = ['STAFF', '11', '12', '13', '14', '15', '16', '91', '92', '99']
88
this.grpA = ['11', '91', '92']
Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
export class slspUnionLoginBoxController {
22

3-
constructor($scope, $compile, $timeout) {
4-
this.$scope = $scope
5-
this.$compile = $compile
6-
this.$timeout = $timeout
3+
constructor($scope, $compile, $timeout, $rootScope, $window) {
4+
this.$scope = $scope;
5+
this.$compile = $compile;
6+
this.$timeout = $timeout;
7+
this.$rootScope = $rootScope;
8+
this.$window = $window;
79
}
810

911
$onInit() {
10-
this.parentCtrl = this.afterCtrl.parentCtrl
12+
this.parentCtrl = this.afterCtrl.parentCtrl;
1113
}
12-
1314
cancelUnionLogin() {
14-
this.parentCtrl.cancelLogin()
15+
this.parentCtrl.cancelLogin();
16+
}
17+
getLanguage() {
18+
let sms = this.$rootScope.$$childHead.$ctrl.userSessionManagerService;
19+
if (!sms) {
20+
return 'en';
21+
} else {
22+
return sms.getUserLanguage() || $window.appConfig['primo-view']['attributes-map'].interfaceLanguage;
23+
}
1524
}
1625
}
1726

18-
slspUnionLoginBoxController.$inject = ['$scope', '$compile', '$timeout']
27+
slspUnionLoginBoxController.$inject = ['$scope', '$compile', '$timeout', '$rootScope', '$window'];
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
<div class="union-loginbox-register">
2-
<a ng-href="https://registration.slsp.ch" target="_blank">
2+
<a ng-href="https://registration.slsp.ch/?lang={{ $ctrl.getLanguage() }}" target="_blank">
33
<span translate="nui.fulldisplay.otherLocations.register"></span>
44
<svg width="100%" height="100%" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fit=""
5-
preserveAspectRatio="xMidYMid meet" focusable="false">
5+
preserveAspectRatio="xMidYMid meet" focusable="false">
66
<path
7-
d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z">
7+
d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z">
88
</path>
99
</svg>
10-
1110
</a>
1211
</div>
1312

1413
<button class="md-button md-icon-button cancel-union-login" type="button" ng-click="$ctrl.cancelUnionLogin()">
15-
<svg width="100%" height="100%" viewBox="0 0 24 24" y="240" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false">
16-
<path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path>
14+
<svg width="100%" height="100%" viewBox="0 0 24 24" y="240" xmlns="http://www.w3.org/2000/svg" fit=""
15+
preserveAspectRatio="xMidYMid meet" focusable="false">
16+
<path
17+
d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z">
18+
</path>
1719
</svg>
1820
</button>

js/services/hsg-on-campus.service.js

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,21 @@
1-
export const hsgOnCampusService = ['$http', function ($http) {
1+
export const hsgOnCampusService = ['$http',function ($http) {
22

33
this.onCampus = false
44
this.checkDone = false
55

6-
this.getIpAndCheck = function (fallbackUrl = '') {
6+
this.getIpAndCheck = function () {
77
this.checkDone = false
88
this.onCampus = false
9-
this.stopRetrying = false
10-
if (fallbackUrl) {
11-
this.url = fallbackUrl
12-
} else {
13-
this.url = 'https://ipv4.icanhazip.com'
14-
}
15-
console.log('Calling IP address service', this.url)
16-
$http({
17-
method: 'GET',
18-
url: this.url,
19-
headers: { 'Accept': 'text/plain' }
20-
}).then(
9+
this.url = 'https://api.seeip.org/jsonip'
10+
$http.jsonp(this.url)
11+
.then(
2112
response => {
22-
this.stopRetrying = false
23-
const ip = response.data
13+
const ip = response.data.ip
2414
console.log('current ip', ip)
2515
this.checkOnCampus(ip)
2616
},
2717
response => {
28-
console.log('checking ip failed. stopRetrying: ', this.stopRetrying, response)
29-
if (!this.stopRetrying) {
30-
console.log('previous check failed, switch to fallback service and retry')
31-
this.stopRetrying = true
32-
this.getIpAndCheck('https://api.ipify.org')
33-
}
18+
console.log('checking ip failed.', response)
3419
})
3520
}
3621

0 commit comments

Comments
 (0)