@equinor/amplify-component-lib 9.16.1-beta.0 → 9.17.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.
Files changed (135) hide show
  1. package/dist/atoms/hooks/useFaqsInApplication.js +1 -1
  2. package/dist/atoms/hooks/useLocalStorage.d.ts +2 -2
  3. package/dist/atoms/hooks/usePrefetchRichTextImages.js +1 -1
  4. package/dist/atoms/hooks/useRichTextImage.js +1 -1
  5. package/dist/atoms/hooks/useSearchParameter.d.ts +12 -0
  6. package/dist/atoms/hooks/useSearchParameter.js +1 -0
  7. package/dist/atoms/hooks/useSelect.d.ts +3 -3
  8. package/dist/atoms/hooks/useSelect.js +1 -1
  9. package/dist/atoms/index.d.ts +1 -0
  10. package/dist/atoms/index.js +1 -1
  11. package/dist/atoms/utils/auth_environment.js +1 -1
  12. package/dist/atoms/utils/date.js +1 -1
  13. package/dist/atoms/utils/map.js +1 -1
  14. package/dist/atoms/utils/size.js +1 -1
  15. package/dist/atoms/utils/url.js +1 -1
  16. package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
  17. package/dist/deprecated/IconToggleButton.d.ts +2 -2
  18. package/dist/deprecated/IconToggleButton.js +1 -1
  19. package/dist/deprecated/OldStepper/OldStepLine.js +1 -1
  20. package/dist/index.d.ts +5 -1
  21. package/dist/index.js +1 -1
  22. package/dist/molecules/ApplicationIcon/ApplicationIconBase.js +1 -1
  23. package/dist/molecules/Badge/Badge.styles.js +1 -1
  24. package/dist/molecules/Button/Button.js +1 -1
  25. package/dist/molecules/Chip/Chip.d.ts +2 -2
  26. package/dist/molecules/Chip/Chip.styles.js +1 -1
  27. package/dist/molecules/ContentMenu/ContentMenu.js +1 -1
  28. package/dist/molecules/DatePicker/DatePicker.d.ts +3 -3
  29. package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
  30. package/dist/molecules/Dialog/Dialog.d.ts +2 -2
  31. package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
  32. package/dist/molecules/FileProgress/CompactFileProgress.js +1 -1
  33. package/dist/molecules/FileProgress/FileProgress.utils.js +1 -1
  34. package/dist/molecules/FileProgress/RegularFileProgress.js +1 -1
  35. package/dist/molecules/IconCell/IconCell.d.ts +2 -2
  36. package/dist/molecules/IconCell/IconCell.utils.js +1 -1
  37. package/dist/molecules/InfoElement/CopyText.js +1 -1
  38. package/dist/molecules/ListItem/ListItem.d.ts +2 -2
  39. package/dist/molecules/OptionDrawer/OptionDrawer.d.ts +2 -2
  40. package/dist/molecules/OptionDrawer/OptionDrawer.utils.js +1 -1
  41. package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +4 -4
  42. package/dist/molecules/ProfileAvatar/ProfileAvatar.d.ts +2 -2
  43. package/dist/molecules/ProfileAvatar/ProfileAvatar.js +1 -1
  44. package/dist/molecules/RichTextEditor/MenuBar/AddImageButton.js +1 -1
  45. package/dist/molecules/RichTextEditor/MenuBar/MenuBar.d.ts +6 -6
  46. package/dist/molecules/RichTextEditor/MenuBar/Table/TableColumn.js +1 -1
  47. package/dist/molecules/RichTextEditor/MenuBar/Table/TableMerge.js +1 -1
  48. package/dist/molecules/RichTextEditor/MenuBar/Table/TableRow.js +1 -1
  49. package/dist/molecules/RichTextEditor/MenuBar/Table/ToggleTable.js +1 -1
  50. package/dist/molecules/RichTextEditor/MenuBar/TextColor.js +1 -1
  51. package/dist/molecules/RichTextEditor/custom-extensions/ExtendedImage.js +1 -1
  52. package/dist/molecules/RichTextEditor/index.d.ts +6 -6
  53. package/dist/molecules/Search/Search.d.ts +2 -2
  54. package/dist/molecules/Select/AddTagItem.js +1 -1
  55. package/dist/molecules/Select/ComboBox/ComboBox.d.ts +2 -2
  56. package/dist/molecules/Select/Select.styles.d.ts +5 -5
  57. package/dist/molecules/Select/SelectMenuItem.js +1 -1
  58. package/dist/molecules/Select/SingleSelect/SingleSelect.d.ts +2 -2
  59. package/dist/molecules/SelectionControls/Checkbox/Checkbox.d.ts +2 -2
  60. package/dist/molecules/Sieve/Filter.d.ts +10 -0
  61. package/dist/molecules/Sieve/Filter.js +1 -0
  62. package/dist/molecules/Sieve/Sieve.d.ts +7 -0
  63. package/dist/molecules/Sieve/Sieve.js +1 -0
  64. package/dist/molecules/Sieve/Sieve.styles.js +43 -0
  65. package/dist/molecules/Sieve/Sieve.types.d.ts +28 -0
  66. package/dist/molecules/Sieve/Sort.js +1 -0
  67. package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.d.ts +3 -3
  68. package/dist/molecules/Stepper/Step/Step.js +1 -1
  69. package/dist/molecules/Stepper/Stepper.js +1 -1
  70. package/dist/molecules/Waves/Waves.js +1 -1
  71. package/dist/molecules/index.d.ts +3 -0
  72. package/dist/molecules/index.js +1 -1
  73. package/dist/organisms/DataGrid/DataGrid.d.ts +2 -2
  74. package/dist/organisms/Faq/Category/Category.js +2 -2
  75. package/dist/organisms/Faq/Category/Question.js +1 -1
  76. package/dist/organisms/Faq/Faq.js +1 -1
  77. package/dist/organisms/Faq/Header.js +2 -2
  78. package/dist/organisms/FieldSelector/FieldSelector.js +1 -1
  79. package/dist/organisms/Filter/ButtonWithMenu.js +1 -1
  80. package/dist/organisms/Filter/Filter.d.ts +2 -2
  81. package/dist/organisms/Filter/QuickFilter.d.ts +2 -2
  82. package/dist/organisms/Filter/SortMenu.d.ts +2 -2
  83. package/dist/organisms/ReleaseNote/ReleaseNote.d.ts +3 -3
  84. package/dist/organisms/ReleaseNote/ReleaseNote.js +1 -1
  85. package/dist/organisms/ReleaseNote/ReleaseNote.utils.js +1 -1
  86. package/dist/organisms/SideBar/MenuItem/BasicMenuItem.js +1 -1
  87. package/dist/organisms/SideBar/MenuItem/CollapsableMenuItem.js +1 -1
  88. package/dist/organisms/SideBar/MenuItem/MenuItem.styles.js +1 -1
  89. package/dist/organisms/SideBar/MenuItem/MenuItem.utils.js +1 -1
  90. package/dist/organisms/SideBar/SideBar.d.ts +2 -2
  91. package/dist/organisms/Status/Action.d.ts +2 -2
  92. package/dist/organisms/Status/Description.d.ts +2 -2
  93. package/dist/organisms/Status/MissingAccesses.d.ts +2 -2
  94. package/dist/organisms/Status/Title.d.ts +2 -2
  95. package/dist/organisms/Status/collections/BadRequest.js +2 -2
  96. package/dist/organisms/Status/collections/GenericError.js +1 -1
  97. package/dist/organisms/Status/collections/MissingAccessToApp.js +1 -1
  98. package/dist/organisms/Status/collections/MissingPermissions.js +1 -1
  99. package/dist/organisms/Status/collections/PageNotFound.js +2 -2
  100. package/dist/organisms/Status/collections/ServerError.js +2 -2
  101. package/dist/organisms/TableOfContents/TableOfContents.styles.js +1 -1
  102. package/dist/organisms/Template/Template.d.ts +5 -5
  103. package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
  104. package/dist/organisms/ToggleGroup/ToggleGroup.js +10 -1
  105. package/dist/organisms/ToggleGroup/ToggleGroup.types.d.ts +1 -0
  106. package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
  107. package/dist/organisms/TopBar/Account/ImpersonateButton.js +1 -1
  108. package/dist/organisms/TopBar/Account/ImpersonateMenu/Actions.js +1 -1
  109. package/dist/organisms/TopBar/Account/ImpersonateMenu/CreateOrEditUser/CreateOrEditUser.js +1 -1
  110. package/dist/organisms/TopBar/Account/ImpersonateMenu/DeleteUser/DeleteUser.js +1 -1
  111. package/dist/organisms/TopBar/Account/ImpersonateMenu/ImpersonateMenu.js +1 -1
  112. package/dist/organisms/TopBar/Actions.d.ts +2 -2
  113. package/dist/organisms/TopBar/FieldMenu/FieldMenu.d.ts +2 -2
  114. package/dist/organisms/TopBar/Guidelines/Colorbox.d.ts +2 -2
  115. package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
  116. package/dist/organisms/TopBar/Resources/Feedback/Feedback.utils.js +2 -2
  117. package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/FeedbackForm.js +1 -1
  118. package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/Severity.js +1 -1
  119. package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/UploadFile/ImageFile.js +1 -1
  120. package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/UploadFile/UploadFile.js +1 -1
  121. package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/Url.js +1 -1
  122. package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/ResponsePage.js +1 -1
  123. package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/ResponseStatus.js +1 -1
  124. package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/Header/Header.js +1 -1
  125. package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotesDialog.js +1 -1
  126. package/dist/organisms/TopBar/TopBar.styles.js +1 -1
  127. package/dist/organisms/TopBar/Tutorials/TutorialItem.js +1 -1
  128. package/dist/providers/AuthProvider/AuthProviderInner.js +1 -1
  129. package/dist/providers/ReleaseNotesProvider.js +1 -1
  130. package/dist/providers/SideBarProvider.js +1 -1
  131. package/dist/providers/StepperProvider.js +1 -1
  132. package/dist/providers/TableOfContentsProvider.js +1 -1
  133. package/dist/providers/ThemeProvider/ThemeProvider.js +1 -1
  134. package/dist/providers/TutorialHighlightingProvider/TutorialHighlightingProviderInner.js +1 -1
  135. package/package.json +9 -5
@@ -1,6 +1,6 @@
1
1
  import { SelectOptionRequired } from "../../molecules/Select/Select.types.js";
2
2
  import { FilterProps } from "./Filter.types.js";
3
- import * as react_jsx_runtime5 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/organisms/Filter/QuickFilter.d.ts
6
6
  interface QuickFilterProps<T extends string> {
@@ -14,6 +14,6 @@ declare function QuickFilter<T extends string>({
14
14
  items,
15
15
  onQuickFilter,
16
16
  label
17
- }: QuickFilterProps<T>): react_jsx_runtime5.JSX.Element;
17
+ }: QuickFilterProps<T>): react_jsx_runtime6.JSX.Element;
18
18
  //#endregion
19
19
  export { QuickFilter };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime6 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Filter/SortMenu.d.ts
4
4
  interface SortMenuProps<S> {
@@ -13,6 +13,6 @@ declare function SortMenu<S>({
13
13
  value,
14
14
  onChange,
15
15
  items
16
- }: SortMenuProps<S>): react_jsx_runtime6.JSX.Element;
16
+ }: SortMenuProps<S>): react_jsx_runtime4.JSX.Element;
17
17
  //#endregion
18
18
  export { SortMenu };
@@ -1,4 +1,4 @@
1
- import * as react5 from "react";
1
+ import * as react102 from "react";
2
2
  import { ReactNode } from "react";
3
3
  import { ReleaseNote } from "@equinor/subsurface-app-management";
4
4
 
@@ -7,9 +7,9 @@ type ReleaseNoteProps = {
7
7
  actionMenu?: ReactNode;
8
8
  expanded?: boolean;
9
9
  } & ReleaseNote;
10
- declare const ReleaseNote$1: react5.ForwardRefExoticComponent<{
10
+ declare const ReleaseNote$1: react102.ForwardRefExoticComponent<{
11
11
  actionMenu?: ReactNode;
12
12
  expanded?: boolean;
13
- } & ReleaseNote & react5.RefAttributes<HTMLDivElement>>;
13
+ } & ReleaseNote & react102.RefAttributes<HTMLDivElement>>;
14
14
  //#endregion
15
15
  export { ReleaseNote$1 as ReleaseNote, ReleaseNoteProps };
@@ -24,4 +24,4 @@ import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from".
24
24
  display: flex;
25
25
  gap: ${t.medium};
26
26
  align-items: center;
27
- `,C=d(({applicationName:n,releaseDate:d,createdDate:h,tags:C,version:w,title:T,body:E,actionMenu:D,expanded:O=!1},k)=>{let A=o({releaseDate:d,createdDate:h}),j=f(O?`auto`:c),[M,N]=p(O),[P,F]=p(i(E).length>0),I=f(new ResizeObserver(e=>{e.at(0)&&e[0].target.scrollHeight>c&&F(!0)}));return _(b,{ref:k,style:{paddingBottom:M?t.medium:void 0},children:[_(x,{children:[_(S,{children:[g(m,{variant:`caption`,color:e.text.static_icons__secondary.rgba,children:n}),_(m,{variant:`overline`,color:e.text.static_icons__tertiary.rgba,children:[r(A),w?` ・ ${w}`:``,` ・ `,a(E)]})]}),g(u,{tags:C,children:D})]}),g(m,{variant:`h4`,children:T}),g(v.div,{ref:e=>{e&&I.current.observe(e)},initial:{height:j.current},animate:{height:M?`auto`:c},style:{overflow:M?`auto`:void 0},children:g(s,{value:E,onImageRead:y.getReleaseNoteImage,padding:`none`})}),P&&!O&&g(l,{expanded:M,onToggleExpanded:()=>{N(e=>!e)}})]})});C.displayName=`ReleaseNote`;export{C as ReleaseNote};
27
+ `,C=d(({applicationName:n,releaseDate:d,createdDate:h,tags:C,version:w,title:T,body:E,actionMenu:D,expanded:O=!1},k)=>{let A=o({releaseDate:d,createdDate:h}),j=f(O?`auto`:c),[M,N]=p(O),[P,F]=p(i(E).length>0),I=f(new ResizeObserver(e=>{e.at(0)&&e[0].target.scrollHeight>c&&F(!0)})),L=()=>{N(e=>!e)},R=e=>{e&&I.current.observe(e)};return _(b,{ref:k,style:{paddingBottom:M?t.medium:void 0},children:[_(x,{children:[_(S,{children:[g(m,{variant:`caption`,color:e.text.static_icons__secondary.rgba,children:n}),_(m,{variant:`overline`,color:e.text.static_icons__tertiary.rgba,children:[r(A),w?` ・ ${w}`:``,` ・ `,a(E)]})]}),g(u,{tags:C,children:D})]}),g(m,{variant:`h4`,children:T}),g(v.div,{ref:R,initial:{height:j.current},animate:{height:M?`auto`:c},style:{overflow:M?`auto`:void 0},children:g(s,{value:E,onImageRead:y.getReleaseNoteImage,padding:`none`})}),P&&!O&&g(l,{expanded:M,onToggleExpanded:L})]})});C.displayName=`ReleaseNote`;export{C as ReleaseNote};
@@ -1 +1 @@
1
- function e(e){let t=e.split(/\s/g).length;return`${Math.ceil(t/238)} min read`}function t(e){return e.releaseDate??e.createdDate}export{e as timeToRead,t as usingReleaseNoteDate};
1
+ function e(e){let t=e.split(/\s/g).length,n=Math.ceil(t/238);return`${n} min read`}function t(e){return e.releaseDate??e.createdDate}export{e as timeToRead,t as usingReleaseNoteDate};
@@ -1 +1 @@
1
- import{useSideBar as e}from"../../../providers/SideBarProvider.js";import{OptionalTooltip as t}from"../../../molecules/OptionalTooltip/OptionalTooltip.js";import{IconContainer as n,ItemText as r,Link as i,MenuItemWrapper as a}from"./MenuItem.styles.js";import{canNavigate as o,isCurrentUrl as s}from"./MenuItem.utils.js";import{useCallback as c,useMemo as l}from"react";import{Icon as u}from"@equinor/eds-core-react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useLocation as p}from"@tanstack/react-router";import{Feature as m}from"@equinor/subsurface-app-management";const h=({icon:h,link:g,onClick:_,replace:v=!1,name:y,disabled:b=!1,featureUuid:x,...S})=>{let{pathname:C}=p(),w=s({currentUrl:C,link:g}),{isOpen:T}=e(),E=o({currentUrl:C,link:g,replace:v,disabled:b}),D=c(e=>{if(!E){e.preventDefault();return}_&&_()},[E,_]),O=l(()=>d(t,{title:y,placement:`right`,children:d(a,{children:f(i,{to:g,$active:w,"aria-disabled":b,$disabled:b,onClick:D,tabIndex:0,$open:!0,"data-testid":`sidebar-menu-item`,replace:v,...S,children:[d(n,{"data-testid":`icon-container`,children:d(u,{data:h,size:24})}),T&&d(r,{$active:w,$disabled:b,variant:`button`,group:`navigation`,children:y})]})})}),[b,D,h,w,T,g,y,S,v]);return x?d(m,{featureUuid:x,children:O}):O};export{h as BasicMenuItem};
1
+ import{useSideBar as e}from"../../../providers/SideBarProvider.js";import{OptionalTooltip as t}from"../../../molecules/OptionalTooltip/OptionalTooltip.js";import{IconContainer as n,ItemText as r,Link as i,MenuItemWrapper as a}from"./MenuItem.styles.js";import{canNavigate as o,isCurrentUrl as s}from"./MenuItem.utils.js";import{useCallback as c,useMemo as l}from"react";import{Icon as u}from"@equinor/eds-core-react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{Feature as p}from"@equinor/subsurface-app-management";import{useLocation as m}from"react-router-dom";const h=({icon:h,link:g,onClick:_,replace:v=!1,name:y,disabled:b=!1,featureUuid:x,...S})=>{let{pathname:C}=m(),w=s({currentUrl:C,link:g}),{isOpen:T}=e(),E=o({currentUrl:C,link:g,replace:v,disabled:b}),D=c(e=>{if(!E){e.preventDefault();return}_&&_()},[E,_]),O=l(()=>d(t,{title:y,placement:`right`,children:d(a,{children:f(i,{to:g,$active:w,"aria-disabled":b,$disabled:b,onClick:D,tabIndex:0,$open:!0,"data-testid":`sidebar-menu-item`,replace:v,...S,children:[d(n,{"data-testid":`icon-container`,children:d(u,{data:h,size:24})}),T&&d(r,{$active:w,$disabled:b,variant:`button`,group:`navigation`,children:y})]})})}),[b,D,h,w,T,g,y,S,v]);return x?d(p,{featureUuid:x,children:O}):O};export{h as BasicMenuItem};
@@ -1,4 +1,4 @@
1
- import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{useSideBar as n}from"../../../providers/SideBarProvider.js";import{usePrevious as r}from"../../../atoms/hooks/usePrevious.js";import{OptionalTooltip as i}from"../../../molecules/OptionalTooltip/OptionalTooltip.js";import{IconContainer as a,ItemText as o,Link as s,MenuItemWrapper as c}from"./MenuItem.styles.js";import{isCurrentUrl as l}from"./MenuItem.utils.js";import{useEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{Icon as m,Menu as h}from"@equinor/eds-core-react";import g,{css as _}from"styled-components";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{chevron_down as x,chevron_up as S}from"@equinor/eds-icons";import{Link as C,useLocation as w}from"@tanstack/react-router";const T=g.button`
1
+ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{useSideBar as n}from"../../../providers/SideBarProvider.js";import{usePrevious as r}from"../../../atoms/hooks/usePrevious.js";import{OptionalTooltip as i}from"../../../molecules/OptionalTooltip/OptionalTooltip.js";import{IconContainer as a,ItemText as o,Link as s,MenuItemWrapper as c}from"./MenuItem.styles.js";import{isCurrentUrl as l}from"./MenuItem.utils.js";import{useEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{Icon as m,Menu as h}from"@equinor/eds-core-react";import g,{css as _}from"styled-components";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{chevron_down as x,chevron_up as S}from"@equinor/eds-icons";import{Link as C,useLocation as w}from"react-router-dom";const T=g.button`
2
2
  position: relative;
3
3
  width: 100%;
4
4
  display: grid;
@@ -1,4 +1,4 @@
1
- import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{Typography as n}from"@equinor/eds-core-react";import r from"styled-components";import{Link as i}from"@tanstack/react-router";const a=r.span`
1
+ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{Typography as n}from"@equinor/eds-core-react";import r from"styled-components";import{Link as i}from"react-router-dom";const a=r.span`
2
2
  width: 100%;
3
3
  `,o=r(i)`
4
4
  display: flex;
@@ -1 +1 @@
1
- const e=({currentUrl:e,link:t})=>e.includes(t)&&t!==`/`||t===e,t=({currentUrl:e,link:t})=>e.split(`?`)[0]===t,n=({currentUrl:n,link:r,disabled:i,replace:a})=>{let o=e({currentUrl:n,link:r}),s=t({currentUrl:n,link:r});return!i&&(!o||o&&!s&&a)};export{n as canNavigate,e as isCurrentUrl};
1
+ const e=({currentUrl:e,link:t})=>{let n=e.includes(t);return n&&t!==`/`||t===e},t=({currentUrl:e,link:t})=>{let n=e.split(`?`)[0];return n===t},n=({currentUrl:n,link:r,disabled:i,replace:a})=>{let o=e({currentUrl:n,link:r}),s=t({currentUrl:n,link:r});return!i&&(!o||o&&!s&&a)};export{n as canNavigate,e as isCurrentUrl};
@@ -1,4 +1,4 @@
1
- import * as react107 from "react";
1
+ import * as react128 from "react";
2
2
  import { HTMLAttributes, ReactNode } from "react";
3
3
 
4
4
  //#region src/organisms/SideBar/SideBar.d.ts
@@ -16,6 +16,6 @@ interface SideBarWithCreate extends SideBarProps {
16
16
  createDisabled?: boolean;
17
17
  createActive?: boolean;
18
18
  }
19
- declare const SideBar: react107.ForwardRefExoticComponent<(SideBarWithCreate | BaseSideBar) & react107.RefAttributes<HTMLDivElement>>;
19
+ declare const SideBar: react128.ForwardRefExoticComponent<(SideBarWithCreate | BaseSideBar) & react128.RefAttributes<HTMLDivElement>>;
20
20
  //#endregion
21
21
  export { SideBar };
@@ -1,10 +1,10 @@
1
- import * as react111 from "react";
1
+ import * as react134 from "react";
2
2
 
3
3
  //#region src/organisms/Status/Action.d.ts
4
4
  interface ActionProps {
5
5
  onClick: () => void;
6
6
  buttonText?: string;
7
7
  }
8
- declare const Action: react111.ForwardRefExoticComponent<ActionProps & react111.RefAttributes<HTMLButtonElement>>;
8
+ declare const Action: react134.ForwardRefExoticComponent<ActionProps & react134.RefAttributes<HTMLButtonElement>>;
9
9
  //#endregion
10
10
  export { Action };
@@ -1,9 +1,9 @@
1
- import * as react113 from "react";
1
+ import * as react136 from "react";
2
2
 
3
3
  //#region src/organisms/Status/Description.d.ts
4
4
  interface DescriptionProps {
5
5
  text?: string;
6
6
  }
7
- declare const Description: react113.ForwardRefExoticComponent<DescriptionProps & react113.RefAttributes<HTMLHeadingElement>>;
7
+ declare const Description: react136.ForwardRefExoticComponent<DescriptionProps & react136.RefAttributes<HTMLHeadingElement>>;
8
8
  //#endregion
9
9
  export { Description };
@@ -1,4 +1,4 @@
1
- import * as react115 from "react";
1
+ import * as react138 from "react";
2
2
 
3
3
  //#region src/organisms/Status/MissingAccesses.d.ts
4
4
  interface AccessType {
@@ -9,6 +9,6 @@ interface MissingAccessesProps {
9
9
  accesses?: AccessType[];
10
10
  text?: string;
11
11
  }
12
- declare const MissingAccesses: react115.ForwardRefExoticComponent<MissingAccessesProps & react115.RefAttributes<HTMLDivElement>>;
12
+ declare const MissingAccesses: react138.ForwardRefExoticComponent<MissingAccessesProps & react138.RefAttributes<HTMLDivElement>>;
13
13
  //#endregion
14
14
  export { MissingAccesses };
@@ -1,9 +1,9 @@
1
- import * as react103 from "react";
1
+ import * as react130 from "react";
2
2
 
3
3
  //#region src/organisms/Status/Title.d.ts
4
4
  interface TitleProps {
5
5
  title?: string;
6
6
  }
7
- declare const Title: react103.ForwardRefExoticComponent<TitleProps & react103.RefAttributes<HTMLHeadingElement>>;
7
+ declare const Title: react130.ForwardRefExoticComponent<TitleProps & react130.RefAttributes<HTMLHeadingElement>>;
8
8
  //#endregion
9
9
  export { Title };
@@ -1,3 +1,3 @@
1
- import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useRouter as r}from"@tanstack/react-router";const i=()=>{let{history:i}=r();return n(e,{color:`#AB9067`,children:[t(e.Title,{title:`Bad request`}),t(e.Description,{text:`We encountered some confusion regarding your request.
1
+ import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useNavigate as r}from"react-router";const i=()=>{let i=r(),a=()=>{i(-1)};return n(e,{color:`#AB9067`,children:[t(e.Title,{title:`Bad request`}),t(e.Description,{text:`We encountered some confusion regarding your request.
2
2
  Please try again later, or if the issue persists, kindly report
3
- it using the feedback form located in the top bar.`}),t(e.Action,{onClick:()=>{i.go(-1)}})]})};export{i as BadRequest};
3
+ it using the feedback form located in the top bar.`}),t(e.Action,{onClick:a})]})};export{i as BadRequest};
@@ -1 +1 @@
1
- import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useRouter as r}from"@tanstack/react-router";const i=()=>{let{history:i}=r();return n(e,{children:[t(e.Title,{}),t(e.Description,{}),t(e.Action,{onClick:()=>{i.go(-1)}})]})};export{i as GenericError};
1
+ import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useNavigate as r}from"react-router";const i=()=>{let i=r(),a=()=>{i(-1)};return n(e,{children:[t(e.Title,{}),t(e.Description,{}),t(e.Action,{onClick:a})]})};export{i as GenericError};
@@ -1 +1 @@
1
- import{environment as e}from"../../../atoms/utils/auth_environment.js";import{Status as t}from"../index.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=()=>{let i=e.getAppName(import.meta.env.VITE_NAME);return r(t,{children:[n(t.Title,{title:`You don't have access to ${i}`}),n(t.Description,{text:`You can apply for acces to the app in AccessIT`}),n(t.Action,{onClick:()=>{window.open(`https://accessit.equinor.com/Search/Search?term=${encodeURIComponent(i)}`,`_blank`)},buttonText:`Apply for access`})]})};export{i as MissingAccessToApp};
1
+ import{environment as e}from"../../../atoms/utils/auth_environment.js";import{Status as t}from"../index.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=()=>{let i=e.getAppName(import.meta.env.VITE_NAME),a=()=>{window.open(`https://accessit.equinor.com/Search/Search?term=${encodeURIComponent(i)}`,`_blank`)};return r(t,{children:[n(t.Title,{title:`You don't have access to ${i}`}),n(t.Description,{text:`You can apply for acces to the app in AccessIT`}),n(t.Action,{onClick:a,buttonText:`Apply for access`})]})};export{i as MissingAccessToApp};
@@ -1 +1 @@
1
- import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useRouter as r}from"@tanstack/react-router";const i=()=>{let{history:i}=r();return n(e,{children:[t(e.Title,{title:`It looks like you don't have permission to access this page.`}),t(e.Action,{onClick:()=>{i.go(-1)}})]})};export{i as MissingPermissions};
1
+ import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useNavigate as r}from"react-router";const i=()=>{let i=r(),a=()=>{i(-1)};return n(e,{children:[t(e.Title,{title:`It looks like you don't have permission to access this page.`}),t(e.Action,{onClick:a})]})};export{i as MissingPermissions};
@@ -1,2 +1,2 @@
1
- import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useRouter as r}from"@tanstack/react-router";const i=()=>{let{history:i}=r();return n(e,{center:!1,children:[t(e.Title,{title:`Page not found`}),t(e.Description,{text:`It looks like the page you're looking for has gone missing.
2
- Please check the URL and try again.`}),t(e.Action,{onClick:()=>{i.go(-1)}})]})};export{i as PageNotFound};
1
+ import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useNavigate as r}from"react-router";const i=()=>{let i=r(),a=()=>{i(-1)};return n(e,{center:!1,children:[t(e.Title,{title:`Page not found`}),t(e.Description,{text:`It looks like the page you're looking for has gone missing.
2
+ Please check the URL and try again.`}),t(e.Action,{onClick:a})]})};export{i as PageNotFound};
@@ -1,3 +1,3 @@
1
- import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useRouter as r}from"@tanstack/react-router";const i=()=>{let{history:i}=r();return n(e,{color:`#C47E84`,children:[t(e.Title,{title:`Something is wrong on our servers`}),t(e.Description,{text:`Our server encountered an unexpected issue. Please try
1
+ import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useNavigate as r}from"react-router";const i=()=>{let i=r(),a=()=>{i(-1)};return n(e,{color:`#C47E84`,children:[t(e.Title,{title:`Something is wrong on our servers`}),t(e.Description,{text:`Our server encountered an unexpected issue. Please try
2
2
  again shortly, or reach out via the feedback form if the problem
3
- continues.`}),t(e.Action,{onClick:()=>{i.go(-1)}})]})};export{i as ServerError};
3
+ continues.`}),t(e.Action,{onClick:a})]})};export{i as ServerError};
@@ -1,4 +1,4 @@
1
- import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{animation as t}from"../../atoms/style/animation.js";import{spacings as n}from"../../atoms/style/spacings.js";import{HEIGHT as r}from"./TableOfContents.constants.js";import i,{css as a}from"styled-components";import{motion as o}from"framer-motion";import{Link as s}from"@tanstack/react-router";const{colors:c,shape:l}=e,u=i.button`
1
+ import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{animation as t}from"../../atoms/style/animation.js";import{spacings as n}from"../../atoms/style/spacings.js";import{HEIGHT as r}from"./TableOfContents.constants.js";import i,{css as a}from"styled-components";import{motion as o}from"framer-motion";import{Link as s}from"react-router-dom";const{colors:c,shape:l}=e,u=i.button`
2
2
  &:hover {
3
3
  background: ${c.interactive.primary__hover_alt.rgba};
4
4
  }
@@ -1,14 +1,14 @@
1
- import * as react7 from "react";
2
- import * as styled_components0 from "styled-components";
1
+ import * as react99 from "react";
2
+ import * as styled_components11 from "styled-components";
3
3
  import { IStyledComponent } from "styled-components";
4
- import * as styled_components_dist_types0 from "styled-components/dist/types";
4
+ import * as styled_components_dist_types39 from "styled-components/dist/types";
5
5
 
6
6
  //#region src/organisms/Template/Template.d.ts
7
7
  interface ContentProps {
8
8
  $open: boolean;
9
9
  }
10
- declare const Content: styled_components_dist_types0.IStyledComponentBase<"web", styled_components_dist_types0.Substitute<react7.DetailedHTMLProps<react7.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContentProps>> & string;
11
- declare const GlobalStyles: react7.NamedExoticComponent<styled_components0.ExecutionProps & object>;
10
+ declare const Content: styled_components_dist_types39.IStyledComponentBase<"web", styled_components_dist_types39.Substitute<react99.DetailedHTMLProps<react99.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContentProps>> & string;
11
+ declare const GlobalStyles: react99.NamedExoticComponent<styled_components11.ExecutionProps & object>;
12
12
  type TemplateType = IStyledComponent<'web', any> & {
13
13
  Container: IStyledComponent<'web', any>;
14
14
  Content: typeof Content;
@@ -1,7 +1,7 @@
1
1
  import { ToggleGroup } from "./ToggleGroup.types.js";
2
- import * as react119 from "react";
2
+ import * as react140 from "react";
3
3
 
4
4
  //#region src/organisms/ToggleGroup/ToggleGroup.d.ts
5
- declare const ToggleGroup$1: react119.ForwardRefExoticComponent<ToggleGroup & react119.RefAttributes<HTMLDivElement>>;
5
+ declare const ToggleGroup$1: react140.ForwardRefExoticComponent<ToggleGroup & react140.RefAttributes<HTMLDivElement>>;
6
6
  //#endregion
7
7
  export { ToggleGroup$1 as ToggleGroup };
@@ -26,4 +26,13 @@ import{colors as e}from"../../atoms/style/colors.js";import{shape as t}from"../.
26
26
  ${({$matchParentHeight:e})=>e?o`
27
27
  height: 100%;
28
28
  `:``}
29
- `,l=i(({variant:e=`filled`,matchParentHeight:t=!1,children:i},a)=>s(c,{ref:a,$variant:e,$matchParentHeight:t,children:r.map(i,e=>{if(e.type!=n)throw`Expected child to be ToggleGroupOption!`;return e})}));l.displayName=`ToggleGroup`;export{l as ToggleGroup};
29
+
30
+ ${({$gridTemplateColumns:e})=>e?o`
31
+ display: grid;
32
+ grid-template-columns: ${e};
33
+
34
+ > button {
35
+ justify-content: center;
36
+ }
37
+ `:``}
38
+ `,l=i(({variant:e=`filled`,matchParentHeight:t=!1,matchParentWidth:i=!1,children:a},o)=>s(c,{ref:o,$variant:e,$matchParentHeight:t,$gridTemplateColumns:i?`repeat(${a.length}, minmax(0, 1fr))`:void 0,children:r.map(a,e=>{if(e.type!=n)throw`Expected child to be ToggleGroupOption!`;return e})}));l.displayName=`ToggleGroup`;export{l as ToggleGroup};
@@ -20,6 +20,7 @@ type ToggleGroupOption = {
20
20
  interface ToggleGroup {
21
21
  variant?: 'filled' | 'outlined' | 'ghost';
22
22
  matchParentHeight?: boolean;
23
+ matchParentWidth?: boolean;
23
24
  children: ReactElement<ToggleGroupOption>[];
24
25
  }
25
26
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { ToggleGroupOption } from "./ToggleGroup.types.js";
2
- import * as react121 from "react";
2
+ import * as react132 from "react";
3
3
  import { HTMLAttributes } from "react";
4
4
 
5
5
  //#region src/organisms/ToggleGroup/ToggleGroupOption.d.ts
6
6
  type ToggleGroupOptionProps = ToggleGroupOption & Omit<HTMLAttributes<HTMLButtonElement>, 'onToggle' | 'disabled'>;
7
- declare const ToggleGroupOption$1: react121.ForwardRefExoticComponent<ToggleGroupOptionProps & react121.RefAttributes<HTMLButtonElement>>;
7
+ declare const ToggleGroupOption$1: react132.ForwardRefExoticComponent<ToggleGroupOptionProps & react132.RefAttributes<HTMLButtonElement>>;
8
8
  //#endregion
9
9
  export { ToggleGroupOption$1 as ToggleGroupOption };
@@ -5,4 +5,4 @@ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}fro
5
5
  svg {
6
6
  fill: ${e.interactive.danger__resting.rgba};
7
7
  }
8
- `,g=({onOpenImpersonateMenu:e,onClose:t})=>{let{data:a}=n(),{mutateAsync:l,isPending:g}=r();return a&&g?u(h,{variant:`outlined`,color:`danger`,children:u(o,{})}):a?d(h,{variant:`outlined`,color:`danger`,onClick:async()=>{await l(),t()},children:[u(s,{data:m}),`End impersonation`]}):d(i,{onClick:e,children:[u(s,{data:p}),u(c,{variant:`button`,group:`navigation`,as:`span`,children:`Impersonate`}),u(s,{data:f})]})};export{g as ImpersonateButton};
8
+ `,g=({onOpenImpersonateMenu:e,onClose:t})=>{let{data:a}=n(),{mutateAsync:l,isPending:g}=r(),_=async()=>{await l(),t()};return a&&g?u(h,{variant:`outlined`,color:`danger`,children:u(o,{})}):a?d(h,{variant:`outlined`,color:`danger`,onClick:_,children:[u(s,{data:m}),`End impersonation`]}):d(i,{onClick:e,children:[u(s,{data:p}),u(c,{variant:`button`,group:`navigation`,as:`span`,children:`Impersonate`}),u(s,{data:f})]})};export{g as ImpersonateButton};
@@ -8,4 +8,4 @@ import{spacings as e}from"../../../../atoms/style/spacings.js";import{useActiveI
8
8
  display: flex;
9
9
  justify-content: flex-end;
10
10
  gap: ${e.small};
11
- `,d=({selectedUniqueName:e,onCancel:o})=>{let{data:d}=t(),{mutateAsync:f,isPending:p}=n();return c(l,{children:[s(a,{variant:`body_short`,children:`By selecting a user to impersonate, you will view the contents of this app as if you would be that user.`}),c(u,{children:[s(r,{variant:`outlined`,onClick:o,children:`Cancel`}),p?s(r,{children:s(i,{})}):s(r,{onClick:async()=>{await f(e),o()},disabled:e===``||e===d?.uniqueName,children:`Impersonate`})]})]})};export{d as Actions};
11
+ `,d=({selectedUniqueName:e,onCancel:o})=>{let{data:d}=t(),{mutateAsync:f,isPending:p}=n(),m=async()=>{await f(e),o()};return c(l,{children:[s(a,{variant:`body_short`,children:`By selecting a user to impersonate, you will view the contents of this app as if you would be that user.`}),c(u,{children:[s(r,{variant:`outlined`,onClick:o,children:`Cancel`}),p?s(r,{children:s(i,{})}):s(r,{onClick:m,disabled:e===``||e===d?.uniqueName,children:`Impersonate`})]})]})};export{d as Actions};
@@ -1 +1 @@
1
- import{environment as e}from"../../../../../atoms/utils/auth_environment.js";import{TextField as t}from"../../../../../molecules/TextField/TextField.js";import{ComboBox as n}from"../../../../../molecules/Select/ComboBox/ComboBox.js";import{SingleSelect as r}from"../../../../../molecules/Select/SingleSelect/SingleSelect.js";import{useAllAppRoles as i}from"../hooks/useAllAppRoles.js";import{useCreateImpersonation as a}from"../hooks/useCreateImpersonation.js";import{useEditImpersonation as o}from"../hooks/useEditImpersonation.js";import{Header as s}from"../Impersonate.styles.js";import{Container as c,Section as l}from"./CreateOrEditUser.styles.js";import{useEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{Button as m,DotProgress as h,Icon as g,Typography as _}from"@equinor/eds-core-react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{arrow_back as b}from"@equinor/eds-icons";const x=({editingUser:x,onBack:S,availableFields:C,availableWells:w})=>{let T=f(!1),[E,D]=p([]),[O,k]=p(``),[A,j]=p(``),[M,N]=p(``),[P,F]=p(void 0),[I,L]=p(void 0),{data:R,isLoading:z}=i();u(()=>{if(x&&R&&!T.current){if(T.current=!0,D(x.roles.map(e=>{let t=R.find(t=>t.value===e);return t?{value:e,label:t.displayName}:{value:e,label:e}})),C){let e=C.find(e=>e.uuid==x.field)?.name??void 0;F(e)}if(w){let e=w.find(e=>e==x.well)??void 0;L(e)}k(x.firstName),j(x.lastName),N(x.email??``)}},[R,x,T,C,w]);let B=d(()=>R?.map(e=>({value:e.value,label:e.displayName}))??[],[R]),V=C?.map(e=>({value:e.uuid??``,label:e.name??``}))??[],H=w?.map(e=>({value:e,label:e}))??[],{mutateAsync:U,isPending:W}=a(),{mutateAsync:G,isPending:K}=o(),q=W||K,J=d(()=>O===``||A===``||E.length===0,[O,A,E.length]);return y(c,{children:[y(s,{children:[v(m,{variant:`ghost_icon`,onClick:S,children:v(g,{data:b})}),v(_,{variant:`h6`,children:x?`Edit user`:`Create new user`})]}),y(l,{children:[v(t,{id:`first-name`,label:`First name`,placeholder:`Add first name...`,value:O,onChange:e=>{k(e.target.value)}}),v(t,{id:`last-name`,label:`Last name`,placeholder:`Add last name...`,value:A,onChange:e=>{j(e.target.value)}}),v(t,{id:`email`,label:`E-mail`,placeholder:`Add e-mail...`,meta:`Optional`,value:M,onChange:e=>{N(e.target.value)}})]}),y(l,{children:[V&&V.length>0&&v(r,{placeholder:`Select field...`,label:`Field`,meta:`Optional (For internal application role purposes)`,value:V.find(e=>e.value===P),onSelect:e=>{F(e?.value)},items:V}),H&&H.length>0&&v(r,{label:`Well`,placeholder:`Select well...`,meta:`Optional (For internal application role purposes)`,value:H.find(e=>e.value===I),onSelect:e=>{L(e?.value)},items:H})]}),v(l,{children:v(n,{label:`Roles`,placeholder:`Select roles...`,values:E,onSelect:e=>{D(e)},items:B,loading:z})}),y(l,{children:[v(m,{variant:`outlined`,onClick:S,children:`Cancel`}),q?v(m,{children:v(h,{})}):v(m,{onClick:async()=>{x?(await G({id:x.id,firstName:O,lastName:A,fullName:`${O} ${A}`,email:M===``?void 0:M,field:P,well:I,roles:E.map(e=>e.value).sort(),uniqueName:x.uniqueName,appName:x.appName,activeUsers:[]}),S()):(await U({firstName:O,lastName:A,field:P,well:I,email:M===``?void 0:M,roles:E.map(e=>e.value).sort(),uniqueName:`${O}.${A}`.toLowerCase(),appName:e.getAppName(import.meta.env.VITE_NAME),activeUsers:[]}),S())},disabled:J,children:x?`Save`:`Create`})]})]})};export{x as CreateOrEditUser};
1
+ import{environment as e}from"../../../../../atoms/utils/auth_environment.js";import{TextField as t}from"../../../../../molecules/TextField/TextField.js";import{ComboBox as n}from"../../../../../molecules/Select/ComboBox/ComboBox.js";import{SingleSelect as r}from"../../../../../molecules/Select/SingleSelect/SingleSelect.js";import{useAllAppRoles as i}from"../hooks/useAllAppRoles.js";import{useCreateImpersonation as a}from"../hooks/useCreateImpersonation.js";import{useEditImpersonation as o}from"../hooks/useEditImpersonation.js";import{Header as s}from"../Impersonate.styles.js";import{Container as c,Section as l}from"./CreateOrEditUser.styles.js";import{useEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{Button as m,DotProgress as h,Icon as g,Typography as _}from"@equinor/eds-core-react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{arrow_back as b}from"@equinor/eds-icons";const x=({editingUser:x,onBack:S,availableFields:C,availableWells:w})=>{let T=f(!1),[E,D]=p([]),[O,k]=p(``),[A,j]=p(``),[M,N]=p(``),[P,F]=p(void 0),[I,L]=p(void 0),{data:R,isLoading:z}=i();u(()=>{if(x&&R&&!T.current){if(T.current=!0,D(x.roles.map(e=>{let t=R.find(t=>t.value===e);return t?{value:e,label:t.displayName}:{value:e,label:e}})),C){let e=C.find(e=>e.uuid==x.field)?.name??void 0;F(e)}if(w){let e=w.find(e=>e==x.well)??void 0;L(e)}k(x.firstName),j(x.lastName),N(x.email??``)}},[R,x,T,C,w]);let B=d(()=>R?.map(e=>({value:e.value,label:e.displayName}))??[],[R]),V=C?.map(e=>({value:e.uuid??``,label:e.name??``}))??[],H=w?.map(e=>({value:e,label:e}))??[],{mutateAsync:U,isPending:W}=a(),{mutateAsync:G,isPending:K}=o(),q=W||K,J=d(()=>O===``||A===``||E.length===0,[O,A,E.length]),Y=e=>{k(e.target.value)},X=e=>{j(e.target.value)},Z=e=>{N(e.target.value)},Q=e=>{D(e)},$=e=>{F(e?.value)},ee=e=>{L(e?.value)},te=async()=>{x?(await G({id:x.id,firstName:O,lastName:A,fullName:`${O} ${A}`,email:M===``?void 0:M,field:P,well:I,roles:E.map(e=>e.value).sort(),uniqueName:x.uniqueName,appName:x.appName,activeUsers:[]}),S()):(await U({firstName:O,lastName:A,field:P,well:I,email:M===``?void 0:M,roles:E.map(e=>e.value).sort(),uniqueName:`${O}.${A}`.toLowerCase(),appName:e.getAppName(import.meta.env.VITE_NAME),activeUsers:[]}),S())};return y(c,{children:[y(s,{children:[v(m,{variant:`ghost_icon`,onClick:S,children:v(g,{data:b})}),v(_,{variant:`h6`,children:x?`Edit user`:`Create new user`})]}),y(l,{children:[v(t,{id:`first-name`,label:`First name`,placeholder:`Add first name...`,value:O,onChange:Y}),v(t,{id:`last-name`,label:`Last name`,placeholder:`Add last name...`,value:A,onChange:X}),v(t,{id:`email`,label:`E-mail`,placeholder:`Add e-mail...`,meta:`Optional`,value:M,onChange:Z})]}),y(l,{children:[V&&V.length>0&&v(r,{placeholder:`Select field...`,label:`Field`,meta:`Optional (For internal application role purposes)`,value:V.find(e=>e.value===P),onSelect:$,items:V}),H&&H.length>0&&v(r,{label:`Well`,placeholder:`Select well...`,meta:`Optional (For internal application role purposes)`,value:H.find(e=>e.value===I),onSelect:ee,items:H})]}),v(l,{children:v(n,{label:`Roles`,placeholder:`Select roles...`,values:E,onSelect:Q,items:B,loading:z})}),y(l,{children:[v(m,{variant:`outlined`,onClick:S,children:`Cancel`}),q?v(m,{children:v(h,{})}):v(m,{onClick:te,disabled:J,children:x?`Save`:`Create`})]})]})};export{x as CreateOrEditUser};
@@ -1 +1 @@
1
- import{colors as e}from"../../../../../atoms/style/colors.js";import{useSnackbar as t}from"../../../../../providers/SnackbarProvider/SnackbarProvider.js";import{Button as n}from"../../../../../molecules/Button/Button.js";import{Header as r}from"../Impersonate.styles.js";import{useDeleteImpersonation as i}from"../hooks/useDeleteImpersonation.js";import{Container as a}from"./DeleteUser.styles.js";import{RoleChip as o,RolesContainer as s,TextContent as c}from"../../Account.styles.js";import{ImpersonateAvatar as l}from"../../ImpersonateAvatar.js";import{DotProgress as u,Icon as d,Typography as f}from"@equinor/eds-core-react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{arrow_back as h,delete_to_trash as g}from"@equinor/eds-icons";const _=({user:_,onBack:v})=>{let{mutateAsync:y,isPending:b}=i(),{showSnackbar:x}=t(),S=`${_.firstName} ${_.lastName}`;return m(a,{children:[m(r,{children:[p(n,{variant:`ghost_icon`,onClick:v,children:p(d,{data:h})}),p(f,{variant:`h6`,children:`Delete user`})]}),m(`section`,{children:[p(f,{variant:`h4`,children:`You are deleting a user`}),m(f,{variant:`caption`,color:e.text.static_icons__tertiary.rgba,children:[`Are you sure you want to delete user "`,S,`"?`]})]}),p(l,{size:64,fullName:S}),m(c,{children:[p(f,{variant:`h6`,children:S}),p(f,{children:_.uniqueName})]}),p(s,{children:_.roles.map(e=>p(o,{children:e},e))}),m(`div`,{children:[b?p(n,{variant:`outlined`,color:`danger`,children:p(u,{color:`tertiary`})}):m(n,{variant:`outlined`,color:`danger`,onClick:async()=>{await y(_),x(`Deleted user "${S}" successfully`),v()},children:[p(d,{data:g}),` Delete user`]}),p(n,{variant:`ghost`,onClick:v,children:`Cancel`})]})]})};export{_ as DeleteUser};
1
+ import{colors as e}from"../../../../../atoms/style/colors.js";import{useSnackbar as t}from"../../../../../providers/SnackbarProvider/SnackbarProvider.js";import{Button as n}from"../../../../../molecules/Button/Button.js";import{Header as r}from"../Impersonate.styles.js";import{useDeleteImpersonation as i}from"../hooks/useDeleteImpersonation.js";import{Container as a}from"./DeleteUser.styles.js";import{RoleChip as o,RolesContainer as s,TextContent as c}from"../../Account.styles.js";import{ImpersonateAvatar as l}from"../../ImpersonateAvatar.js";import{DotProgress as u,Icon as d,Typography as f}from"@equinor/eds-core-react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{arrow_back as h,delete_to_trash as g}from"@equinor/eds-icons";const _=({user:_,onBack:v})=>{let{mutateAsync:y,isPending:b}=i(),{showSnackbar:x}=t(),S=`${_.firstName} ${_.lastName}`,C=async()=>{await y(_),x(`Deleted user "${S}" successfully`),v()};return m(a,{children:[m(r,{children:[p(n,{variant:`ghost_icon`,onClick:v,children:p(d,{data:h})}),p(f,{variant:`h6`,children:`Delete user`})]}),m(`section`,{children:[p(f,{variant:`h4`,children:`You are deleting a user`}),m(f,{variant:`caption`,color:e.text.static_icons__tertiary.rgba,children:[`Are you sure you want to delete user "`,S,`"?`]})]}),p(l,{size:64,fullName:S}),m(c,{children:[p(f,{variant:`h6`,children:S}),p(f,{children:_.uniqueName})]}),p(s,{children:_.roles.map(e=>p(o,{children:e},e))}),m(`div`,{children:[b?p(n,{variant:`outlined`,color:`danger`,children:p(u,{color:`tertiary`})}):m(n,{variant:`outlined`,color:`danger`,onClick:C,children:[p(d,{data:g}),` Delete user`]}),p(n,{variant:`ghost`,onClick:v,children:`Cancel`})]})]})};export{_ as DeleteUser};
@@ -1 +1 @@
1
- import{Search as e}from"../../../../molecules/Search/Search.js";import{useActiveImpersonationUser as t}from"./hooks/useActiveImpersonationUser.js";import{CreateOrEditUser as n}from"./CreateOrEditUser/CreateOrEditUser.js";import{DeleteUser as r}from"./DeleteUser/DeleteUser.js";import{useGetAllImpersonationUsersForApp as i}from"./hooks/useGetAllImpersonationUsersForApp.js";import{Actions as a}from"./Actions.js";import{CreateNewUserButton as o}from"./CreateNewUserButton.js";import{Content as s,Header as c,NoUsersText as l}from"./ImpersonateMenu.styles.js";import{impersonateUserDtoToFullName as u}from"./Impersonate.utils.js";import{UserImpersonation as d}from"./UserImpersonation.js";import{useEffect as f,useState as p}from"react";import{Menu as m,Typography as h}from"@equinor/eds-core-react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v=({open:v,onClose:y,anchorEl:b,availableFields:x,availableWells:S})=>{let[C,w]=p(!1),[T,E]=p(void 0),[D,O]=p(void 0),[k,A]=p(``),[j,M]=p(``),{data:N}=i(),{data:P}=t(),F=N?.filter(e=>u(e).toLowerCase().includes(j.toLowerCase()));f(()=>{!v&&P&&k!==P.uniqueName?A(P.uniqueName):!v&&!P&&k!==``&&A(``)},[P,v,k]);let I=()=>{y()},L=()=>w(!0),R=()=>{w(!1),T&&E(void 0)},z=()=>{w(!1),T&&E(void 0),I()},B=e=>{E(N?.find(t=>t.uniqueName===e)),w(!0)},V=e=>{O(N?.find(t=>t.uniqueName===e))};return v?C?g(m,{open:!0,anchorEl:b,onClose:z,placement:`bottom-end`,style:{width:`400px`},children:g(n,{editingUser:T,onBack:R,availableFields:x,availableWells:S})}):D?g(m,{open:!0,anchorEl:b,onClose:z,placement:`bottom-end`,style:{width:`400px`},children:g(r,{user:D,onBack:()=>{O(void 0)}})}):_(m,{open:!0,anchorEl:b,onClose:I,placement:`bottom-end`,style:{width:`400px`},children:[_(c,{children:[g(h,{variant:`h6`,children:`Impersonate`}),g(h,{variant:`caption`,children:`Select a user to impersonate`}),g(e,{placeholder:`Search users`,value:j,onChange:e=>{M(e.target.value)}})]}),g(s,{children:F&&F.length>0?F?.map(e=>g(d,{...e,selected:k===e.uniqueName,onClick:A,onEdit:B,onDelete:V},e.uniqueName)):g(l,{children:`No items found`})}),g(o,{onClick:L}),g(a,{selectedUniqueName:k,onCancel:y})]}):null};export{v as ImpersonateMenu};
1
+ import{Search as e}from"../../../../molecules/Search/Search.js";import{useActiveImpersonationUser as t}from"./hooks/useActiveImpersonationUser.js";import{CreateOrEditUser as n}from"./CreateOrEditUser/CreateOrEditUser.js";import{DeleteUser as r}from"./DeleteUser/DeleteUser.js";import{useGetAllImpersonationUsersForApp as i}from"./hooks/useGetAllImpersonationUsersForApp.js";import{Actions as a}from"./Actions.js";import{CreateNewUserButton as o}from"./CreateNewUserButton.js";import{Content as s,Header as c,NoUsersText as l}from"./ImpersonateMenu.styles.js";import{impersonateUserDtoToFullName as u}from"./Impersonate.utils.js";import{UserImpersonation as d}from"./UserImpersonation.js";import{useEffect as f,useState as p}from"react";import{Menu as m,Typography as h}from"@equinor/eds-core-react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v=({open:v,onClose:y,anchorEl:b,availableFields:x,availableWells:S})=>{let[C,w]=p(!1),[T,E]=p(void 0),[D,O]=p(void 0),[k,A]=p(``),[j,M]=p(``),{data:N}=i(),{data:P}=t(),F=N?.filter(e=>u(e).toLowerCase().includes(j.toLowerCase()));f(()=>{!v&&P&&k!==P.uniqueName?A(P.uniqueName):!v&&!P&&k!==``&&A(``)},[P,v,k]);let I=()=>{y()},L=()=>w(!0),R=()=>{w(!1),T&&E(void 0)},z=()=>{w(!1),T&&E(void 0),I()},B=e=>{E(N?.find(t=>t.uniqueName===e)),w(!0)},V=e=>{O(N?.find(t=>t.uniqueName===e))},H=()=>{O(void 0)},U=e=>{M(e.target.value)};return v?C?g(m,{open:!0,anchorEl:b,onClose:z,placement:`bottom-end`,style:{width:`400px`},children:g(n,{editingUser:T,onBack:R,availableFields:x,availableWells:S})}):D?g(m,{open:!0,anchorEl:b,onClose:z,placement:`bottom-end`,style:{width:`400px`},children:g(r,{user:D,onBack:H})}):_(m,{open:!0,anchorEl:b,onClose:I,placement:`bottom-end`,style:{width:`400px`},children:[_(c,{children:[g(h,{variant:`h6`,children:`Impersonate`}),g(h,{variant:`caption`,children:`Select a user to impersonate`}),g(e,{placeholder:`Search users`,value:j,onChange:U})]}),g(s,{children:F&&F.length>0?F?.map(e=>g(d,{...e,selected:k===e.uniqueName,onClick:A,onEdit:B,onDelete:V},e.uniqueName)):g(l,{children:`No items found`})}),g(o,{onClick:L}),g(a,{selectedUniqueName:k,onCancel:y})]}):null};export{v as ImpersonateMenu};
@@ -1,7 +1,7 @@
1
- import * as react109 from "react";
1
+ import * as react126 from "react";
2
2
  import { HTMLAttributes } from "react";
3
3
 
4
4
  //#region src/organisms/TopBar/Actions.d.ts
5
- declare const Actions: react109.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react109.RefAttributes<HTMLDivElement>>;
5
+ declare const Actions: react126.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react126.RefAttributes<HTMLDivElement>>;
6
6
  //#endregion
7
7
  export { Actions };
@@ -1,5 +1,5 @@
1
1
  import { Field } from "../../../atoms/types/Field.js";
2
- import * as react105 from "react";
2
+ import * as react124 from "react";
3
3
 
4
4
  //#region src/organisms/TopBar/FieldMenu/FieldMenu.d.ts
5
5
  interface FieldMenuProps {
@@ -9,6 +9,6 @@ interface FieldMenuProps {
9
9
  itemNameSingular?: string;
10
10
  showAccessITLink?: boolean;
11
11
  }
12
- declare const FieldMenu: react105.ForwardRefExoticComponent<FieldMenuProps & react105.RefAttributes<HTMLDivElement>>;
12
+ declare const FieldMenu: react124.ForwardRefExoticComponent<FieldMenuProps & react124.RefAttributes<HTMLDivElement>>;
13
13
  //#endregion
14
14
  export { FieldMenu };
@@ -1,10 +1,10 @@
1
- import * as react140 from "react";
1
+ import * as react142 from "react";
2
2
  import * as styled_components_dist_types48 from "styled-components/dist/types";
3
3
 
4
4
  //#region src/organisms/TopBar/Guidelines/Colorbox.d.ts
5
5
  interface ColorboxProps {
6
6
  $color: string;
7
7
  }
8
- declare const Colorbox: styled_components_dist_types48.IStyledComponentBase<"web", styled_components_dist_types48.Substitute<react140.DetailedHTMLProps<react140.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ColorboxProps>> & string;
8
+ declare const Colorbox: styled_components_dist_types48.IStyledComponentBase<"web", styled_components_dist_types48.Substitute<react142.DetailedHTMLProps<react142.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ColorboxProps>> & string;
9
9
  //#endregion
10
10
  export { Colorbox };
@@ -1,4 +1,4 @@
1
- import * as react137 from "react";
1
+ import * as react123 from "react";
2
2
  import { Dispatch, FC, ReactNode, SetStateAction } from "react";
3
3
 
4
4
  //#region src/organisms/TopBar/Notifications/NotificationProvider.d.ts
@@ -6,7 +6,7 @@ interface NotificationContext {
6
6
  setIsOpen: Dispatch<SetStateAction<boolean>>;
7
7
  isOpen: boolean;
8
8
  }
9
- declare const NotificationContext: react137.Context<NotificationContext | undefined>;
9
+ declare const NotificationContext: react123.Context<NotificationContext | undefined>;
10
10
  declare const useNotification: () => NotificationContext;
11
11
  //#endregion
12
12
  export { useNotification };
@@ -2,7 +2,7 @@ import{EnvironmentType as e}from"../../../../atoms/enums/Environment.js";import{
2
2
  ${e.urgency?i:``}
3
3
  ${t?a:``}
4
4
  ${o}
5
- ${e.description} \n \n User agent string: ${navigator.userAgent}`},m=(t,n)=>{let r=n?`selfservice?id=ticket&table=incident&sys_id=`:`now/nav/ui/classic/params/target/incident.do%3Fsys_id%3D`;return`https://equinor${l(import.meta.env.VITE_ENVIRONMENT_NAME)===e.PRODUCTION?``:`test`}.service-now.com/${r}${t}`},h=()=>{if(navigator.userAgent.includes(i.EDGE_SHORT))return i.EDGE;if(navigator.userAgent.includes(i.CHROME))return i.CHROME;if(navigator.userAgent.includes(i.SAFARI))return i.SAFARI;if(navigator.userAgent.includes(i.FIREFOX))return i.FIREFOX},g=e=>{let t=e;e===i.EDGE&&(t=i.EDGE_SHORT);let n=RegExp(`${t}/(\\d+(?:\\.\\d+)+)`);return navigator.userAgent.match(n)?.[1]},_=()=>{let e=h();return e?`${e} (${g(e)})`:`Not found`},v=(e,t,i,o,s)=>{let l=i===a.BUG?`:bug: Bug report`:`:bulb: Suggestion`,d=[],f=[];f.push({type:`mrkdwn`,text:`*Title* \n ${e.title}`}),d.push({type:`mrkdwn`,text:` ${n(new Date,{format:`DD. month YYYY`})}`}),e.url&&d.push({type:`mrkdwn`,text:`*<${e.url}|Error URL>*`}),e.urgency&&f.push({type:`mrkdwn`,text:`*Severity* \n ${u(e)} ${e.urgency}`});let p=[{type:`header`,text:{type:`plain_text`,text:l,emoji:!0}},{type:`section`,fields:d},{type:`section`,fields:f},{type:`section`,fields:[{type:`mrkdwn`,text:`*Application*
5
+ ${e.description} \n \n User agent string: ${navigator.userAgent}`},m=(t,n)=>{let r=n?`selfservice?id=ticket&table=incident&sys_id=`:`now/nav/ui/classic/params/target/incident.do%3Fsys_id%3D`,i=l(import.meta.env.VITE_ENVIRONMENT_NAME)===e.PRODUCTION;return`https://equinor${i?``:`test`}.service-now.com/${r}${t}`},h=()=>{if(navigator.userAgent.includes(i.EDGE_SHORT))return i.EDGE;if(navigator.userAgent.includes(i.CHROME))return i.CHROME;if(navigator.userAgent.includes(i.SAFARI))return i.SAFARI;if(navigator.userAgent.includes(i.FIREFOX))return i.FIREFOX},g=e=>{let t=e;e===i.EDGE&&(t=i.EDGE_SHORT);let n=RegExp(`${t}/(\\d+(?:\\.\\d+)+)`);return navigator.userAgent.match(n)?.[1]},_=()=>{let e=h();return e?`${e} (${g(e)})`:`Not found`},v=(e,t,i,o,s)=>{let l=i===a.BUG,d=l?`:bug: Bug report`:`:bulb: Suggestion`,f=[],p=[];p.push({type:`mrkdwn`,text:`*Title* \n ${e.title}`}),f.push({type:`mrkdwn`,text:` ${n(new Date,{format:`DD. month YYYY`})}`}),e.url&&f.push({type:`mrkdwn`,text:`*<${e.url}|Error URL>*`}),e.urgency&&p.push({type:`mrkdwn`,text:`*Severity* \n ${u(e)} ${e.urgency}`});let h=[{type:`header`,text:{type:`plain_text`,text:d,emoji:!0}},{type:`section`,fields:f},{type:`section`,fields:p},{type:`section`,fields:[{type:`mrkdwn`,text:`*Application*
6
6
  `+c(import.meta.env.VITE_NAME)},{type:`mrkdwn`,text:`*User* \n ${o}`}]},{type:`section`,fields:[{type:`mrkdwn`,text:`*Browser*
7
7
  `+_()},{type:`mrkdwn`,text:`*Field* \n ${r(t??`Not found`)}`}]},{type:`section`,text:{type:`mrkdwn`,text:`*Description*
8
- `+e.description}}];return s&&p.push({type:`section`,text:{type:`mrkdwn`,text:`*<${m(s)}|:link: Click to open the ticket in Service Now>*`}}),p.push({type:`divider`}),JSON.stringify(p)};export{p as createServiceNowDescription,m as createServiceNowUrl,v as createSlackMessage,f as getUrgencyNumber,d as readUploadedFileAsText};
8
+ `+e.description}}];return s&&h.push({type:`section`,text:{type:`mrkdwn`,text:`*<${m(s)}|:link: Click to open the ticket in Service Now>*`}}),h.push({type:`divider`}),JSON.stringify(h)};export{p as createServiceNowDescription,m as createServiceNowUrl,v as createSlackMessage,f as getUrgencyNumber,d as readUploadedFileAsText};
@@ -1 +1 @@
1
- import{FeedbackType as e}from"../Feedback.types.js";import{useFeedbackContext as t}from"../hooks/useFeedbackContext.js";import{UploadFile as n}from"./UploadFile/UploadFile.js";import{Description as r}from"./Description.js";import{Severity as i}from"./Severity.js";import{Title as a}from"./Title.js";import{Url as o}from"./Url.js";import{Actions as s,Container as c,ContentWrapper as l,LockedFormWarning as u,ReportLocationText as d,UploadInfo as f}from"../Feedback.styles.js";import{useMemo as p}from"react";import{Button as m,Icon as h,Typography as g}from"@equinor/eds-core-react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{info_circle as b}from"@equinor/eds-icons";const x=()=>{let{isWrongDomain:x,selectedType:S,resetForm:C,feedbackContent:w,onDialogClose:T,serviceNowSuccess:E,handleSave:D,requestIsLoading:O}=t(),k=p(()=>w.title.length>0&&w.description.length>0&&!x,[w.title.length,w.description.length,x]);return v(l,{children:y(c,{children:[v(a,{}),S===e.BUG&&y(_,{children:[v(i,{}),v(o,{})]}),v(r,{}),y(f,{children:[v(h,{data:b}),v(g,{children:`Please make sure the uploaded files do not contain confidential or personal information`})]}),v(n,{}),v(d,{children:S===e.BUG?`Bug reports are sent to Service Now and to the development team directly`:`Feature suggestions are sent to the development team directly`}),E&&y(u,{children:[v(h,{data:b}),v(g,{children:`The report has already been sent to service now, and part of the form is locked, so you can retry sending it to the development team. Otherwise you can reset the form with the "Reset form" button in the bottom left corner.`})]}),y(s,{children:[v(m,{variant:`ghost`,onClick:C,"data-testid":`reset-form-button`,children:`Reset form`}),y(`div`,{children:[v(m,{variant:`ghost`,onClick:T,children:`Cancel`}),v(m,{onClick:D,disabled:!k||O,"data-testid":`submit-button`,children:E?`Send again`:`Send`})]})]})]})})};export{x as FeedbackForm};
1
+ import{FeedbackType as e}from"../Feedback.types.js";import{useFeedbackContext as t}from"../hooks/useFeedbackContext.js";import{UploadFile as n}from"./UploadFile/UploadFile.js";import{Description as r}from"./Description.js";import i from"./Severity.js";import{Title as a}from"./Title.js";import{Url as o}from"./Url.js";import{Actions as s,Container as c,ContentWrapper as l,LockedFormWarning as u,ReportLocationText as d,UploadInfo as f}from"../Feedback.styles.js";import{useMemo as p}from"react";import{Button as m,Icon as h,Typography as g}from"@equinor/eds-core-react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{info_circle as b}from"@equinor/eds-icons";const x=()=>{let{isWrongDomain:x,selectedType:S,resetForm:C,feedbackContent:w,onDialogClose:T,serviceNowSuccess:E,handleSave:D,requestIsLoading:O}=t(),k=p(()=>w.title.length>0&&w.description.length>0&&!x,[w.title.length,w.description.length,x]);return v(l,{children:y(c,{children:[v(a,{}),S===e.BUG&&y(_,{children:[v(i,{}),v(o,{})]}),v(r,{}),y(f,{children:[v(h,{data:b}),v(g,{children:`Please make sure the uploaded files do not contain confidential or personal information`})]}),v(n,{}),v(d,{children:S===e.BUG?`Bug reports are sent to Service Now and to the development team directly`:`Feature suggestions are sent to the development team directly`}),E&&y(u,{children:[v(h,{data:b}),v(g,{children:`The report has already been sent to service now, and part of the form is locked, so you can retry sending it to the development team. Otherwise you can reset the form with the "Reset form" button in the bottom left corner.`})]}),y(s,{children:[v(m,{variant:`ghost`,onClick:C,"data-testid":`reset-form-button`,children:`Reset form`}),y(`div`,{children:[v(m,{variant:`ghost`,onClick:T,children:`Cancel`}),v(m,{onClick:D,disabled:!k||O,"data-testid":`submit-button`,children:E?`Send again`:`Send`})]})]})]})})};export{x as FeedbackForm};
@@ -1,3 +1,3 @@
1
1
  import{SingleSelect as e}from"../../../../../molecules/Select/SingleSelect/SingleSelect.js";import{UrgencyOption as t}from"../Feedback.types.js";import{useFeedbackContext as n}from"../hooks/useFeedbackContext.js";import{LockedInputTooltip as r}from"./LockedInputTooltip.js";import i from"styled-components";import{jsx as a}from"react/jsx-runtime";const o=i.div`
2
2
  grid-column: 1/2;
3
- `,s=Object.values(t).map(e=>({value:e,label:e})),c=()=>{let{serviceNowSuccess:t,feedbackContent:i,updateFeedback:c}=n(),l=i.urgency?{value:i.urgency,label:i.urgency}:void 0;return a(o,{children:a(r,{show:t,children:a(e,{items:s,label:`Severity`,meta:`optional`,clearable:!1,disabled:t,value:l,placeholder:`Select error impact`,onSelect:e=>{c(`urgency`,e.value)}})})})};export{c as Severity};
3
+ `,s=Object.values(t).map(e=>({value:e,label:e})),c=()=>{let{serviceNowSuccess:t,feedbackContent:i,updateFeedback:c}=n(),l=i.urgency?{value:i.urgency,label:i.urgency}:void 0;return a(o,{children:a(r,{show:t,children:a(e,{items:s,label:`Severity`,meta:`optional`,clearable:!1,disabled:t,value:l,placeholder:`Select error impact`,onSelect:e=>{c(`urgency`,e.value)}})})})};export{c as default};
@@ -4,4 +4,4 @@ import{tokens as e}from"../../../../../../node_modules/@equinor/eds-tokens/dist/
4
4
  width: 82px;
5
5
  height: 82px;
6
6
  position: relative;
7
- `,_=e=>{let[u,_]=c(``),{error:v,onDelete:y}=e,b=s(()=>{if(!v)return;let t=e.errors[0].code,n=e.errors[0].message;return t===`file-too-large`?n=n.replace(/(\d+ bytes)/,`1MB`):t===`file-invalid-type`&&(n=n.replace(/(\w+\/\w+,)/g,``).replaceAll(`,`,`, `)),`${e.errors[0].code} \n${n}`},[v,e]),x=s(()=>e.file.name,[v,e]),S=s(()=>v?e.errors.find(e=>e.code.includes(`invalid`))?`Invalid file type`:e.errors.find(e=>e.code.includes(`large`))?`Invalid file size`:`Error`:``,[v,e]);return o(()=>{v||(async e=>{let n=await t(e);_(n)})(e.file)},[v,e]),f(g,{children:[d(r,{title:`${x}${v?`: `+b:``}`,children:v?f(a,{children:[d(l,{data:m,color:h.interactive.warning__text.rgba}),d(`div`,{children:S})]}):d(i,{children:d(`img`,{src:u,alt:`Uploaded file: ${x}`})})}),d(n,{"data-testid":`attachment-delete-button`,onClick:y,children:d(l,{color:h.text.static_icons__tertiary.rgba,data:p,size:24})})]})};export{_ as ImageFile};
7
+ `,_=e=>{let[u,_]=c(``),{error:v,onDelete:y}=e,b=s(()=>{if(!v)return;let t=e.errors[0].code,n=e.errors[0].message;return t===`file-too-large`?n=n.replace(/(\d+ bytes)/,`1MB`):t===`file-invalid-type`&&(n=n.replace(/(\w+\/\w+,)/g,``).replaceAll(`,`,`, `)),`${e.errors[0].code} \n${n}`},[v,e]),x=s(()=>e.file.name,[v,e]),S=s(()=>v?e.errors.find(e=>e.code.includes(`invalid`))?`Invalid file type`:e.errors.find(e=>e.code.includes(`large`))?`Invalid file size`:`Error`:``,[v,e]);return o(()=>{let n=async e=>{let n=await t(e);_(n)};v||n(e.file)},[v,e]),f(g,{children:[d(r,{title:`${x}${v?`: `+b:``}`,children:v?f(a,{children:[d(l,{data:m,color:h.interactive.warning__text.rgba}),d(`div`,{children:S})]}):d(i,{children:d(`img`,{src:u,alt:`Uploaded file: ${x}`})})}),d(n,{"data-testid":`attachment-delete-button`,onClick:y,children:d(l,{color:h.text.static_icons__tertiary.rgba,data:p,size:24})})]})};export{_ as ImageFile};
@@ -2,4 +2,4 @@ import{FileUploadArea as e}from"../../../../../../molecules/FileUploadArea/FileU
2
2
  grid-column: 1/3;
3
3
  display: flex;
4
4
  flex-direction: column;
5
- `;function d(e,t){if(e.length===0||e.length===1)return e;for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++)t(e[n],e[r])&&e.splice(n,1);return e}const f=()=>{let{feedbackAttachments:s,setFeedbackAttachments:f}=n(),[p,m]=o([]),h=(e,t)=>{if(e.length>=1){let t=e.filter(e=>!e.name.startsWith(`.`));new FileReader().readAsDataURL(e[0]);let n=[];s&&n.push(...s);let r=[...t,...n],i=d(r,(e,t)=>e.name===t.name&&e.size===t.size);f(i)}m(t)},g=e=>{let t=s?.filter(t=>t.name!==e.name&&t.size!==e.size)??[];f(t)},_=e=>{m(p?.filter(t=>t.file.name===e.file.name&&t.file.size!==e.file.size)??[])};return l(u,{children:[c(i,{group:`input`,variant:`label`,children:`Attachments (.jpg, .jpeg, .png) (max 1 MB)`}),l(r,{children:[c(e,{maxSize:t,onDrop:h,accept:{"image/jpeg":[`.jpeg`,`.jpg`],"image/png":[`.png`]},size:`small`}),s?.map(e=>c(a,{onDelete:()=>g(e),file:e},e.name+e.size)),p.map(e=>c(a,{...e,onDelete:()=>_(e),error:!0},e.file.name+e.file.size))]})]})};export{f as UploadFile};
5
+ `;function d(e,t){if(e.length===0||e.length===1)return e;for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++)t(e[n],e[r])&&e.splice(n,1);return e}const f=()=>{let{feedbackAttachments:s,setFeedbackAttachments:f}=n(),[p,m]=o([]),h=(e,t)=>{if(e.length>=1){let t=e.filter(e=>!e.name.startsWith(`.`)),n=new FileReader;n.readAsDataURL(e[0]);let r=[];s&&r.push(...s);let i=[...t,...r],a=d(i,(e,t)=>e.name===t.name&&e.size===t.size);f(a)}m(t)},g=e=>{let t=s?.filter(t=>t.name!==e.name&&t.size!==e.size)??[];f(t)},_=e=>{m(p?.filter(t=>t.file.name===e.file.name&&t.file.size!==e.file.size)??[])};return l(u,{children:[c(i,{group:`input`,variant:`label`,children:`Attachments (.jpg, .jpeg, .png) (max 1 MB)`}),l(r,{children:[c(e,{maxSize:t,onDrop:h,accept:{"image/jpeg":[`.jpeg`,`.jpg`],"image/png":[`.png`]},size:`small`}),s?.map(e=>c(a,{onDelete:()=>g(e),file:e},e.name+e.size)),p.map(e=>c(a,{...e,onDelete:()=>_(e),error:!0},e.file.name+e.file.size))]})]})};export{f as UploadFile};
@@ -1,3 +1,3 @@
1
1
  import{TextField as e}from"../../../../../molecules/TextField/TextField.js";import{EQUINOR_EMAIL_SUFFIX as t}from"../Feedback.const.js";import{useFeedbackContext as n}from"../hooks/useFeedbackContext.js";import{LockedInputTooltip as r}from"./LockedInputTooltip.js";import i from"styled-components";import{jsx as a}from"react/jsx-runtime";const o=i.div`
2
2
  grid-column: 2/3;
3
- `,s=()=>{let{serviceNowSuccess:i,feedbackContent:s,updateFeedback:c,isWrongDomain:l,setIsWrongDomain:u}=n();return a(o,{children:a(r,{show:i,children:a(e,{id:`feedback-url`,label:`URL`,disabled:i,meta:`optional`,value:s.url,placeholder:`URL of error location`,variant:l?`error`:void 0,helperText:l?`The provided URL must be from a ${t} domain`:``,onChange:e=>{c(`url`,e.currentTarget.value),(e.currentTarget.value===``||l&&e.currentTarget.value.includes(t))&&u(!1)},onBlur:e=>{let n=e.currentTarget.value;!n.includes(t)&&n.length!==0&&u(!0)}})})})};export{s as Url};
3
+ `,s=()=>{let{serviceNowSuccess:i,feedbackContent:s,updateFeedback:c,isWrongDomain:l,setIsWrongDomain:u}=n(),d=e=>{c(`url`,e.currentTarget.value),(e.currentTarget.value===``||l&&e.currentTarget.value.includes(t))&&u(!1)},f=e=>{let n=e.currentTarget.value;!n.includes(t)&&n.length!==0&&u(!0)};return a(o,{children:a(r,{show:i,children:a(e,{id:`feedback-url`,label:`URL`,disabled:i,meta:`optional`,value:s.url,placeholder:`URL of error location`,variant:l?`error`:void 0,helperText:l?`The provided URL must be from a ${t} domain`:``,onChange:d,onBlur:f})})})};export{s as Url};
@@ -1,4 +1,4 @@
1
- import{spacings as e}from"../../../../../atoms/style/spacings.js";import{useFeedbackContext as t}from"../hooks/useFeedbackContext.js";import{ContentWrapper as n}from"../Feedback.styles.js";import{AnimateChangeInHeight as r}from"./AnimateChangeInHeight.js";import{ResponseStatus as i}from"./ResponseStatus.js";import{Success as a}from"./Success.js";import{useEffect as o,useState as s}from"react";import{Button as c}from"@equinor/eds-core-react";import l from"styled-components";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{motion as f}from"framer-motion";const p=l(f.div)`
1
+ import{spacings as e}from"../../../../../atoms/style/spacings.js";import{useFeedbackContext as t}from"../hooks/useFeedbackContext.js";import{ContentWrapper as n}from"../Feedback.styles.js";import{AnimateChangeInHeight as r}from"./AnimateChangeInHeight.js";import i from"./ResponseStatus.js";import{Success as a}from"./Success.js";import{useEffect as o,useState as s}from"react";import{Button as c}from"@equinor/eds-core-react";import l from"styled-components";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{motion as f}from"framer-motion";const p=l(f.div)`
2
2
  display: flex;
3
3
  gap: ${e.large};
4
4
  height: auto;
@@ -1 +1 @@
1
- import{FeedbackType as e}from"../Feedback.types.js";import{useFeedbackContext as t}from"../hooks/useFeedbackContext.js";import{RequestStatus as n}from"./RequestStatus.js";import{FullSlackResponse as r}from"./FullSlackResponse.js";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";const s=()=>{let{serviceNowRequestResponse:s,selectedType:c,showAllSlackRequests:l,allSlackRequestStatus:u}=t();return o(i,{children:[c===e.BUG&&a(n,{title:`Service Now`,requestStatus:s}),l?a(r,{allSlackRequestStatus:{status:u}}):a(n,{title:`Development team`,requestStatus:{status:u}})]})};export{s as ResponseStatus};
1
+ import{FeedbackType as e}from"../Feedback.types.js";import{useFeedbackContext as t}from"../hooks/useFeedbackContext.js";import{RequestStatus as n}from"./RequestStatus.js";import{FullSlackResponse as r}from"./FullSlackResponse.js";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";const s=()=>{let{serviceNowRequestResponse:s,selectedType:c,showAllSlackRequests:l,allSlackRequestStatus:u}=t();return o(i,{children:[c===e.BUG&&a(n,{title:`Service Now`,requestStatus:s}),l?a(r,{allSlackRequestStatus:{status:u}}):a(n,{title:`Development team`,requestStatus:{status:u}})]})};export{s as default};
@@ -1 +1 @@
1
- import{useReleaseNotes as e}from"../../../../../providers/ReleaseNotesProvider.js";import{ButtonContainer as t,Wrapper as n}from"./Header.styles.js";import{Button as r,Icon as i,Tooltip as a,Typography as o}from"@equinor/eds-core-react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{close as l,external_link as u}from"@equinor/eds-icons";const d=()=>{let{setOpen:d,showAllReleaseNotesLink:f}=e();return c(n,{children:[s(o,{variant:`h1`,bold:!0,children:`What's new?`}),c(t,{children:[s(a,{title:`Release notes in SAM`,children:s(r,{variant:`ghost_icon`,href:f,target:`_blank`,children:s(i,{data:u})})}),s(r,{variant:`ghost_icon`,onClick:()=>{d(!1)},"aria-label":`close modal`,children:s(i,{data:l})})]})]})};export{d as Header};
1
+ import{useReleaseNotes as e}from"../../../../../providers/ReleaseNotesProvider.js";import{ButtonContainer as t,Wrapper as n}from"./Header.styles.js";import{Button as r,Icon as i,Tooltip as a,Typography as o}from"@equinor/eds-core-react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{close as l,external_link as u}from"@equinor/eds-icons";const d=()=>{let{setOpen:d,showAllReleaseNotesLink:f}=e(),p=()=>{d(!1)};return c(n,{children:[s(o,{variant:`h1`,bold:!0,children:`What's new?`}),c(t,{children:[s(a,{title:`Release notes in SAM`,children:s(r,{variant:`ghost_icon`,href:f,target:`_blank`,children:s(i,{data:u})})}),s(r,{variant:`ghost_icon`,onClick:p,"aria-label":`close modal`,children:s(i,{data:l})})]})]})};export{d as Header};
@@ -1 +1 @@
1
- import{Status as e}from"../../../Status/index.js";import{usePrefetchRichTextImages as t}from"../../../../atoms/hooks/usePrefetchRichTextImages.js";import{useReleaseNotes as n}from"../../../../providers/ReleaseNotesProvider.js";import{Button as r}from"../../../../molecules/Button/Button.js";import{Header as i}from"./Header/Header.js";import{AllReleaseNotesWrapper as a,LoadingWrapper as o,StyledDialog as s}from"./ReleaseNotesDialog.styles.js";import{ReleaseNote as c}from"../../../ReleaseNote/ReleaseNote.js";import{CircularProgress as l}from"@equinor/eds-core-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{ReleaseNotesService as p,useReleaseNotesQuery as m}from"@equinor/subsurface-app-management";const h=({enabled:h})=>{let{setOpen:g,open:_,mostRecentReleaseNote:v,showAllReleaseNotesLink:y}=n(),{isLoading:b}=m({enabled:h}),{isPrefetching:x}=t({richTextValues:v?.body?[v.body]:[],onImageRead:p.getReleaseNoteImage});return f(s,{open:_,onClose:()=>{g(!1)},isDismissable:!0,children:[d(i,{}),b||x?d(o,{children:d(l,{})}):v?f(u,{children:[d(c,{...v,expanded:!0}),d(a,{children:d(r,{variant:`ghost`,href:y,target:`_blank`,children:`See all release notes in SAM`})})]}):f(e,{children:[d(e.Title,{title:`No published release notes`}),d(e.Description,{text:`This application has no published release notes yet.`})]})]})};export{h as ReleaseNotesDialog};
1
+ import{Status as e}from"../../../Status/index.js";import{usePrefetchRichTextImages as t}from"../../../../atoms/hooks/usePrefetchRichTextImages.js";import{useReleaseNotes as n}from"../../../../providers/ReleaseNotesProvider.js";import{Button as r}from"../../../../molecules/Button/Button.js";import{Header as i}from"./Header/Header.js";import{AllReleaseNotesWrapper as a,LoadingWrapper as o,StyledDialog as s}from"./ReleaseNotesDialog.styles.js";import{ReleaseNote as c}from"../../../ReleaseNote/ReleaseNote.js";import{CircularProgress as l}from"@equinor/eds-core-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{ReleaseNotesService as p,useReleaseNotesQuery as m}from"@equinor/subsurface-app-management";const h=({enabled:h})=>{let{setOpen:g,open:_,mostRecentReleaseNote:v,showAllReleaseNotesLink:y}=n(),{isLoading:b}=m({enabled:h}),{isPrefetching:x}=t({richTextValues:v?.body?[v.body]:[],onImageRead:p.getReleaseNoteImage}),S=()=>{g(!1)};return f(s,{open:_,onClose:S,isDismissable:!0,children:[d(i,{}),b||x?d(o,{children:d(l,{})}):v?f(u,{children:[d(c,{...v,expanded:!0}),d(a,{children:d(r,{variant:`ghost`,href:y,target:`_blank`,children:`See all release notes in SAM`})})]}):f(e,{children:[d(e.Title,{title:`No published release notes`}),d(e.Description,{text:`This application has no published release notes yet.`})]})]})};export{h as ReleaseNotesDialog};
@@ -1,4 +1,4 @@
1
- import{EnvironmentType as e}from"../../atoms/enums/Environment.js";import{colors as t}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";import{Button as r,CircularProgress as i,TopBar as a,Typography as o}from"@equinor/eds-core-react";import s,{css as c}from"styled-components";import{Link as l}from"@tanstack/react-router";const u=s(a)`
1
+ import{EnvironmentType as e}from"../../atoms/enums/Environment.js";import{colors as t}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";import{Button as r,CircularProgress as i,TopBar as a,Typography as o}from"@equinor/eds-core-react";import s,{css as c}from"styled-components";import{Link as l}from"react-router-dom";const u=s(a)`
2
2
  border-bottom: 1px solid ${t.ui.background__medium.rgba};
3
3
  padding-left: ${n.medium};
4
4
  align-content: center;
@@ -18,4 +18,4 @@ import{animation as e}from"../../../atoms/style/animation.js";import{colors as t
18
18
  &:hover {
19
19
  background: ${t.interactive.primary__hover_alt.rgba};
20
20
  }
21
- `,f=({onTutorialStart:e,onClose:n,id:a,name:f})=>{let{startTutorial:p,seenTutorialIDs:m}=u(),h=m.includes(a);return s(d,{onClick:()=>{p(a),e?.(a),n()},children:[h&&s(`header`,{children:[o(r,{data:c,size:16,color:t.interactive.primary__resting.rgba}),o(i,{varinat:`caption`,children:`COMPLETED`})]}),o(i,{variant:`h4`,children:f}),o(r,{data:l,color:t.interactive.primary__resting.rgba})]})};export{f as TutorialItem};
21
+ `,f=({onTutorialStart:e,onClose:n,id:a,name:f})=>{let{startTutorial:p,seenTutorialIDs:m}=u(),h=m.includes(a),g=()=>{p(a),e?.(a),n()};return s(d,{onClick:g,children:[h&&s(`header`,{children:[o(r,{data:c,size:16,color:t.interactive.primary__resting.rgba}),o(i,{varinat:`caption`,children:`COMPLETED`})]}),o(i,{variant:`h4`,children:f}),o(r,{data:l,color:t.interactive.primary__resting.rgba})]})};export{f as TutorialItem};
@@ -1 +1 @@
1
- import{auth as e,environment as t}from"../../atoms/utils/auth_environment.js";import{FullPageSpinner as n}from"../../molecules/FullPageSpinner/FullPageSpinner.js";import{MissingAccessToApp as r}from"../../organisms/Status/collections/MissingAccessToApp.js";import{useEffect as i,useRef as a,useState as o}from"react";import{useMsal as s,useMsalAuthentication as c}from"@azure/msal-react";import{InteractionRequiredAuthError as l,InteractionType as u}from"@azure/msal-browser";import{jsx as d}from"react/jsx-runtime";import{jwtDecode as f}from"jwt-decode";const{GRAPH_ENDPOINTS:p,GRAPH_REQUESTS_LOGIN:m,GRAPH_REQUESTS_PHOTO:h,GRAPH_REQUESTS_BACKEND:g,fetchMsGraph:_,isInIframe:v}=e,{getApiScope:y}=t,b=({children:e,account:t,setAccount:b,setPhoto:x,setRoles:S,authState:C,setAuthState:w,withoutLoader:T,loadingComponent:E,unauthorizedComponent:D,withoutBackend:O})=>{let{instance:k,accounts:A,inProgress:j}=s(),{login:M,result:N,error:P,acquireToken:F}=c(u.Silent,m),[I,L]=o(!1),R=a(!1);return i(()=>{I||(async()=>{console.log(`[AuthProvider] Initializing`),await k.initialize(),console.log(`[AuthProvider] Finished initializing`),L(!0)})().catch(e=>{console.error(`[AuthProvider] Error during initialization`,e)})},[k,I]),i(()=>{I&&(P instanceof l&&!v()&&C!==`unauthorized`?(console.error(P),console.log(`[AuthProvider] No account found, need to login via. redirect`),M(u.Redirect,m).catch(e=>{console.error(`[AuthProvider] Error during login`,e)})):N?.account&&!t?(console.log(`[AuthProvider] Found account in useMsalAuth result, setting that one as active`),k.setActiveAccount(N.account),b(N.account)):A.length>0&&!t?(console.log(`[AuthProvider] Found account in accounts array, setting that one as active`),k.setActiveAccount(A[0]),b(A[0])):P&&console.error(`[AuthProvider] Unexpected error:`,P))},[t,A,P,k,I,M,N,b,C]),i(()=>{if(!t||!I||R.current||j!==`none`)return;R.current=!0;let e=async()=>{try{let e=await F(u.Silent,h);if(e){let t=await _(p.PHOTO,e.accessToken);if(t.status===404)return null;let n=await t.blob(),r=(window.URL??window.webkitURL).createObjectURL(n);x(r)}}catch(e){console.error(e)}},n=async()=>{try{let e=await F(u.Silent,g(y(import.meta.env.VITE_API_SCOPE)));if(console.log(`[AuthProvider] Successfully acquired token`),e&&e.accessToken){console.log(`[AuthProvider] Decoding token`);let t=f(e.accessToken);if(console.log(`[AuthProvider] Token was valid`),t.roles)console.log(`[AuthProvider] Found roles`),S(t.roles);else throw Error(`Could not find roles in token`);w(`authorized`)}}catch(e){console.error(`[AuthProvider] Token error when trying to get roles!`,e),w(`unauthorized`)}};(async()=>{await e(),O?w(`authorized`):await n()})()},[t,F,P,I,j,w,x,S,O]),C===`unauthorized`?D??d(r,{}):T?e:C===`loading`||t===void 0?E??d(n,{variant:`application`}):e};export{b as AuthProviderInner};
1
+ import{auth as e,environment as t}from"../../atoms/utils/auth_environment.js";import{FullPageSpinner as n}from"../../molecules/FullPageSpinner/FullPageSpinner.js";import{MissingAccessToApp as r}from"../../organisms/Status/collections/MissingAccessToApp.js";import{useEffect as i,useRef as a,useState as o}from"react";import{useMsal as s,useMsalAuthentication as c}from"@azure/msal-react";import{InteractionRequiredAuthError as l,InteractionType as u}from"@azure/msal-browser";import{jsx as d}from"react/jsx-runtime";import{jwtDecode as f}from"jwt-decode";const{GRAPH_ENDPOINTS:p,GRAPH_REQUESTS_LOGIN:m,GRAPH_REQUESTS_PHOTO:h,GRAPH_REQUESTS_BACKEND:g,fetchMsGraph:_,isInIframe:v}=e,{getApiScope:y}=t,b=({children:e,account:t,setAccount:b,setPhoto:x,setRoles:S,authState:C,setAuthState:w,withoutLoader:T,loadingComponent:E,unauthorizedComponent:D,withoutBackend:O})=>{let{instance:k,accounts:A,inProgress:j}=s(),{login:M,result:N,error:P,acquireToken:F}=c(u.Silent,m),[I,L]=o(!1),R=a(!1);return i(()=>{if(I)return;let e=async()=>{console.log(`[AuthProvider] Initializing`),await k.initialize(),console.log(`[AuthProvider] Finished initializing`),L(!0)};e().catch(e=>{console.error(`[AuthProvider] Error during initialization`,e)})},[k,I]),i(()=>{I&&(P instanceof l&&!v()&&C!==`unauthorized`?(console.error(P),console.log(`[AuthProvider] No account found, need to login via. redirect`),M(u.Redirect,m).catch(e=>{console.error(`[AuthProvider] Error during login`,e)})):N?.account&&!t?(console.log(`[AuthProvider] Found account in useMsalAuth result, setting that one as active`),k.setActiveAccount(N.account),b(N.account)):A.length>0&&!t?(console.log(`[AuthProvider] Found account in accounts array, setting that one as active`),k.setActiveAccount(A[0]),b(A[0])):P&&console.error(`[AuthProvider] Unexpected error:`,P))},[t,A,P,k,I,M,N,b,C]),i(()=>{if(!t||!I||R.current||j!==`none`)return;R.current=!0;let e=async()=>{try{let e=await F(u.Silent,h);if(e){let t=await _(p.PHOTO,e.accessToken);if(t.status===404)return null;let n=await t.blob(),r=window.URL??window.webkitURL,i=r.createObjectURL(n);x(i)}}catch(e){console.error(e)}},n=async()=>{try{let e=await F(u.Silent,g(y(import.meta.env.VITE_API_SCOPE)));if(console.log(`[AuthProvider] Successfully acquired token`),e&&e.accessToken){console.log(`[AuthProvider] Decoding token`);let t=f(e.accessToken);if(console.log(`[AuthProvider] Token was valid`),t.roles)console.log(`[AuthProvider] Found roles`),S(t.roles);else throw Error(`Could not find roles in token`);w(`authorized`)}}catch(e){console.error(`[AuthProvider] Token error when trying to get roles!`,e),w(`unauthorized`)}},r=async()=>{await e(),O?w(`authorized`):await n()};r()},[t,F,P,I,j,w,x,S,O]),C===`unauthorized`?D??d(r,{}):T?e:C===`loading`||t===void 0?E??d(n,{variant:`application`}):e};export{b as AuthProviderInner};
@@ -1 +1 @@
1
- import{EnvironmentType as e}from"../atoms/enums/Environment.js";import{environment as t}from"../atoms/utils/auth_environment.js";import{useLocalStorage as n}from"../atoms/hooks/useLocalStorage.js";import{usingReleaseNoteDate as r}from"../organisms/ReleaseNote/ReleaseNote.utils.js";import{environmentAndAppNameToURL as i}from"../organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotesDialog.utils.js";import{sortReleaseNotesByDate as a}from"./ReleaseNotesProvider.utils.js";import{createContext as o,useContext as s,useEffect as c,useState as l}from"react";import{jsx as u}from"react/jsx-runtime";import{useReleaseNotesQuery as d}from"@equinor/subsurface-app-management";const{getEnvironmentName:f,getAppName:p}=t,m=o(void 0),h=()=>{let e=s(m);if(e===void 0)throw Error(`useReleaseNotes must be used within a ReleaseNotesProvider`);return e},g=1e3*60*60*24*14,_=({children:t,enabled:o,popUpNewReleaseNote:s=!1})=>{let{data:h}=d({enabled:o}),[_,v]=l(!1),[y,b]=n(`release-notes-was-viewed-key`,``,g),x=h?.toSorted(a).at(0),S=p(import.meta.env.VITE_NAME),C=f(import.meta.env.VITE_ENVIRONMENT_NAME),w=C===e.LOCALHOST?e.DEVELOP:C,T=i(w,S);return c(()=>{if(!x||!s)return;let e=new Date(r(x)).getTime();Date.now()-e<=g&&y!==x.releaseId&&(v(!0),b(x.releaseId))},[y,x,s,b]),u(m.Provider,{value:{open:_,setOpen:v,mostRecentReleaseNote:x,showAllReleaseNotesLink:T},children:t})};export{_ as ReleaseNotesProvider,h as useReleaseNotes};
1
+ import{EnvironmentType as e}from"../atoms/enums/Environment.js";import{environment as t}from"../atoms/utils/auth_environment.js";import{useLocalStorage as n}from"../atoms/hooks/useLocalStorage.js";import{usingReleaseNoteDate as r}from"../organisms/ReleaseNote/ReleaseNote.utils.js";import{environmentAndAppNameToURL as i}from"../organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotesDialog.utils.js";import{sortReleaseNotesByDate as a}from"./ReleaseNotesProvider.utils.js";import{createContext as o,useContext as s,useEffect as c,useState as l}from"react";import{jsx as u}from"react/jsx-runtime";import{useReleaseNotesQuery as d}from"@equinor/subsurface-app-management";const{getEnvironmentName:f,getAppName:p}=t,m=o(void 0),h=()=>{let e=s(m);if(e===void 0)throw Error(`useReleaseNotes must be used within a ReleaseNotesProvider`);return e},g=1e3*60*60*24*14,_=({children:t,enabled:o,popUpNewReleaseNote:s=!1})=>{let{data:h}=d({enabled:o}),[_,v]=l(!1),[y,b]=n(`release-notes-was-viewed-key`,``,g),x=h?.toSorted(a).at(0),S=p(import.meta.env.VITE_NAME),C=f(import.meta.env.VITE_ENVIRONMENT_NAME),w=C===e.LOCALHOST?e.DEVELOP:C,T=i(w,S);return c(()=>{if(!x||!s)return;let e=new Date(r(x)).getTime(),t=Date.now(),n=t-e;n<=g&&y!==x.releaseId&&(v(!0),b(x.releaseId))},[y,x,s,b]),u(m.Provider,{value:{open:_,setOpen:v,mostRecentReleaseNote:x,showAllReleaseNotesLink:T},children:t})};export{_ as ReleaseNotesProvider,h as useReleaseNotes};
@@ -1 +1 @@
1
- import{createContext as e,useContext as t,useReducer as n}from"react";import{jsx as r}from"react/jsx-runtime";function i(){let e=t(a);if(e===void 0)throw Error(`Sidebar hook must be used within Provider`);return e}const a=e(void 0),o=`amplify-sidebar-state`,s=()=>{let e=localStorage.getItem(o);return e?JSON.parse(e):{isOpen:!1}},c=e=>{localStorage.setItem(o,JSON.stringify(e))},l=(e,t)=>(c(t),t),u=({children:e})=>{let[t,i]=n(l,s());return r(a.Provider,{value:{isOpen:t.isOpen,setIsOpen:e=>{i({isOpen:e})}},children:e})};export{u as SideBarProvider,i as useSideBar};
1
+ import{createContext as e,useContext as t,useReducer as n}from"react";import{jsx as r}from"react/jsx-runtime";function i(){let e=t(a);if(e===void 0)throw Error(`Sidebar hook must be used within Provider`);return e}const a=e(void 0),o=`amplify-sidebar-state`,s=()=>{let e=localStorage.getItem(o);return e?JSON.parse(e):{isOpen:!1}},c=e=>{localStorage.setItem(o,JSON.stringify(e))},l=(e,t)=>(c(t),t),u=({children:e})=>{let[t,i]=n(l,s()),o=e=>{i({isOpen:e})};return r(a.Provider,{value:{isOpen:t.isOpen,setIsOpen:o},children:e})};export{u as SideBarProvider,i as useSideBar};