@aarhus-university/au-lib-react-components 11.4.0 → 11.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +34 -34
- package/.storybook/main.js +20 -20
- package/.storybook/preview.js +17 -17
- package/README.md +19 -19
- package/__tests__/jest/AUButtonComponent.test.tsx +165 -165
- package/__tests__/jest/AUErrorComponent.test.tsx +142 -142
- package/__tests__/jest/AUModalComponent.test.tsx +186 -186
- package/__tests__/jest/AUNotificationComponent.test.tsx +115 -115
- package/__tests__/jest/AUSpinnerComponent.test.tsx +57 -57
- package/__tests__/jest/AUToolbarComponent.test.tsx +46 -46
- package/__tests__/jest/context.test.ts +25 -25
- package/__tests__/jest/helpers.test.ts +15 -15
- package/__tests__/jest/setupTests.ts +2 -2
- package/babel.config.js +8 -8
- package/build/umd/all.css +2 -2
- package/build/umd/all.js +1 -1
- package/build/umd/alphabox.js +1 -1
- package/build/umd/databox.js +1 -1
- package/build/umd/diagramme.js +1 -1
- package/build/umd/flowbox.js +1 -1
- package/build/umd/universe.js +1 -1
- package/build-storybook.log +367 -367
- package/package.json +114 -114
- package/src/components/AUAlertComponent.tsx +70 -70
- package/src/components/AUAutoSuggestComponent.js +158 -158
- package/src/components/AUButtonComponent.tsx +84 -84
- package/src/components/AUCalendarComponent.tsx +493 -493
- package/src/components/AUContentToggleComponent.tsx +47 -47
- package/src/components/AUDatepickerComponent.tsx +121 -121
- package/src/components/AUErrorComponent.tsx +78 -78
- package/src/components/AUMobilePrefixComponent.tsx +15 -15
- package/src/components/AUModalComponent.tsx +68 -68
- package/src/components/AUNotificationComponent.tsx +43 -43
- package/src/components/AUReceiptComponent.tsx +33 -33
- package/src/components/AUSpinnerComponent.tsx +36 -36
- package/src/components/AUStepComponent.tsx +47 -47
- package/src/components/AUSubNavComponent.tsx +48 -48
- package/src/components/AUSubmitButtonContainerComponent.tsx +29 -29
- package/src/components/AUTabbedContentComponent.tsx +145 -145
- package/src/components/AUTableComponent.tsx +24 -24
- package/src/components/AUToastComponent.tsx +104 -104
- package/src/components/AUToolbarComponent.tsx +101 -101
- package/src/components/AUTruncatorComponent.tsx +124 -124
- package/src/components/wrapping/AUEmbedComponent.js +47 -47
- package/src/layout-2016/components/alphabox/AlphaBoxComponent.js +143 -143
- package/src/layout-2016/components/alphabox/AlphaBoxContentComponent.js +136 -136
- package/src/layout-2016/components/common/AUCollapsibleComponent.js +152 -152
- package/src/layout-2016/components/common/AUSpinnerComponent.js +103 -103
- package/src/layout-2016/components/databox/DataBoxAlphabetComponent.js +144 -144
- package/src/layout-2016/components/databox/DataBoxAssociationComponent.js +122 -122
- package/src/layout-2016/components/databox/DataBoxButtonComponent.js +157 -157
- package/src/layout-2016/components/databox/DataBoxComponent.js +297 -297
- package/src/layout-2016/components/databox/DataBoxGroupingComponent.js +64 -64
- package/src/layout-2016/components/databox/DataBoxSearchResultComponent.js +36 -36
- package/src/layout-2016/components/databox/DataBoxStackedAssociationComponent.js +54 -54
- package/src/layout-2016/components/databox/DataBoxSuggestionComponent.js +39 -39
- package/src/layout-2016/components/diagramme/AUDiagrammeComponent.js +309 -309
- package/src/layout-2016/components/flowbox/FlowBoxComponent.js +126 -126
- package/src/layout-2016/components/flowbox/FlowBoxPhoneComponent.js +104 -104
- package/src/layout-2016/components/profile/AUProfileAvatar2016Component.js +103 -103
- package/src/layout-2016/components/universe/StaffTopComponent.js +363 -363
- package/src/layout-2016/components/universe/StudentTopComponent.js +137 -137
- package/src/layout-2016/components/universe/UniverseContainerComponent.js +65 -65
- package/src/layout-2016/lib/all.js +3 -3
- package/src/layout-2016/lib/au-alphabox.js +100 -100
- package/src/layout-2016/lib/au-databox.js +400 -400
- package/src/layout-2016/lib/au-diagramme.js +85 -85
- package/src/layout-2016/lib/au-flowbox.js +93 -93
- package/src/layout-2016/lib/universe.js +9 -9
- package/src/lib/context.tsx +51 -51
- package/src/lib/dates.ts +50 -50
- package/src/lib/helpers.ts +208 -208
- package/src/lib/hooks.ts +75 -75
- package/src/lib/i18n.ts +600 -600
- package/src/lib/portals.tsx +119 -119
- package/src/lib/tracking.ts +69 -69
- package/src/lib/wrapping.ts +21 -21
- package/src/styles/_settings.scss +10 -10
- package/src/styles/alphabox.scss +222 -222
- package/src/styles/app.scss +7 -7
- package/src/styles/autosuggest.scss +57 -57
- package/src/styles/databox.scss +563 -563
- package/src/styles/diagramme.scss +119 -119
- package/src/styles/flowbox.scss +72 -72
- package/src/styles/maps.scss +395 -395
- package/stories/AUButtonComponent.stories.tsx +127 -127
- package/stories/AUContentToggleComponent.stories.tsx +63 -63
- package/stories/AUErrorComponent.stories.tsx +98 -98
- package/stories/AUModalComponent.stories.tsx +83 -83
- package/stories/AUNotificationComponent.stories.tsx +116 -116
- package/stories/AUSpinnerComponent.stories.tsx +41 -41
- package/stories/AUStepComponent.stories.tsx +40 -40
- package/stories/AUToolbarComponent.stories.tsx +326 -326
- package/stories/AUTruncatorComponent.stories.tsx +101 -101
- package/stories/lib/helpers.tsx +128 -128
- package/tsconfig.json +46 -46
- package/webpack.config.js +89 -89
package/src/lib/portals.tsx
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
/* eslint-disable import/prefer-default-export */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { replace } from './helpers';
|
|
4
|
-
|
|
5
|
-
const impersonationLabels = {
|
|
6
|
-
IMPERSONATION_SELECT_OPTION_CPR: { da: 'CPR-nr.', en: 'CPR no.' },
|
|
7
|
-
IMPERSONATION_SELECT_OPTION_EMAIL: { da: 'E-mail', en: 'Email' },
|
|
8
|
-
IMPERSONATION_SELECT_OPTION_AUID: { da: 'AU-id', en: 'AU ID' },
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface Window {
|
|
13
|
-
IMPERSONATE_AUID: string;
|
|
14
|
-
IMPERSONATE_VALUE: string;
|
|
15
|
-
IMPERSONATE_TYPE: string;
|
|
16
|
-
PHASE: number;
|
|
17
|
-
REAL_PHASE: number;
|
|
18
|
-
authenticated: boolean;
|
|
19
|
-
userContext: AU.IUserContext;
|
|
20
|
-
impersonateError: boolean;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const portals: (lang: string) => AU.IPortalContext[] = (lang: string) => [
|
|
25
|
-
{
|
|
26
|
-
name: 'mitstudie',
|
|
27
|
-
impersonationSetup: {
|
|
28
|
-
auid: window.IMPERSONATE_AUID,
|
|
29
|
-
value: window.IMPERSONATE_VALUE,
|
|
30
|
-
type: window.IMPERSONATE_TYPE,
|
|
31
|
-
},
|
|
32
|
-
impersonationOptions: [
|
|
33
|
-
{
|
|
34
|
-
value: 'auid',
|
|
35
|
-
label: impersonationLabels.IMPERSONATION_SELECT_OPTION_AUID[lang],
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
deactivateFormContent: (
|
|
39
|
-
activatedText: string,
|
|
40
|
-
replaceText: string[],
|
|
41
|
-
replaceWith: string[],
|
|
42
|
-
portal: AU.IPortalContext,
|
|
43
|
-
) => (
|
|
44
|
-
<>
|
|
45
|
-
<div
|
|
46
|
-
className="content-container vertical-spacing-bottom typography-dense"
|
|
47
|
-
dangerouslySetInnerHTML={
|
|
48
|
-
// eslint-disable-next-line max-len
|
|
49
|
-
{ __html: replace(activatedText, replaceText, replaceWith) }
|
|
50
|
-
}
|
|
51
|
-
/>
|
|
52
|
-
<input type="hidden" name="type" value={portal.impersonationSetup.type} />
|
|
53
|
-
<input type="hidden" name="value" value={portal.impersonationSetup.value} />
|
|
54
|
-
</>
|
|
55
|
-
),
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'minansoegning',
|
|
59
|
-
impersonationSetup: {
|
|
60
|
-
auid: window.IMPERSONATE_AUID,
|
|
61
|
-
value: window.IMPERSONATE_VALUE,
|
|
62
|
-
type: window.IMPERSONATE_TYPE,
|
|
63
|
-
phase: window.PHASE,
|
|
64
|
-
realPhase: window.REAL_PHASE,
|
|
65
|
-
},
|
|
66
|
-
impersonationOptions: [
|
|
67
|
-
{
|
|
68
|
-
value: 'auid',
|
|
69
|
-
label: impersonationLabels.IMPERSONATION_SELECT_OPTION_AUID[lang],
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
value: 'cpr',
|
|
73
|
-
label: impersonationLabels.IMPERSONATION_SELECT_OPTION_CPR[lang],
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
value: 'email',
|
|
77
|
-
label: impersonationLabels.IMPERSONATION_SELECT_OPTION_EMAIL[lang],
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
deactivateFormContent: (
|
|
81
|
-
activatedText: string,
|
|
82
|
-
replaceText: string[],
|
|
83
|
-
replaceWith: string[],
|
|
84
|
-
portal: AU.IPortalContext,
|
|
85
|
-
) => (
|
|
86
|
-
<>
|
|
87
|
-
<div
|
|
88
|
-
className="content-container vertical-spacing-bottom typography-dense"
|
|
89
|
-
dangerouslySetInnerHTML={
|
|
90
|
-
// eslint-disable-next-line max-len
|
|
91
|
-
{ __html: replace(activatedText, replaceText, replaceWith) }
|
|
92
|
-
}
|
|
93
|
-
/>
|
|
94
|
-
<input type="hidden" name="type" value={portal.impersonationSetup.type} />
|
|
95
|
-
<input type="hidden" name="value" value={portal.impersonationSetup.value} />
|
|
96
|
-
<input type="hidden" name="phase" value={portal.impersonationSetup.phase} />
|
|
97
|
-
</>
|
|
98
|
-
),
|
|
99
|
-
},
|
|
100
|
-
];
|
|
101
|
-
|
|
102
|
-
export const getPortalByName = (
|
|
103
|
-
lang: string,
|
|
104
|
-
name: string,
|
|
105
|
-
): AU.IPortalContext | null => portals(lang).find((portal) => portal.name === name) ?? null;
|
|
106
|
-
|
|
107
|
-
export const impersonationPortalElement = document.querySelector('.page__pre-header');
|
|
108
|
-
|
|
109
|
-
export const isImpersonating = (): boolean => {
|
|
110
|
-
if (window.userContext == null) {
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
if (window.userContext.impersonatedUser == null) {
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
return true;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export const impersonationHasErrored = (): boolean => window.impersonateError;
|
|
1
|
+
/* eslint-disable import/prefer-default-export */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { replace } from './helpers';
|
|
4
|
+
|
|
5
|
+
const impersonationLabels = {
|
|
6
|
+
IMPERSONATION_SELECT_OPTION_CPR: { da: 'CPR-nr.', en: 'CPR no.' },
|
|
7
|
+
IMPERSONATION_SELECT_OPTION_EMAIL: { da: 'E-mail', en: 'Email' },
|
|
8
|
+
IMPERSONATION_SELECT_OPTION_AUID: { da: 'AU-id', en: 'AU ID' },
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
declare global {
|
|
12
|
+
interface Window {
|
|
13
|
+
IMPERSONATE_AUID: string;
|
|
14
|
+
IMPERSONATE_VALUE: string;
|
|
15
|
+
IMPERSONATE_TYPE: string;
|
|
16
|
+
PHASE: number;
|
|
17
|
+
REAL_PHASE: number;
|
|
18
|
+
authenticated: boolean;
|
|
19
|
+
userContext: AU.IUserContext;
|
|
20
|
+
impersonateError: boolean;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const portals: (lang: string) => AU.IPortalContext[] = (lang: string) => [
|
|
25
|
+
{
|
|
26
|
+
name: 'mitstudie',
|
|
27
|
+
impersonationSetup: {
|
|
28
|
+
auid: window.IMPERSONATE_AUID,
|
|
29
|
+
value: window.IMPERSONATE_VALUE,
|
|
30
|
+
type: window.IMPERSONATE_TYPE,
|
|
31
|
+
},
|
|
32
|
+
impersonationOptions: [
|
|
33
|
+
{
|
|
34
|
+
value: 'auid',
|
|
35
|
+
label: impersonationLabels.IMPERSONATION_SELECT_OPTION_AUID[lang],
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
deactivateFormContent: (
|
|
39
|
+
activatedText: string,
|
|
40
|
+
replaceText: string[],
|
|
41
|
+
replaceWith: string[],
|
|
42
|
+
portal: AU.IPortalContext,
|
|
43
|
+
) => (
|
|
44
|
+
<>
|
|
45
|
+
<div
|
|
46
|
+
className="content-container vertical-spacing-bottom typography-dense"
|
|
47
|
+
dangerouslySetInnerHTML={
|
|
48
|
+
// eslint-disable-next-line max-len
|
|
49
|
+
{ __html: replace(activatedText, replaceText, replaceWith) }
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
<input type="hidden" name="type" value={portal.impersonationSetup.type} />
|
|
53
|
+
<input type="hidden" name="value" value={portal.impersonationSetup.value} />
|
|
54
|
+
</>
|
|
55
|
+
),
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'minansoegning',
|
|
59
|
+
impersonationSetup: {
|
|
60
|
+
auid: window.IMPERSONATE_AUID,
|
|
61
|
+
value: window.IMPERSONATE_VALUE,
|
|
62
|
+
type: window.IMPERSONATE_TYPE,
|
|
63
|
+
phase: window.PHASE,
|
|
64
|
+
realPhase: window.REAL_PHASE,
|
|
65
|
+
},
|
|
66
|
+
impersonationOptions: [
|
|
67
|
+
{
|
|
68
|
+
value: 'auid',
|
|
69
|
+
label: impersonationLabels.IMPERSONATION_SELECT_OPTION_AUID[lang],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
value: 'cpr',
|
|
73
|
+
label: impersonationLabels.IMPERSONATION_SELECT_OPTION_CPR[lang],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
value: 'email',
|
|
77
|
+
label: impersonationLabels.IMPERSONATION_SELECT_OPTION_EMAIL[lang],
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
deactivateFormContent: (
|
|
81
|
+
activatedText: string,
|
|
82
|
+
replaceText: string[],
|
|
83
|
+
replaceWith: string[],
|
|
84
|
+
portal: AU.IPortalContext,
|
|
85
|
+
) => (
|
|
86
|
+
<>
|
|
87
|
+
<div
|
|
88
|
+
className="content-container vertical-spacing-bottom typography-dense"
|
|
89
|
+
dangerouslySetInnerHTML={
|
|
90
|
+
// eslint-disable-next-line max-len
|
|
91
|
+
{ __html: replace(activatedText, replaceText, replaceWith) }
|
|
92
|
+
}
|
|
93
|
+
/>
|
|
94
|
+
<input type="hidden" name="type" value={portal.impersonationSetup.type} />
|
|
95
|
+
<input type="hidden" name="value" value={portal.impersonationSetup.value} />
|
|
96
|
+
<input type="hidden" name="phase" value={portal.impersonationSetup.phase} />
|
|
97
|
+
</>
|
|
98
|
+
),
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
export const getPortalByName = (
|
|
103
|
+
lang: string,
|
|
104
|
+
name: string,
|
|
105
|
+
): AU.IPortalContext | null => portals(lang).find((portal) => portal.name === name) ?? null;
|
|
106
|
+
|
|
107
|
+
export const impersonationPortalElement = document.querySelector('.page__pre-header');
|
|
108
|
+
|
|
109
|
+
export const isImpersonating = (): boolean => {
|
|
110
|
+
if (window.userContext == null) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (window.userContext.impersonatedUser == null) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
return true;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export const impersonationHasErrored = (): boolean => window.impersonateError;
|
package/src/lib/tracking.ts
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
/* eslint-disable func-names */
|
|
2
|
-
/* eslint-env browser */
|
|
3
|
-
/* eslint-disable no-sequences */
|
|
4
|
-
/* eslint-disable prefer-destructuring */
|
|
5
|
-
/* eslint-disable no-param-reassign */
|
|
6
|
-
/* eslint-disable prefer-rest-params */
|
|
7
|
-
/* eslint-disable no-unused-expressions */
|
|
8
|
-
/* eslint-disable dot-notation */
|
|
9
|
-
/* eslint-disable wrap-iife */
|
|
10
|
-
/*
|
|
11
|
-
* Title: TRACKING
|
|
12
|
-
* Description: Google Analytics tracking
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
class AUTracking {
|
|
16
|
-
trackers: ITrackers[] = [
|
|
17
|
-
{
|
|
18
|
-
account: 'UA-2142081-1',
|
|
19
|
-
name: 'default',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
account: 'UA-113308028-1',
|
|
23
|
-
name: 'search',
|
|
24
|
-
},
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
constructor(trackers = []) {
|
|
28
|
-
trackers.forEach((tracker) => this.trackers.push(tracker));
|
|
29
|
-
this.init();
|
|
30
|
-
|
|
31
|
-
this.trackSingle = this.trackSingle.bind(this);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
init() {
|
|
35
|
-
const gaNewElem: any = {};
|
|
36
|
-
const gaElems: any = {};
|
|
37
|
-
const currdate: any = new Date();
|
|
38
|
-
|
|
39
|
-
((i, s, o, g, r, a, m): void => {
|
|
40
|
-
i['GoogleAnalyticsObject'] = r;
|
|
41
|
-
i[r] = i[r] || function () {
|
|
42
|
-
(i[r].q = i[r].q || []).push(arguments);
|
|
43
|
-
}, i[r].l = 1 * currdate;
|
|
44
|
-
a = s.createElement(o),
|
|
45
|
-
m = s.getElementsByTagName(o)[0];
|
|
46
|
-
a.async = 1;
|
|
47
|
-
a.src = g;
|
|
48
|
-
m.parentNode.insertBefore(a, m);
|
|
49
|
-
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga', gaNewElem, gaElems);
|
|
50
|
-
|
|
51
|
-
this.trackers.forEach((tracker) => {
|
|
52
|
-
window.ga('create', tracker.account, 'auto', tracker.name);
|
|
53
|
-
window.ga(`${tracker.name}.require`, 'displayfeatures');
|
|
54
|
-
window.ga(`${tracker.name}.require`, 'linkid', 'linkid.js');
|
|
55
|
-
window.ga(`${tracker.name}.require`, 'GTM-MGFPHKR');
|
|
56
|
-
window.ga(`${tracker.name}.set`, 'anonymizeIp', true);
|
|
57
|
-
|
|
58
|
-
window.ga(`${tracker.name}.send`, 'pageview');
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
trackSingle(trackerLink: string): void {
|
|
63
|
-
if (typeof window.ga !== 'undefined') {
|
|
64
|
-
this.trackers.forEach((tracker) => window.ga(`${tracker.name}.send`, 'pageview', trackerLink));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export default AUTracking;
|
|
1
|
+
/* eslint-disable func-names */
|
|
2
|
+
/* eslint-env browser */
|
|
3
|
+
/* eslint-disable no-sequences */
|
|
4
|
+
/* eslint-disable prefer-destructuring */
|
|
5
|
+
/* eslint-disable no-param-reassign */
|
|
6
|
+
/* eslint-disable prefer-rest-params */
|
|
7
|
+
/* eslint-disable no-unused-expressions */
|
|
8
|
+
/* eslint-disable dot-notation */
|
|
9
|
+
/* eslint-disable wrap-iife */
|
|
10
|
+
/*
|
|
11
|
+
* Title: TRACKING
|
|
12
|
+
* Description: Google Analytics tracking
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
class AUTracking {
|
|
16
|
+
trackers: ITrackers[] = [
|
|
17
|
+
{
|
|
18
|
+
account: 'UA-2142081-1',
|
|
19
|
+
name: 'default',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
account: 'UA-113308028-1',
|
|
23
|
+
name: 'search',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
constructor(trackers = []) {
|
|
28
|
+
trackers.forEach((tracker) => this.trackers.push(tracker));
|
|
29
|
+
this.init();
|
|
30
|
+
|
|
31
|
+
this.trackSingle = this.trackSingle.bind(this);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
init() {
|
|
35
|
+
const gaNewElem: any = {};
|
|
36
|
+
const gaElems: any = {};
|
|
37
|
+
const currdate: any = new Date();
|
|
38
|
+
|
|
39
|
+
((i, s, o, g, r, a, m): void => {
|
|
40
|
+
i['GoogleAnalyticsObject'] = r;
|
|
41
|
+
i[r] = i[r] || function () {
|
|
42
|
+
(i[r].q = i[r].q || []).push(arguments);
|
|
43
|
+
}, i[r].l = 1 * currdate;
|
|
44
|
+
a = s.createElement(o),
|
|
45
|
+
m = s.getElementsByTagName(o)[0];
|
|
46
|
+
a.async = 1;
|
|
47
|
+
a.src = g;
|
|
48
|
+
m.parentNode.insertBefore(a, m);
|
|
49
|
+
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga', gaNewElem, gaElems);
|
|
50
|
+
|
|
51
|
+
this.trackers.forEach((tracker) => {
|
|
52
|
+
window.ga('create', tracker.account, 'auto', tracker.name);
|
|
53
|
+
window.ga(`${tracker.name}.require`, 'displayfeatures');
|
|
54
|
+
window.ga(`${tracker.name}.require`, 'linkid', 'linkid.js');
|
|
55
|
+
window.ga(`${tracker.name}.require`, 'GTM-MGFPHKR');
|
|
56
|
+
window.ga(`${tracker.name}.set`, 'anonymizeIp', true);
|
|
57
|
+
|
|
58
|
+
window.ga(`${tracker.name}.send`, 'pageview');
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
trackSingle(trackerLink: string): void {
|
|
63
|
+
if (typeof window.ga !== 'undefined') {
|
|
64
|
+
this.trackers.forEach((tracker) => window.ga(`${tracker.name}.send`, 'pageview', trackerLink));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export default AUTracking;
|
package/src/lib/wrapping.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/* eslint-env browser */
|
|
2
|
-
const getSourceForFrame = (
|
|
3
|
-
serviceUrl: string,
|
|
4
|
-
path: string,
|
|
5
|
-
referrer: string,
|
|
6
|
-
callback: (data: any) => void,
|
|
7
|
-
) => {
|
|
8
|
-
const getSource = async (): Promise<void> => {
|
|
9
|
-
const url = `${serviceUrl}?path=${path}&referrer=${referrer}`;
|
|
10
|
-
const response = await fetch(url, {
|
|
11
|
-
credentials: 'include',
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const json = await response.json();
|
|
15
|
-
callback(json);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
getSource();
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default getSourceForFrame;
|
|
1
|
+
/* eslint-env browser */
|
|
2
|
+
const getSourceForFrame = (
|
|
3
|
+
serviceUrl: string,
|
|
4
|
+
path: string,
|
|
5
|
+
referrer: string,
|
|
6
|
+
callback: (data: any) => void,
|
|
7
|
+
) => {
|
|
8
|
+
const getSource = async (): Promise<void> => {
|
|
9
|
+
const url = `${serviceUrl}?path=${path}&referrer=${referrer}`;
|
|
10
|
+
const response = await fetch(url, {
|
|
11
|
+
credentials: 'include',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const json = await response.json();
|
|
15
|
+
callback(json);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
getSource();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default getSourceForFrame;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
$font-passata-regular: "AUPassataRegular";
|
|
2
|
-
$font-passata-bold: "AUPassataBold";
|
|
3
|
-
$gray-color:#e4e4e4;
|
|
4
|
-
$gray-secondary-color:darken($gray-color, 50%);
|
|
5
|
-
$alert-confirm-color: #8bad3f;
|
|
6
|
-
$alert-cancel-color: #687989;
|
|
7
|
-
$student-color:#8bad3f;
|
|
8
|
-
$student-secondary-color:#2a4a0f;
|
|
9
|
-
$staff-color: #379fcb;
|
|
10
|
-
$staff-secondary-color:#003e5c;
|
|
1
|
+
$font-passata-regular: "AUPassataRegular";
|
|
2
|
+
$font-passata-bold: "AUPassataBold";
|
|
3
|
+
$gray-color:#e4e4e4;
|
|
4
|
+
$gray-secondary-color:darken($gray-color, 50%);
|
|
5
|
+
$alert-confirm-color: #8bad3f;
|
|
6
|
+
$alert-cancel-color: #687989;
|
|
7
|
+
$student-color:#8bad3f;
|
|
8
|
+
$student-secondary-color:#2a4a0f;
|
|
9
|
+
$staff-color: #379fcb;
|
|
10
|
+
$staff-secondary-color:#003e5c;
|
|
11
11
|
$findicon: 'https://cdn.au.dk/2016/assets/img/databox/find.png';
|