@skatteetaten/ds-overlays 2.9.0 → 2.10.0
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/RolePicker/RolePickerBusinessList/RolePickerBusinessList.esm.js +4 -0
- package/RolePicker/RolePickerPeopleList/RolePickerPeopleList.esm.js +2 -0
- package/RolePicker/RolePickerRow/RolePickerRow.esm.js +7 -2
- package/RolePicker/analyticsIds.esm.js +11 -0
- package/RolePicker/index.esm.js +5 -0
- package/package.json +11 -11
- package/src/RolePicker/RolePickerRow/RolePickerRow.d.ts +1 -1
- package/src/RolePicker/RolePickerRow/RolePickerRow.types.d.ts +2 -0
- package/src/RolePicker/analyticsIds.d.ts +10 -0
- package/src/WordInfo/WordInfoContent/WordInfoContent.types.d.ts +2 -2
|
@@ -7,6 +7,7 @@ import { Checkbox } from '@skatteetaten/ds-forms';
|
|
|
7
7
|
import { BriefcaseOffSVGpath, BriefcaseMultipleSVGpath, BriefcaseSVGpath } from '@skatteetaten/ds-icons';
|
|
8
8
|
import { Heading } from '@skatteetaten/ds-typography';
|
|
9
9
|
import { getBusinessTitle } from './utils.esm.js';
|
|
10
|
+
import { rolePickerAnalyticsIds } from '../analyticsIds.esm.js';
|
|
10
11
|
import { RolePickerContext } from '../RolePickerContext.esm.js';
|
|
11
12
|
import { RolePickerRow } from '../RolePickerRow/RolePickerRow.esm.js';
|
|
12
13
|
import styles from './RolePickerBusinessList.module.scss.esm.js';
|
|
@@ -140,6 +141,7 @@ const RolePickerBusinessList = ({ businesses, filterQuery, showInactiveBusinesse
|
|
|
140
141
|
]
|
|
141
142
|
}),
|
|
142
143
|
svgPath: item.isDeleted ? BriefcaseOffSVGpath : BriefcaseMultipleSVGpath,
|
|
144
|
+
webAnalyticsId: item.isDeleted ? rolePickerAnalyticsIds.discontinuedBusiness : rolePickerAnalyticsIds.business,
|
|
143
145
|
onClick: ()=>{
|
|
144
146
|
handleEntityClicked(item);
|
|
145
147
|
}
|
|
@@ -169,6 +171,7 @@ const RolePickerBusinessList = ({ businesses, filterQuery, showInactiveBusinesse
|
|
|
169
171
|
]
|
|
170
172
|
}),
|
|
171
173
|
svgPath: sub.isDeleted ? BriefcaseOffSVGpath : BriefcaseSVGpath,
|
|
174
|
+
webAnalyticsId: rolePickerAnalyticsIds.businessSubunit,
|
|
172
175
|
onClick: ()=>{
|
|
173
176
|
handleEntityClicked(sub);
|
|
174
177
|
}
|
|
@@ -186,6 +189,7 @@ const RolePickerBusinessList = ({ businesses, filterQuery, showInactiveBusinesse
|
|
|
186
189
|
title: getBusinessTitle(item),
|
|
187
190
|
description: `${t('rolepicker.BusinessDescriptionPrefix')} ${formatOrganisationNumber(item.organizationNumber)}`,
|
|
188
191
|
svgPath: item.isDeleted ? BriefcaseOffSVGpath : svgPath,
|
|
192
|
+
webAnalyticsId: item.isDeleted ? rolePickerAnalyticsIds.discontinuedBusiness : rolePickerAnalyticsIds.business,
|
|
189
193
|
onClick: ()=>{
|
|
190
194
|
handleEntityClicked(item);
|
|
191
195
|
}
|
|
@@ -6,6 +6,7 @@ import { dsI18n } from '@skatteetaten/ds-core-utils';
|
|
|
6
6
|
import { Checkbox } from '@skatteetaten/ds-forms';
|
|
7
7
|
import { PersonSVGpath } from '@skatteetaten/ds-icons';
|
|
8
8
|
import { Heading } from '@skatteetaten/ds-typography';
|
|
9
|
+
import { rolePickerAnalyticsIds } from '../analyticsIds.esm.js';
|
|
9
10
|
import { RolePickerContext } from '../RolePickerContext.esm.js';
|
|
10
11
|
import { RolePickerRow } from '../RolePickerRow/RolePickerRow.esm.js';
|
|
11
12
|
import { getDateOfBirthAsLocaleString, getPersonDescription } from '../utils.esm.js';
|
|
@@ -86,6 +87,7 @@ const RolePickerPeopleList = ({ people, filterQuery, showDeceasedPeople: showDec
|
|
|
86
87
|
title: `${item.name}${item.isDeleted ? ` (${t('rolepicker.Deceased')})` : ''}`,
|
|
87
88
|
description: getPersonDescription(item),
|
|
88
89
|
svgPath: PersonSVGpath,
|
|
90
|
+
webAnalyticsId: item.isDeleted ? rolePickerAnalyticsIds.deceasedPerson : rolePickerAnalyticsIds.person,
|
|
89
91
|
onClick: ()=>handleEntityClicked(item)
|
|
90
92
|
})
|
|
91
93
|
}, item.personId);
|
|
@@ -6,7 +6,7 @@ import { RolePickerContext } from '../RolePickerContext.esm.js';
|
|
|
6
6
|
import styles from './RolePickerRow.module.scss.esm.js';
|
|
7
7
|
|
|
8
8
|
import './RolePickerRow.css';
|
|
9
|
-
function RolePickerRow({ id, title, description, svgPath, titleAs, onClick }) {
|
|
9
|
+
function RolePickerRow({ id, title, description, svgPath, titleAs, webAnalyticsId, onClick }) {
|
|
10
10
|
const ctx = useContext(RolePickerContext);
|
|
11
11
|
const ref = useRef(null);
|
|
12
12
|
const hasError = ctx?.error?.entityId === id;
|
|
@@ -17,7 +17,12 @@ function RolePickerRow({ id, title, description, svgPath, titleAs, onClick }) {
|
|
|
17
17
|
return jsxs("div", {
|
|
18
18
|
children: [
|
|
19
19
|
jsx(NavigationTile, {
|
|
20
|
-
ref:
|
|
20
|
+
ref: (node)=>{
|
|
21
|
+
ref.current = node;
|
|
22
|
+
if (node && webAnalyticsId) {
|
|
23
|
+
node?.setAttribute('data-webanalytics-id', webAnalyticsId);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
21
26
|
href: '#',
|
|
22
27
|
className: `${hasError ? styles.withAlert : ''}`,
|
|
23
28
|
titleAs: titleAs ?? 'h3',
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const rolePickerAnalyticsIds = {
|
|
2
|
+
me: 'rolepicker.me',
|
|
3
|
+
person: 'rolepicker.person',
|
|
4
|
+
deceasedPerson: 'rolepicker.person.deceased',
|
|
5
|
+
business: 'rolepicker.business',
|
|
6
|
+
businessSubunit: 'rolepicker.business.subunit',
|
|
7
|
+
discontinuedBusiness: 'rolepicker.business.discontinued',
|
|
8
|
+
logout: 'rolepicker.logout'
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { rolePickerAnalyticsIds };
|
package/RolePicker/index.esm.js
CHANGED
|
@@ -5,6 +5,7 @@ import { Button } from '@skatteetaten/ds-buttons';
|
|
|
5
5
|
import { dsI18n, getCommonClassNameDefault } from '@skatteetaten/ds-core-utils';
|
|
6
6
|
import { FavoriteSVGpath, LogOutSVGpath } from '@skatteetaten/ds-icons';
|
|
7
7
|
import { Paragraph } from '@skatteetaten/ds-typography';
|
|
8
|
+
import { rolePickerAnalyticsIds } from './analyticsIds.esm.js';
|
|
8
9
|
import { getRolePickerHideCloseButtonDefault, getRolePickerMinimumEntitiesForSearchDefault, getRolePickerShowInactiveBusinessesDefault, getRolePickerShowSubunitsDefault, getRolePickerShowDeceasedPeopleDefault } from './defaults.esm.js';
|
|
9
10
|
import { getModalDismissOnEscDefault, getModalDismissOnOutsideClickDefault } from '../Modal/defaults.esm.js';
|
|
10
11
|
import { Modal } from '../Modal/index.esm.js';
|
|
@@ -130,6 +131,7 @@ import './RolePicker.css';
|
|
|
130
131
|
description: getPersonDescription(me),
|
|
131
132
|
svgPath: FavoriteSVGpath,
|
|
132
133
|
titleAs: 'h2',
|
|
134
|
+
webAnalyticsId: rolePickerAnalyticsIds.me,
|
|
133
135
|
onClick: ()=>handleEntitySelect(me)
|
|
134
136
|
}) : null,
|
|
135
137
|
getRepresentationText(),
|
|
@@ -173,6 +175,9 @@ import './RolePicker.css';
|
|
|
173
175
|
}) : jsxs(Fragment, {
|
|
174
176
|
children: [
|
|
175
177
|
jsx(Button, {
|
|
178
|
+
ref: (node)=>{
|
|
179
|
+
node?.setAttribute('data-webanalytics-id', rolePickerAnalyticsIds.logout);
|
|
180
|
+
},
|
|
176
181
|
variant: 'secondary',
|
|
177
182
|
svgPath: LogOutSVGpath,
|
|
178
183
|
onClick: onLogout,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skatteetaten/ds-overlays",
|
|
3
3
|
"groupId": "no.skatteetaten.aurora",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.10.0",
|
|
5
5
|
"main": "./index.esm.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"module": "./index.esm.js",
|
|
@@ -16,18 +16,18 @@
|
|
|
16
16
|
"i18next": "^24 || ^25",
|
|
17
17
|
"react": "^19.2.0",
|
|
18
18
|
"react-i18next": "^15",
|
|
19
|
-
"@skatteetaten/ds-core-utils": "2.
|
|
20
|
-
"@skatteetaten/ds-buttons": "2.
|
|
21
|
-
"@skatteetaten/ds-forms": "2.
|
|
22
|
-
"@skatteetaten/ds-icons": "2.
|
|
23
|
-
"@skatteetaten/ds-navigation": "2.
|
|
24
|
-
"@skatteetaten/ds-typography": "2.
|
|
25
|
-
"@skatteetaten/ds-progress": "2.
|
|
26
|
-
"@skatteetaten/ds-status": "2.
|
|
19
|
+
"@skatteetaten/ds-core-utils": "2.10.0",
|
|
20
|
+
"@skatteetaten/ds-buttons": "2.10.0",
|
|
21
|
+
"@skatteetaten/ds-forms": "2.10.0",
|
|
22
|
+
"@skatteetaten/ds-icons": "2.10.0",
|
|
23
|
+
"@skatteetaten/ds-navigation": "2.10.0",
|
|
24
|
+
"@skatteetaten/ds-typography": "2.10.0",
|
|
25
|
+
"@skatteetaten/ds-progress": "2.10.0",
|
|
26
|
+
"@skatteetaten/ds-status": "2.10.0",
|
|
27
27
|
"date-fns": "^4",
|
|
28
|
-
"@skatteetaten/ds-content": "2.
|
|
28
|
+
"@skatteetaten/ds-content": "2.10.0",
|
|
29
29
|
"@floating-ui/react": "0.26.28",
|
|
30
|
-
"@skatteetaten/ds-collections": "2.
|
|
30
|
+
"@skatteetaten/ds-collections": "2.10.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {},
|
|
33
33
|
"scripts": {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { RolePickerRowProps } from './RolePickerRow.types';
|
|
3
|
-
export declare function RolePickerRow({ id, title, description, svgPath, titleAs, onClick, }: RolePickerRowProps): JSX.Element;
|
|
3
|
+
export declare function RolePickerRow({ id, title, description, svgPath, titleAs, webAnalyticsId, onClick, }: RolePickerRowProps): JSX.Element;
|
|
4
4
|
export declare namespace RolePickerRow {
|
|
5
5
|
var displayName: string;
|
|
6
6
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { NavigationTileProps } from '@skatteetaten/ds-navigation';
|
|
2
|
+
import { RolePickerAnalyticsId } from '../analyticsIds';
|
|
2
3
|
export interface RolePickerRowProps extends Pick<NavigationTileProps, 'title' | 'description' | 'svgPath' | 'titleAs' | 'onClick'> {
|
|
3
4
|
id: string;
|
|
5
|
+
webAnalyticsId?: RolePickerAnalyticsId;
|
|
4
6
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const rolePickerAnalyticsIds: {
|
|
2
|
+
readonly me: "rolepicker.me";
|
|
3
|
+
readonly person: "rolepicker.person";
|
|
4
|
+
readonly deceasedPerson: "rolepicker.person.deceased";
|
|
5
|
+
readonly business: "rolepicker.business";
|
|
6
|
+
readonly businessSubunit: "rolepicker.business.subunit";
|
|
7
|
+
readonly discontinuedBusiness: "rolepicker.business.discontinued";
|
|
8
|
+
readonly logout: "rolepicker.logout";
|
|
9
|
+
};
|
|
10
|
+
export type RolePickerAnalyticsId = (typeof rolePickerAnalyticsIds)[keyof typeof rolePickerAnalyticsIds];
|
|
@@ -4,8 +4,8 @@ export interface WordInfoContentProps extends BaseProps {
|
|
|
4
4
|
ref?: Ref<HTMLDivElement>;
|
|
5
5
|
/**
|
|
6
6
|
* Innhold i popup-boksen. Må være string eller et HTML-element som er tillatt
|
|
7
|
-
* i en span. Finn ut hvilke elementer som er tillatt i en
|
|
8
|
-
*
|
|
7
|
+
* i en span. Finn ut hvilke [elementer som er tillatt i en
|
|
8
|
+
* span](https://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Content_categories#phrasing_content).
|
|
9
9
|
*/
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
}
|