@equinor/amplify-component-lib 12.0.4 → 12.0.6
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/dist/atoms/hooks/useAmplifyKit.js +1 -1
- package/dist/atoms/hooks/useSelect.d.ts +3 -3
- package/dist/atoms/utils/auth_environment.js +1 -1
- package/dist/atoms/utils/richtext.js +2 -2
- package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
- package/dist/deprecated/IconToggleButton.d.ts +2 -2
- package/dist/molecules/DatePicker/DatePicker.d.ts +3 -3
- package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/dist/molecules/Dialog/Dialog.d.ts +2 -2
- package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
- package/dist/molecules/IconCell/IconCell.js +1 -1
- package/dist/molecules/IconCell/IconCell.utils.js +2 -2
- package/dist/molecules/ListItem/ListItem.d.ts +2 -2
- package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +4 -4
- package/dist/molecules/ProfileAvatar/ProfileAvatar.d.ts +2 -2
- package/dist/molecules/RichTextEditor/MenuBar/AddImageButton.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/Table/Table.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextAlignment.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextClearFormatting.js +3 -3
- package/dist/molecules/RichTextEditor/MenuBar/TextCode.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextColor.js +14 -14
- package/dist/molecules/RichTextEditor/MenuBar/TextFormatting.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextHeaders.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextHighlight.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextHistory.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextLinks.js +4 -4
- package/dist/molecules/RichTextEditor/MenuBar/TextLists.js +1 -1
- package/dist/molecules/RichTextEditor/RichTextEditor.types.js +1 -1
- package/dist/molecules/Search/Search.d.ts +2 -2
- package/dist/molecules/SelectionControls/Checkbox/Checkbox.d.ts +2 -2
- package/dist/molecules/SelectionControls/Radio/Radio.d.ts +2 -2
- package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.d.ts +2 -2
- package/dist/molecules/TableHeader/TableHeader.js +1 -1
- package/dist/molecules/Tag/Tag.js +1 -1
- package/dist/molecules/TextField/TextField.js +6 -0
- package/dist/organisms/Status/collections/BadRequest.d.ts +2 -2
- package/dist/organisms/Status/collections/GenericError.d.ts +2 -2
- package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
- package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
- package/dist/organisms/TopBar/Account/Account.js +1 -1
- package/dist/organisms/TopBar/Notifications/FilterOptions.js +17 -17
- package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
- package/dist/organisms/TopBar/Notifications/NotificationsInner.js +3 -3
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationElements/DefaultNotification.js +2 -2
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationElements/ReadyToReportNotification.js +6 -6
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationElements/RequestReviewOrca.js +4 -4
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationTemplate.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/Feedback.const.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/Feedback.types.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/Feedback.utils.js +5 -5
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/Description.js +3 -3
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/FeedbackForm.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/RequestStatus.js +2 -2
- package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/ResponseStatus.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/Success.js +4 -4
- package/dist/organisms/TopBar/Resources/Feedback/providers/FeedbackContextProvider.js +1 -1
- package/dist/organisms/TopBar/Resources/Resources.js +3 -3
- package/dist/organisms/TopBar/Settings.js +4 -4
- package/dist/organisms/TopBar/TopBar.js +1 -1
- package/dist/organisms/TopBar/TopBar.styles.js +25 -25
- package/dist/providers/SurveyProvider/SurveyDialog/SurveyDialog.js +1 -1
- package/dist/providers/SurveyProvider/SurveyProvider.js +1 -1
- package/dist/providers/ThemeProvider/ThemeProvider.js +1 -1
- package/package.json +3 -3
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/Notifications.types.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"../../../atoms/enums/Environment.js";import{environment as e}from"../../../atoms/utils/auth_environment.js";import{useAuth as t}from"../../../providers/AuthProvider/AuthProvider.js";import{useLocalStorage as n}from"../../../atoms/hooks/useLocalStorage.js";import{Button as r}from"../../../molecules/Button/Button.js";import{TopBarMenu as i}from"../TopBarMenu.js";import{useActiveImpersonationUser as a}from"./ImpersonateMenu/hooks/useActiveImpersonationUser.js";import{useCanImpersonate as o}from"./ImpersonateMenu/hooks/useCanImpersonate.js";import{useMappedRoles as s}from"./ImpersonateMenu/hooks/useMappedRoles.js";import{useStopImpersonation as c}from"./ImpersonateMenu/hooks/useStopImpersonation.js";import{ButtonWrapper as ee,Container as l,EnvironmentToggleWrapper as te,TextContent as u}from"./Account.styles.js";import{impersonateUserDtoToFullName as d}from"./ImpersonateMenu/Impersonate.utils.js";import{ImpersonateMenu as f}from"./ImpersonateMenu/ImpersonateMenu.js";import{AccountAvatar as ne}from"./AccountAvatar.js";import{AccountButton as p}from"./AccountButton.js";import{ActiveUserImpersonationButton as m}from"./ActiveUserImpersonationButton.js";import{ImpersonateButton as h}from"./ImpersonateButton.js";import{RoleList as g}from"./RoleList.js";import{EnvironmentToggle as re}from"./EnvironmentToggle.js";import{StatusChips as _}from"./StatusChips.js";import{useCallback as ie,useEffect as ae,useMemo as v,useRef as y,useState as b}from"react";import{Icon as x,Typography as S}from"@equinor/eds-core-react";import{Fragment as C,jsx as w,jsxs as T}from"react/jsx-runtime";import{log_out as E}from"@equinor/eds-icons";import{ENVIRONMENT_TOGGLE_KEY as D}from"@equinor/subsurface-app-management";const O=({renderCustomButton:O,hideRoles:k=!1,useDisplayNameForRole:A=!1,children:j,enableEnvironmentToggle:M=!1,onImpersonateChange:N})=>{let P=e.getEnvironmentName(import.meta.env.VITE_ENVIRONMENT_NAME),F=e.getApiClientId(import.meta.env.VITE_API_CLIENT_ID),I=e.getAppName(import.meta.env.VITE_NAME),{account:L,roles:R,logout:z}=t(),[B,V]=b(!1),[H,U]=b(!1),[W,G]=n(D,[]),K=y(null),{data:q=!0}=o(),{data:J}=a(),{mutate:Y}=c(),X=s(J?J.roles:R??[],A),oe=J?d(J):L?.name,se=J?J.uniqueName:L?.username,Z=()=>V(!1),Q=ie(()=>{V(e=>!e),U(!1)},[]),$=()=>{U(!0),V(!1)};return ae(()=>{J&&J.appName!=null&&J.appName.toUpperCase()!=I.toUpperCase()&&Y()},[J,I,Y]),T(C,{children:[v(()=>O?O(K,Q):null,[O,Q])||w(p,{ref:K,onClick:Q,environmentToggle:W}),T(i,{open:B,title:`Account`,onClose:Z,anchorEl:K.current,children:[T(l,{children:[J&&w(m,{onClick:$}),w(ne,{environmentToggle:W}),T(u,{children:[w(S,{variant:`h6`,children:oe}),w(S,{children:se})]}),W.length>0&&w(_,{statuses:W}),X&&!k&&w(C,{children:X.length<=3?w(_,{statuses:X}):w(g,{roles:X})}),j,q&&P!==`production`&&F&&w(h,{onOpenImpersonateMenu:$,onClose:Z,onImpersonateChange:N})]}),M&&P!==`production`&&w(te,{children:w(re,{setEnvironmentToggle:G,environmentToggle:W})}),w(ee,{children:T(r,{variant:`ghost`,onClick:z,children:[w(x,{data:E}),`Log out`]})})]}),w(f,{open:H,onClose:()=>U(!1),anchorEl:K.current,onImpersonateChange:N})]})};O.displayName=`TopBar.Account`;export{O as Account};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import{tokens as e}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{
|
|
1
|
+
import{tokens as e}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{useRef as t,useState as n}from"react";import{Icon as r,Menu as i,Typography as a}from"@equinor/eds-core-react";import o from"styled-components";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{checkbox as u,checkbox_outline as d,filter_list as f,sort as p}from"@equinor/eds-icons";const{spacings:m,colors:h,shape:g}=e,_=o(i.Item)`
|
|
2
2
|
display: flex;
|
|
3
|
-
`,
|
|
3
|
+
`,v=o.div`
|
|
4
4
|
display: flex;
|
|
5
|
-
gap: ${
|
|
6
|
-
padding: ${
|
|
7
|
-
`,
|
|
8
|
-
padding: ${
|
|
9
|
-
`,
|
|
10
|
-
padding: ${
|
|
11
|
-
`,
|
|
5
|
+
gap: ${m.comfortable.small};
|
|
6
|
+
padding: ${m.comfortable.medium};
|
|
7
|
+
`,y=o(i)`
|
|
8
|
+
padding: ${m.comfortable.small} 0;
|
|
9
|
+
`,b=o.div`
|
|
10
|
+
padding: ${m.comfortable.small} ${m.comfortable.large};
|
|
11
|
+
`,x=o.span`
|
|
12
12
|
font-family: 'Equionor', sans-serif;
|
|
13
13
|
font-size: 12px;
|
|
14
|
-
border-radius: ${
|
|
15
|
-
border: ${({$active:e})=>e?`solid 1px ${
|
|
16
|
-
background-color: ${({$active:e})=>e?
|
|
14
|
+
border-radius: ${g.rounded.borderRadius};
|
|
15
|
+
border: ${({$active:e})=>e?`solid 1px ${h.interactive.primary__selected_hover.rgba}`:`solid 1px ${h.ui.background__medium.rgba}`};
|
|
16
|
+
background-color: ${({$active:e})=>e?h.interactive.primary__selected_highlight.rgba:h.ui.background__default.rgba};
|
|
17
17
|
color: black;
|
|
18
|
-
padding: ${
|
|
18
|
+
padding: ${m.comfortable.x_small} ${m.comfortable.small};
|
|
19
19
|
display: flex;
|
|
20
20
|
flex-direction: row;
|
|
21
21
|
align-items: center;
|
|
22
|
-
grid-gap: ${
|
|
22
|
+
grid-gap: ${m.comfortable.small};
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
&:hover {
|
|
25
|
-
background: ${
|
|
25
|
+
background: ${h.interactive.primary__selected_highlight.rgba};
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
> p {
|
|
@@ -31,6 +31,6 @@ import{tokens as e}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/
|
|
|
31
31
|
font-size: 12px;
|
|
32
32
|
}
|
|
33
33
|
> svg {
|
|
34
|
-
color: ${({$active:e})=>e?
|
|
34
|
+
color: ${({$active:e})=>e?h.text.static_icons__default.rgba:h.interactive.primary__resting.rgba};
|
|
35
35
|
}
|
|
36
|
-
`,
|
|
36
|
+
`,S=({onFilter:e,onSort:i,sortMenuRef:o,filterMenuRef:m})=>{let[h,g]=n(!1),[S,C]=n(!1),w=t(null),T=t(null),[E,D]=n({unread:!1,oldtonew:!1,newtoold:!1}),[O,k]=n({systemUser:!1,user:!1,unread:!1}),A=()=>{g(!0),C(!1)},j=()=>{g(!1)},M=()=>{C(!0),g(!1)},N=()=>{C(!1)},P=t=>{e(O[t]?[]:[t]),k(e=>({...e,[t]:!e[t]}))},F=e=>{i(E[e]?[]:[e]),D(t=>({...t,[e]:!t[e]}))};return l(s,{children:[l(v,{children:[l(x,{onClick:()=>h?j():A(),ref:w,$active:h,children:[c(a,{group:`ui`,variant:`chip__badge`,children:`Filter by`}),c(r,{data:f,size:16})]}),l(x,{onClick:()=>S?N():M(),ref:T,$active:S,children:[c(a,{group:`ui`,variant:`chip__badge`,children:`Sort by`}),c(r,{data:p,size:16})]})]}),h&&l(y,{open:h,anchorEl:w.current,placement:`bottom-start`,ref:m,onClose:j,children:[c(b,{children:c(a,{group:`navigation`,variant:`label`,children:`Filter notifications`})}),l(_,{onClick:()=>P(`user`),closeMenuOnClick:!1,children:[c(r,{data:O.user?u:d}),c(a,{children:` User messages `})]}),l(_,{onClick:()=>P(`systemUser`),closeMenuOnClick:!1,children:[c(r,{data:O.systemUser?u:d}),c(a,{children:` System messages `})]}),l(_,{onClick:()=>P(`unread`),closeMenuOnClick:!1,children:[c(r,{data:O.unread?u:d}),c(a,{children:` Unread `})]})]}),S&&l(y,{open:S,anchorEl:T.current,placement:`bottom-start`,ref:o,onClose:N,children:[c(b,{children:c(a,{group:`navigation`,variant:`label`,children:`Sort notifications`})}),l(_,{onClick:()=>F(`newtoold`),closeMenuOnClick:!1,children:[c(r,{data:E.newtoold?u:d}),c(a,{children:` Newest to oldest `})]}),l(_,{onClick:()=>F(`oldtonew`),closeMenuOnClick:!1,children:[c(r,{data:E.oldtonew?u:d}),c(a,{children:` Oldest to newest `})]}),l(_,{onClick:()=>F(`unread`),closeMenuOnClick:!1,children:[c(r,{data:E.unread?u:d}),c(a,{children:` Unread`})]})]})]})};export{S as FilterOptions};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react211 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:
|
|
9
|
+
declare const NotificationContext: react211.Context<NotificationContext | undefined>;
|
|
10
10
|
declare const useNotification: () => NotificationContext;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { useNotification };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{useNotification as e}from"./NotificationProvider.js";import{TopBarMenu as t}from"../TopBarMenu.js";import{TopBarButton as n,UnreadRedDot as r}from"../TopBar.styles.js";import{NoNotifications as i}from"./NotificationsTemplate/NotificationElements/NoNotifications.js";import{
|
|
1
|
+
import{useNotification as e}from"./NotificationProvider.js";import{TopBarMenu as t}from"../TopBarMenu.js";import{TopBarButton as n,UnreadRedDot as r}from"../TopBar.styles.js";import{NoNotifications as i}from"./NotificationsTemplate/NotificationElements/NoNotifications.js";import{NotificationTemplate as a}from"./NotificationsTemplate/NotificationTemplate.js";import{FilterOptions as o}from"./FilterOptions.js";import{useMemo as s,useRef as c,useState as l}from"react";import{Icon as u}from"@equinor/eds-core-react";import d from"styled-components";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{notifications as h}from"@equinor/eds-icons";const g=d.div`
|
|
2
2
|
display: flex;
|
|
3
|
-
`,
|
|
3
|
+
`,_=d.div`
|
|
4
4
|
overflow: auto;
|
|
5
5
|
height: fit-content;
|
|
6
6
|
max-height: 66vh;
|
|
7
7
|
width: 350px;
|
|
8
|
-
`,
|
|
8
|
+
`,v=({children:d,hasUnread:v=!1,setAllAsRead:y,showFilterOptions:b=!1,notifications:x})=>{let S=c(null),C=c(null),w=c(null),{isOpen:T,setIsOpen:E}=e(),[D,O]=l([]),[k,A]=l([]),j=s(()=>{if(!x)return[];let e=[...x];return D.length>0&&(e=e.filter(e=>{if(D.includes(`unread`))return!e.Read;if(D.includes(`user`))return e.user;if(D.includes(`systemUser`))return!e.user})),k.length>0&&(e=e.sort((e,t)=>{let n=new Date(e.time).getTime(),r=new Date(t.time).getTime();return k.includes(`oldtonew`)?r-n:k.includes(`unread`)?e.Read===t.Read?0:e.Read?1:-1:n-r})),e},[D,x,k]),M=()=>{T?N():E(!0)},N=()=>{y(),E(!1)};return m(f,{children:[m(n,{variant:`ghost_icon`,ref:S,onClick:M,"data-testid":`show-hide-button`,children:[p(u,{data:h,size:24}),v&&p(r,{"data-testid":`unread-dot`})]},`topbar-notifications`),m(t,{open:T,anchorEl:S.current,contentPadding:!1,isNotification:!0,onClose:N,children:[b&&p(g,{children:p(o,{onFilter:O,onSort:A,sortMenuRef:w,filterMenuRef:C})}),d?p(_,{children:d instanceof Function?d({onClose:N}):d}):p(_,{children:j&&j?.length>0?j.map(e=>p(a,{...e},e.SequenceNumber)):p(i,{})})]})]})};v.displayName=`TopBar.NotificationsInner`;export{v as NotificationsInner};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{spacings as e}from"../../../../../atoms/style/spacings.js";import{
|
|
1
|
+
import{spacings as e}from"../../../../../atoms/style/spacings.js";import{Typography as t}from"@equinor/eds-core-react";import n from"styled-components";import{jsx as r}from"react/jsx-runtime";const i=n.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: ${e.medium};
|
|
5
5
|
padding-top: ${e.medium_small};
|
|
6
|
-
`,
|
|
6
|
+
`,a=({message:e})=>r(i,{"data-testid":`default`,children:r(t,{group:`table`,variant:`cell_text`,children:e})});export{a as DefaultNotification};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{tokens as e}from"../../../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{
|
|
1
|
+
import{tokens as e}from"../../../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{Chip as t,Tooltip as n,Typography as r}from"@equinor/eds-core-react";import i from"styled-components";import{jsx as a,jsxs as o}from"react/jsx-runtime";const{spacings:s}=e,c=i.div`
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: 1fr 1fr;
|
|
4
|
-
gap: ${
|
|
5
|
-
padding-top: ${
|
|
6
|
-
`,
|
|
4
|
+
gap: ${s.comfortable.medium};
|
|
5
|
+
padding-top: ${s.comfortable.medium_small};
|
|
6
|
+
`,l=i.div`
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
|
-
`,
|
|
9
|
+
`,u=i.div`
|
|
10
10
|
grid-column: span 3;
|
|
11
11
|
display: flex;
|
|
12
12
|
gap: 5px;
|
|
13
13
|
align-items: center;
|
|
14
|
-
`,
|
|
14
|
+
`,d=({field:e,wellbore:i,dataType:s,onClick:d})=>a(n,{title:`Go to ${s}`,children:o(c,{onClick:d,"data-testid":`readytoreport`,children:[o(l,{children:[a(r,{group:`paragraph`,variant:`overline`,children:`Field`}),a(r,{group:`table`,variant:`cell_text`,children:e})]}),o(l,{children:[a(r,{group:`paragraph`,variant:`overline`,children:`WELLBORE`}),a(r,{group:`table`,variant:`cell_text`,children:i})]}),o(u,{children:[o(t,{children:[` `,s,` `]}),a(r,{group:`navigation`,variant:`label`,children:`is ready to report`})]})]})});export{d as ReadyToReportNotification};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{tokens as e}from"../../../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{OptionalTooltip as t}from"../../../../../molecules/OptionalTooltip/OptionalTooltip.js";import{
|
|
1
|
+
import{tokens as e}from"../../../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{OptionalTooltip as t}from"../../../../../molecules/OptionalTooltip/OptionalTooltip.js";import{Tooltip as n,Typography as r}from"@equinor/eds-core-react";import i from"styled-components";import{jsx as a,jsxs as o}from"react/jsx-runtime";const{spacings:s}=e,c=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
|
-
gap: ${
|
|
5
|
-
padding-top: ${
|
|
4
|
+
gap: ${s.comfortable.medium};
|
|
5
|
+
padding-top: ${s.comfortable.medium_small};
|
|
6
6
|
cursor: pointer;
|
|
7
|
-
`,
|
|
7
|
+
`,l=({fromUser:e,branchName:i,onClick:s})=>a(n,{title:`Go to ${i}`,children:a(c,{onClick:s,"data-testid":`requestReview`,children:a(t,{title:`Go to ${i}`,children:o(r,{group:`table`,variant:`cell_text`,children:[e.displayName,` has requested review for branch `,i]})})})});export{l as RequestReviewOrca};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{tokens as e}from"../../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{formatRelativeDateTime as t}from"../../../../atoms/utils/date.js";import{ApplicationIcon as n}from"../../../../molecules/ApplicationIcon/ApplicationIcon.js";import{OptionalTooltip as r}from"../../../../molecules/OptionalTooltip/OptionalTooltip.js";import{ProfileAvatar as i}from"../../../../molecules/ProfileAvatar/ProfileAvatar.js";import{
|
|
1
|
+
import{tokens as e}from"../../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{formatRelativeDateTime as t}from"../../../../atoms/utils/date.js";import{ApplicationIcon as n}from"../../../../molecules/ApplicationIcon/ApplicationIcon.js";import{OptionalTooltip as r}from"../../../../molecules/OptionalTooltip/OptionalTooltip.js";import{ProfileAvatar as i}from"../../../../molecules/ProfileAvatar/ProfileAvatar.js";import{DefaultNotification as a}from"./NotificationElements/DefaultNotification.js";import{ExperienceDue3Weeks as o}from"./NotificationElements/ExperienceDue3Weeks.js";import{MergedBranchOrca as s}from"./NotificationElements/MergedBranchOrca.js";import{ReadyToBePublished as c}from"./NotificationElements/ReadyToBePublished.js";import{ReadyToReportNotification as l}from"./NotificationElements/ReadyToReportNotification.js";import{RequestChangeOrca as u}from"./NotificationElements/RequestChangeOrca.js";import{RequestReviewOrca as d}from"./NotificationElements/RequestReviewOrca.js";import{ReviewQANotification as f}from"./NotificationElements/ReviewQANotification.js";import{Content as p,DeleteButton as m,Divider as h,Dot as g,FooterContainer as _,GridContainer as v,TopContainer as y,UserInformation as b,Wrapper as x}from"./NotificationTemplate.style.js";import{useMemo as S}from"react";import{Icon as C,Typography as w}from"@equinor/eds-core-react";import{Fragment as T,jsx as E,jsxs as D}from"react/jsx-runtime";import{delete_to_trash as O}from"@equinor/eds-icons";const{colors:k}=e,A=e=>{let{user:A,notificationType:j,applicationName:M,Read:N,field:P,time:F,footer:I=!0,onDelete:L}=e,R=S(()=>{switch(j){case`readytoreport`:return E(l,{...e});case`default`:return E(a,{...e});case`requestReview`:return E(d,{...e});case`requestedChanges`:return E(u,{...e});case`mergeBranch`:return E(s,{...e});case` TaskInReview`:return E(f,{...e});case`WellReadyForPublishing `:return E(c,{...e});case`WellDueForReport`:return E(o,{...e})}},[e,j]);return D(T,{children:[E(x,{children:D(v,{children:[D(y,{children:[A?D(b,{children:[!N&&E(g,{}),E(i,{url:A?.image,name:A?.shortName,size:`large`}),D(`div`,{children:[E(w,{color:k.text.static_icons__default.rgba,group:`heading`,variant:`h6`,children:A?.displayName}),E(w,{group:`paragraph`,variant:`caption`,color:k.text.static_icons__secondary.rgba,children:A?.shortName})]})]}):D(b,{$systemUser:!0,children:[!N&&E(g,{"data-testid":`unread-dot-system`}),E(n,{name:M}),E(w,{group:`heading`,variant:`h6`,children:M})]}),E(w,{group:`navigation`,variant:`label`,color:N?k.text.static_icons__secondary.rgba:k.infographic.substitute__blue_overcast.rgba,"data-testid":`notification-date`,children:t(F)})]}),E(p,{children:R}),I&&D(_,{children:[D(`div`,{style:{display:`flex`,gap:`5px`},children:[E(w,{group:`navigation`,variant:`label`,color:k.text.static_icons__tertiary.rgba,children:M}),E(w,{group:`navigation`,variant:`label`,color:k.text.static_icons__tertiary.rgba,children:P})]}),E(r,{title:`Delete notification`,children:E(m,{onClick:L,variant:`ghost_icon`,children:E(C,{data:O})})})]})]})}),E(h,{})]})};export{A as NotificationTemplate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=1048575,t=`serviceNowIncident`,n=`slackPostMessage`,r=`slackFileUpload`,i=`.equinor.com`,a=`There was an error with the request`,o=1e3*60*60,s={feedbackContent:{title:``,description:``,url:``,urgency:``},serviceNowRequestResponse:{status:`idle`}};export{s as DEFAULT_FEEDBACK_LOCAL_STORAGE,a as DEFAULT_REQUEST_ERROR_MESSAGE,i as EQUINOR_EMAIL_SUFFIX,e as MAX_FILE_SIZE_BYTES,o as ONE_HOUR_IN_MS,t as SERVICE_NOW_QUERY_KEY,r as SLACK_FILE_QUERY_KEY,n as SLACK_POST_QUERY_KEY};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let e=function(e){return e.NO_IMPACT=`I am not impacted`,e.IMPEDES=`It impedes my progress`,e.UNABLE=`I am unable to work`,e}({})
|
|
1
|
+
let e=function(e){return e.NO_IMPACT=`I am not impacted`,e.IMPEDES=`It impedes my progress`,e.UNABLE=`I am unable to work`,e}({});export{e as UrgencyOption};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"../../../../atoms/enums/Environment.js";import{environment as e}from"../../../../atoms/utils/auth_environment.js";import{formatDate as t}from"../../../../atoms/utils/date.js";import{capitalize as n}from"../../../../atoms/utils/string.js";import"./Feedback.types.js";import{ServiceNowUrgency as r}from"@equinor/subsurface-app-management";const{getAppName:i,getEnvironmentName:a}=e,o=e=>e.urgency===`I am not impacted`?`:large_yellow_circle:`:e.urgency===`It impedes my progress`?`:large_orange_circle:`:`:red_circle:`,s=e=>{let t=new FileReader;return new Promise((n,r)=>{t.onerror=()=>{t.abort(),r(new DOMException(`Problem parsing input file.`))},t.onload=()=>{n(t.result)},t.readAsDataURL(e)})},c=e=>{switch(e){case`I am unable to work`:return r.NORMAL;case`It impedes my progress`:return r.NORMAL;case`I am not impacted`:return r.NORMAL}},l=(e,t)=>{let r=`Url location of bug: ${e.url} \n`,i=`Severity of bug: ${e.urgency} \n`,a=`Field: ${n(t??``)} \n`,o=`Browser: ${p()} \n`;return`${e.url?r:``}
|
|
2
2
|
${e.urgency?i:``}
|
|
3
3
|
${t?a:``}
|
|
4
4
|
${o}
|
|
5
|
-
${e.description} \n \n User agent string: ${navigator.userAgent}`},
|
|
6
|
-
`+
|
|
7
|
-
`+
|
|
8
|
-
`+e.description}}];return
|
|
5
|
+
${e.description} \n \n User agent string: ${navigator.userAgent}`},u=(e,t)=>{let n=t?`selfservice?id=ticket&table=incident&sys_id=`:`now/nav/ui/classic/params/target/incident.do%3Fsys_id%3D`;return`https://equinor${a(import.meta.env.VITE_ENVIRONMENT_NAME)===`production`?``:`test`}.service-now.com/${n}${e}`},d=()=>{if(navigator.userAgent.includes(`Edg`))return`Edge`;if(navigator.userAgent.includes(`Chrome`))return`Chrome`;if(navigator.userAgent.includes(`Safari`))return`Safari`;if(navigator.userAgent.includes(`Firefox`))return`Firefox`},f=e=>{let t=e;e===`Edge`&&(t=`Edg`);let n=RegExp(`${t}/(\\d+(?:\\.\\d+)+)`);return navigator.userAgent.match(n)?.[1]},p=()=>{let e=d();return e?`${e} (${f(e)})`:`Not found`},m=(e,r,a,s,c)=>{let l=a===`bug`?`:bug: Bug report`:`:bulb: Suggestion`,d=[],f=[];f.push({type:`mrkdwn`,text:`*Title* \n ${e.title}`}),d.push({type:`mrkdwn`,text:` ${t(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 ${o(e)} ${e.urgency}`});let m=[{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*
|
|
6
|
+
`+i(import.meta.env.VITE_NAME)},{type:`mrkdwn`,text:`*User* \n ${s}`}]},{type:`section`,fields:[{type:`mrkdwn`,text:`*Browser*
|
|
7
|
+
`+p()},{type:`mrkdwn`,text:`*Field* \n ${n(r??`Not found`)}`}]},{type:`section`,text:{type:`mrkdwn`,text:`*Description*
|
|
8
|
+
`+e.description}}];return c&&m.push({type:`section`,text:{type:`mrkdwn`,text:`*<${u(c)}|:link: Click to open the ticket in Service Now>*`}}),m.push({type:`divider`}),JSON.stringify(m)};export{l as createServiceNowDescription,u as createServiceNowUrl,m as createSlackMessage,c as getUrgencyNumber,s as readUploadedFileAsText};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{tokens as e}from"../../../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{spacings as t}from"../../../../../atoms/style/spacings.js";import{TextField as n}from"../../../../../molecules/TextField/TextField.js";import{
|
|
1
|
+
import{tokens as e}from"../../../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{spacings as t}from"../../../../../atoms/style/spacings.js";import{TextField as n}from"../../../../../molecules/TextField/TextField.js";import{useFeedbackContext as r}from"../hooks/useFeedbackContext.js";import{LockedInputTooltip as i}from"./LockedInputTooltip.js";import{useMemo as a}from"react";import{Typography as o}from"@equinor/eds-core-react";import s from"styled-components";import{jsx as c,jsxs as l}from"react/jsx-runtime";const{colors:u}=e,d=s.div`
|
|
2
2
|
grid-column: 1/3;
|
|
3
3
|
display: flex;
|
|
4
4
|
gap: ${t.medium};
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
textarea {
|
|
7
|
-
color: ${
|
|
7
|
+
color: ${u.text.static_icons__default.rgba};
|
|
8
8
|
}
|
|
9
|
-
`,
|
|
9
|
+
`,f=()=>{let{serviceNowSuccess:e,feedbackContent:t,selectedType:s,updateFeedback:f}=r(),p=a(()=>e?u.interactive.disabled__text.rgba:u.text.static_icons__default.rgba,[e]);return l(d,{children:[s===`bug`&&l(`div`,{children:[c(o,{group:`input`,variant:`text`,color:p,children:`What is the specific bug?`}),c(o,{group:`input`,variant:`text`,color:p,children:`What are the expected results?`}),c(o,{group:`input`,variant:`text`,color:p,children:`How can we reproduce the issue?`}),c(o,{group:`input`,variant:`text`,color:p,children:`Is there a known workaround?`})]}),c(i,{show:e,children:c(n,{id:`feedback-description`,label:`Description`,disabled:e,meta:`Required`,value:t.description,placeholder:s===`bug`?`Describe the bug, including expectations, reproductions steps, any workarounds...`:`Describe the feature. What would be the value for you?`,rows:4,onChange:e=>f(`description`,e.currentTarget.value),multiline:!0})})]})};export{f as Description};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useFeedbackContext as e}from"../hooks/useFeedbackContext.js";import{UploadFile as t}from"./UploadFile/UploadFile.js";import{Description as n}from"./Description.js";import r from"./Severity.js";import{Title as i}from"./Title.js";import{Url as a}from"./Url.js";import{Actions as o,Container as s,ContentWrapper as c,LockedFormWarning as l,ReportLocationText as u,UploadInfo as d}from"../Feedback.styles.js";import{useMemo as f}from"react";import{Button as p,Icon as m,Typography as h}from"@equinor/eds-core-react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{info_circle as y}from"@equinor/eds-icons";const b=()=>{let{isWrongDomain:b,selectedType:x,resetForm:S,feedbackContent:C,onDialogClose:w,serviceNowSuccess:T,handleSave:E,requestIsLoading:D}=e(),O=f(()=>C.title.length>0&&C.description.length>0&&!b,[C.title.length,C.description.length,b]);return _(c,{children:v(s,{children:[_(i,{}),x===`bug`&&v(g,{children:[_(r,{}),_(a,{})]}),_(n,{}),v(d,{children:[_(m,{data:y}),_(h,{children:`Please make sure the uploaded files do not contain confidential or personal information`})]}),_(t,{}),_(u,{children:x===`bug`?`Bug reports are sent to Service Now and to the development team directly`:`Feature suggestions are sent to the development team directly`}),T&&v(l,{children:[_(m,{data:y}),_(h,{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.`})]}),v(o,{children:[_(p,{variant:`ghost`,onClick:S,"data-testid":`reset-form-button`,children:`Reset form`}),v(`div`,{children:[_(p,{variant:`ghost`,onClick:w,children:`Cancel`}),_(p,{onClick:E,disabled:!O||D,"data-testid":`submit-button`,children:T?`Send again`:`Send`})]})]})]})})};export{b as FeedbackForm};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{tokens as e}from"../../../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import
|
|
1
|
+
import{tokens as e}from"../../../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import"../Feedback.const.js";import{Status as t}from"./ResponsePage.styles.js";import{useMemo as n}from"react";import{Icon as r,Typography as i}from"@equinor/eds-core-react";import a from"styled-components";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{check_circle_outlined as c,info_circle as l}from"@equinor/eds-icons";const{colors:u}=e,d=a.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: space-between;
|
|
5
|
-
`,
|
|
5
|
+
`,f=({requestStatus:e,title:a})=>{let f=n(()=>{switch(e.status){case`partial`:return`Partially Failed`;case`idle`:case`pending`:return`Sending...`;case`success`:return`Success`;default:return``}},[e]),p=e.status===`partial`||e.status===`error`;return s(d,{children:[o(i,{group:`ui`,variant:`accordion_header`,children:a}),s(t,{children:[o(i,{color:p?u.interactive.warning__text.rgba:``,group:`ui`,variant:`snackbar`,children:e.status===`error`?e.errorText??`There was an error with the request`:f}),(p||e.status===`success`)&&o(r,{color:p?u.interactive.warning__text.rgba:u.interactive.success__resting.rgba,data:p?l:c})]})]})};export{f as RequestStatus};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useFeedbackContext as e}from"../hooks/useFeedbackContext.js";import{RequestStatus as t}from"./RequestStatus.js";import{FullSlackResponse as n}from"./FullSlackResponse.js";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";const o=()=>{let{serviceNowRequestResponse:o,selectedType:s,showAllSlackRequests:c,allSlackRequestStatus:l}=e();return a(r,{children:[s===`bug`&&i(t,{title:`Service Now`,requestStatus:o}),c?i(n,{allSlackRequestStatus:{status:l}}):i(t,{title:`Development team`,requestStatus:{status:l}})]})};export{o as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{tokens as e}from"../../../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{spacings as t}from"../../../../../atoms/style/spacings.js";import{
|
|
1
|
+
import{tokens as e}from"../../../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{spacings as t}from"../../../../../atoms/style/spacings.js";import{useFeedbackContext as n}from"../hooks/useFeedbackContext.js";import{Typography as r}from"@equinor/eds-core-react";import i from"styled-components";import{jsx as a,jsxs as o}from"react/jsx-runtime";const{colors:s}=e,c=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
`,
|
|
5
|
-
color: ${
|
|
4
|
+
`,l=i.a`
|
|
5
|
+
color: ${s.interactive.primary__resting.rgba};
|
|
6
6
|
padding-left: ${t.large};
|
|
7
7
|
font-weight: 400;
|
|
8
8
|
font-size: 16px;
|
|
9
|
-
`,
|
|
9
|
+
`,u=()=>{let{selectedType:e,serviceNowUrl:t}=n();return o(c,{children:[a(r,{variant:`h3`,children:`Thank you, we have received your ${e===`bug`?`report!`:`suggestion!`}`}),e===`bug`&&t.length>0&&a(l,{href:t,children:`See ticket in ServiceNow`})]})};export{u as Success};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{environment as e}from"../../../../../atoms/utils/auth_environment.js";import{useAuth as t}from"../../../../../providers/AuthProvider/AuthProvider.js";import{useLocalStorage as n}from"../../../../../atoms/hooks/useLocalStorage.js";import{useTopBarInternalContext as r}from"../../../TopBarInternalContextProvider.js";import{
|
|
1
|
+
import{environment as e}from"../../../../../atoms/utils/auth_environment.js";import{useAuth as t}from"../../../../../providers/AuthProvider/AuthProvider.js";import{useLocalStorage as n}from"../../../../../atoms/hooks/useLocalStorage.js";import{useTopBarInternalContext as r}from"../../../TopBarInternalContextProvider.js";import{DEFAULT_FEEDBACK_LOCAL_STORAGE as i,ONE_HOUR_IN_MS as a}from"../Feedback.const.js";import{createServiceNowDescription as ee,createServiceNowUrl as o,createSlackMessage as s,getUrgencyNumber as c}from"../Feedback.utils.js";import{useServiceNowIncident as te}from"../hooks/useServiceNowIncident.js";import{useSlackFileUpload as l}from"../hooks/useSlackFileUpload.js";import{useSlackPostMessage as u}from"../hooks/useSlackPostMessage.js";import{createContext as d,useCallback as f,useEffect as p,useMemo as m,useState as h}from"react";import{jsx as ne}from"react/jsx-runtime";const{getServiceNowConfigurationItem:re}=e,g=d(void 0),_=({children:e,selectedType:d,onClose:_})=>{let{selectedField:v}=r(),y=re(import.meta.env.VITE_SERVICE_NOW_CONFIGURATION_ITEM)||`117499`,{account:b}=t(),x=b?.username,[S,C]=n(d+`-feedbackContentAndRequestStatus`,{...i},a),{feedbackContent:w,serviceNowRequestResponse:T}=S,[E,D]=h([]),[O,k]=h({status:`idle`}),[A,j]=h([]),[M,N]=h(!1),[P,F]=h(!1),{mutateAsync:I,isPending:L}=l(w),{mutateAsync:R,status:z}=u(w),{mutateAsync:B,status:V}=te(w),[H,U]=h(``),[W,G]=h(!1),K=m(()=>z===`pending`||V===`pending`||L,[L,z,V]),q=m(()=>T.status===`success`,[T.status]),J=m(()=>{let e=[O.status,...A.map(e=>e.status)];return e.every(e=>e===`success`)?`success`:e.includes(`error`)?`partial`:`idle`},[A,O.status]),Y=m(()=>J===`error`||J===`partial`,[J]),ie=m(()=>Y||T.status===`error`,[T.status,Y]),X=()=>{N(e=>!e)},Z=({status:e,response:t,error:n})=>{C({...S,serviceNowRequestResponse:{status:e,errorText:n?.message??void 0,serviceNowId:t?.sysId??void 0}})},Q=({status:e,filename:t,error:n})=>{j(r=>{let i=Array.from(r),a=i.find(e=>e.fileName===t);return a&&(a.status=e,a.errorText=e===`error`?n?.message:void 0),i})},$=({status:e,error:t})=>{k({status:e,errorText:t?.message??void 0})},ae=()=>{W?_():X()},oe=(e,t)=>{C({...S,feedbackContent:{...w,[e]:t}})},se=async()=>{X();let e=``;if(d===`bug`&&x&&T.status!==`success`){let t=new FormData;t.append(`ConfigurationItem`,y),t.append(`Title`,w.title),t.append(`Description`,ee(w,v?.name)),t.append(`CallerEmail`,x),w.urgency&&t.append(`urgency`,c(w.urgency).toString()),E&&E.length>0&&E.forEach(e=>t.append(`Images`,e));try{let n=await B(t);e=n.sysId,Z({status:`success`,response:n})}catch(e){Z({status:`error`,error:e})}}let t=new FormData;t.append(`comment`,s(w,v?.name,d,x,e));try{await R(t),$({status:`success`})}catch(e){$({status:`error`,error:e})}if(E&&E.length>0)for(let e of E){let t=new FormData;t.append(`comment`,`Title: ${w.title}`),t.append(`file`,e);try{await I(t),Q({status:`success`,filename:e.name})}catch(t){Q({status:`error`,filename:e.name,error:t})}}},ce=f(()=>{C(i),D([]),k({status:`idle`}),j([])},[C]);return p(()=>()=>{T.status===`success`&&J===`success`&&setTimeout(()=>{C(i)},1100)},[J,T.status,C]),p(()=>{A.length!==E.length&&j(E.map(e=>({status:`idle`,fileName:e.name})))},[E,A.length]),p(()=>{T.serviceNowId&&T.serviceNowId.length!==0&&U(o(T.serviceNowId,!0))},[T.serviceNowId]),p(()=>{(d===`suggestion`&&J===`success`||T.status===`success`&&J===`success`)&&G(!0)},[J,d,T.status]),ne(g.Provider,{value:{selectedType:d,showResponsePage:M,feedbackAttachments:E,slackAttachmentsRequestResponse:A,slackRequestResponse:O,updateFeedback:oe,feedbackContent:w,serviceNowRequestResponse:T,handleResponsePageOnClose:ae,toggleShowResponsePage:X,onDialogClose:_,handleSave:se,resetForm:ce,requestIsLoading:K,serviceNowSuccess:q,isWrongDomain:P,setIsWrongDomain:F,setFeedbackAttachments:D,requestHasError:ie,showAllSlackRequests:Y,allSlackRequestStatus:J,serviceNowUrl:H,relevantRequestsHaveBeenSuccess:W},children:e})};export{g as FeedbackContext,_ as FeedbackContextProvider};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{environment as e}from"../../../atoms/utils/auth_environment.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{amplify_resources as n,amplify_small_portal as r}from"../../../atoms/icons/other.js";import{useReleaseNotes as i}from"../../../providers/ReleaseNotesProvider.js";import{TopBarMenu as a}from"../TopBarMenu.js";import{TopBarButton as o}from"../TopBar.styles.js";import{TransferToAppDialog as s}from"../TransferToAppDialog.js";import{
|
|
1
|
+
import{environment as e}from"../../../atoms/utils/auth_environment.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{amplify_resources as n,amplify_small_portal as r}from"../../../atoms/icons/other.js";import{useReleaseNotes as i}from"../../../providers/ReleaseNotesProvider.js";import{TopBarMenu as a}from"../TopBarMenu.js";import{TopBarButton as o}from"../TopBar.styles.js";import{TransferToAppDialog as s}from"../TransferToAppDialog.js";import{Feedback as c}from"./Feedback/Feedback.js";import{ResourceMenuItem as l}from"./ResourceMenuItem.js";import{ReleaseNotesDialog as u}from"./ReleaseNotesDialog/ReleaseNotesDialog.js";import{useMemo as d,useRef as f,useState as p}from"react";import{Button as m,Dialog as h,Divider as g,Icon as _}from"@equinor/eds-core-react";import v from"styled-components";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import{arrow_back as S,file_description as C,lightbulb as w,report_bug as T,school as E}from"@equinor/eds-icons";const{PORTAL_URL_WITHOUT_LOCALHOST:D}=e,O=v(h)`
|
|
2
2
|
width: fit-content;
|
|
3
|
-
`,
|
|
3
|
+
`,k=v.div`
|
|
4
4
|
padding: ${t.medium} ${t.medium} ${t.small}
|
|
5
5
|
${t.medium};
|
|
6
|
-
`,
|
|
6
|
+
`,A=({hideFeedback:e=!1,hideReleaseNotes:t=!1,hideLearnMore:v=!1,children:A,customButton:j})=>{let{open:M,setOpen:N}=i(),[P,F]=p(!1),[I,L]=p(!1),[R,z]=p(!1),[B,V]=p(void 0),H=f(null),[U,W]=p(void 0),G=()=>{V(void 0),F(!1)},K=()=>F(e=>!e),q=e=>{W(e?.currentTarget.id),L(!0)},J=()=>{W(void 0),G(),L(!1)},Y=()=>{N(!0),G()},X=()=>V(void 0),Z=()=>V(`learn-more`),Q=()=>{z(!0)},$=()=>{z(!1),G()},ee=d(()=>{switch(B){case`learn-more`:return x(y,{children:[b(l,{text:`Open Application portal`,icon:r,onClick:Q,isHref:!0}),A&&!e&&!t&&b(g,{style:{margin:0}}),A&&b(`div`,{onClick:G,children:A}),b(k,{children:x(m,{variant:`outlined`,onClick:X,children:[b(_,{data:S}),` Back`]})})]});default:return null}},[A,e,t,B]);return x(y,{children:[j?j(H,K):b(o,{variant:`ghost_icon`,ref:H,id:`anchor-match`,"aria-haspopup":`true`,"aria-expanded":P,"aria-controls":`menu-match`,onClick:K,children:b(_,{data:n})}),b(a,{open:P&&!M&&!I,title:`Resources`,onClose:G,anchorEl:H.current,children:ee||x(`section`,{children:[b(l,{id:`bug`,onClick:q,icon:T,text:`Report a bug`,lastItem:!0}),b(l,{id:`suggestion`,onClick:q,icon:w,text:`Suggest idea`,lastItem:!0}),!t&&b(l,{id:`release-notes`,icon:C,onClick:Y,text:`Open release notes`,isHref:!0}),!v&&b(l,{text:`Learn more`,icon:E,onClick:Z})]})}),M&&b(u,{}),!e&&U!==void 0&&x(O,{open:U===`bug`||U===`suggestion`,onClose:J,isDismissable:!0,children:[b(h.Header,{children:U===`bug`?`Report a bug - ServiceNow`:`Suggest a feature`}),b(c,{selectedType:U,onClose:J})]}),R&&b(s,{onClose:$,url:D,applicationName:`Portal`})]})};export{A as Resources};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{spacings as e}from"../../atoms/style/spacings.js";import{elevation as t}from"../../atoms/style/index.js";import
|
|
1
|
+
import{spacings as e}from"../../atoms/style/spacings.js";import{elevation as t}from"../../atoms/style/index.js";import"../../atoms/enums/Theme.js";import{ThemeProviderContext as n}from"../../providers/ThemeProvider/ThemeProvider.js";import{TopBarMenu as r}from"./TopBarMenu.js";import{TopBarButton as i}from"./TopBar.styles.js";import{useContext as a,useMemo as o,useRef as s,useState as c}from"react";import{Icon as l,Radio as u,Typography as d}from"@equinor/eds-core-react";import f from"styled-components";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{settings as g}from"@equinor/eds-icons";const _=f.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
align-items: center;
|
|
@@ -8,13 +8,13 @@ import{spacings as e}from"../../atoms/style/spacings.js";import{elevation as t}f
|
|
|
8
8
|
> span {
|
|
9
9
|
padding: ${e.small} ${e.x_small};
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,v=f.div`
|
|
12
12
|
width: 64px;
|
|
13
13
|
height: 32px;
|
|
14
14
|
background-color: ${e=>e.$color};
|
|
15
15
|
box-shadow: ${t.raised};
|
|
16
16
|
border-radius: 4px;
|
|
17
|
-
`,
|
|
17
|
+
`,y=f.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
flex-direction: column;
|
|
20
20
|
gap: ${e.medium};
|
|
@@ -22,4 +22,4 @@ import{spacings as e}from"../../atoms/style/spacings.js";import{elevation as t}f
|
|
|
22
22
|
padding-top: ${e.small};
|
|
23
23
|
padding-left: ${e.medium};
|
|
24
24
|
}
|
|
25
|
-
`,
|
|
25
|
+
`,b=({allSettings:e,children:t})=>{let f=s(null),[b,x]=c(!1),S=a(n),C=()=>x(!1),w=()=>x(!b),T=o(()=>S?[{title:`Theme`,value:S.theme,onChange:e=>S.setTheme(e),items:[{label:`Light Mode`,name:`theme-group`,value:`light`,colorBox:`#ffffff`},{label:`Dark Mode`,name:`theme-group`,value:`dark`,colorBox:`#243746`}]},...e??[]]:e??[],[e,S]);if(T.length===0)throw Error(`Empty settings in TopBar.Settings!`);return h(p,{children:[m(i,{variant:`ghost_icon`,onClick:w,ref:f,"data-testid":`show-hide-button`,children:m(l,{data:g,size:24})}),h(r,{open:b,title:`Settings`,onClose:C,anchorEl:f.current,children:[m(y,{children:T.map((e,t)=>h(`div`,{children:[m(d,{variant:`overline`,children:e.title}),e.items.map((t,n)=>h(_,{children:[m(u,{id:t.label,disabled:t.disabled,label:t.label,name:e.title,value:`${t.label}-${n}`,checked:e.value===t.value,onChange:()=>e.onChange?.(t.value)}),t.colorBox&&m(v,{$color:t.colorBox,"data-testid":`colorbox-${t.colorBox}`}),t.text&&m(d,{variant:`h6`,children:t.text}),t.element&&t.element]},n))]},t))}),t]})]})};b.displayName=`TopBar.Settings`;export{b as Settings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"../../atoms/enums/Environment.js";import{ApplicationIcon as e}from"../../molecules/ApplicationIcon/ApplicationIcon.js";import{AppAndFieldContainer as t,AppIdentifier as n,AppName as r,Bar as i,CircularProgress as a,EnvironmentTag as o}from"./TopBar.styles.js";import{TopBarInternalContextProvider as s}from"./TopBarInternalContextProvider.js";import{FieldMenu as c}from"./FieldMenu/FieldMenu.js";import{forwardRef as l}from"react";import{Typography as u}from"@equinor/eds-core-react";import{jsx as d,jsxs as f}from"react/jsx-runtime";const p=l(({id:l,children:p,headerLink:m,applicationIcon:h,applicationName:g,environment:_,isFetching:v=!1,capitalize:y=!1,availableFields:b,onSelectField:x,currentField:S,showAccessITLink:C,itemNameSingular:w},T)=>d(s,{selectedField:S,children:f(i,{ref:T,children:[f(t,{id:l,children:[f(n,{tabIndex:0,to:m||`/`,children:[d(e,{name:h,size:32,withHover:!0}),d(r,{group:`navigation`,variant:`menu_title`,$capitalize:y,children:y?g.toLowerCase():g})]}),b&&x&&d(c,{availableFields:b,onSelect:x,showAccessITLink:C,itemNameSingular:w}),v&&d(a,{size:16})]}),(_===`development`||_===`staging`||_===`localhost`)&&d(o,{$environmentType:_,children:d(u,{group:`heading`,variant:`h5`,children:_})}),p]})}));p.displayName=`TopBar`;export{p as TopBar};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
border-bottom: 1px solid ${
|
|
3
|
-
padding-left: ${
|
|
1
|
+
import"../../atoms/enums/Environment.js";import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{Button as n,CircularProgress as r,TopBar as i,Typography as a}from"@equinor/eds-core-react";import o,{css as s}from"styled-components";import{createLink as c}from"@tanstack/react-router";const l=o(i)`
|
|
2
|
+
border-bottom: 1px solid ${e.ui.background__medium.rgba};
|
|
3
|
+
padding-left: ${t.medium};
|
|
4
4
|
align-content: center;
|
|
5
5
|
position: relative;
|
|
6
|
-
`,
|
|
6
|
+
`,u=c(o.a`
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: row;
|
|
9
9
|
align-items: center;
|
|
10
|
-
gap: ${
|
|
10
|
+
gap: ${t.medium_small};
|
|
11
11
|
padding: 0;
|
|
12
|
-
outline-offset: ${
|
|
12
|
+
outline-offset: ${t.x_small};
|
|
13
13
|
text-decoration: none;
|
|
14
14
|
&:hover {
|
|
15
15
|
border-radius: 4px;
|
|
16
16
|
outline: none;
|
|
17
17
|
}
|
|
18
|
-
`),
|
|
18
|
+
`),d=o(i.Header)`
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
|
-
gap: ${
|
|
22
|
-
`,
|
|
21
|
+
gap: ${t.medium};
|
|
22
|
+
`,f=o(a)`
|
|
23
23
|
text-transform: ${e=>e.$capitalize?`capitalize`:`none`};
|
|
24
|
-
`,
|
|
24
|
+
`,p=o(r)`
|
|
25
25
|
circle {
|
|
26
|
-
stroke: ${
|
|
26
|
+
stroke: ${e.interactive.primary__resting.rgba};
|
|
27
27
|
}
|
|
28
28
|
circle:first-child {
|
|
29
|
-
stroke: ${
|
|
29
|
+
stroke: ${e.interactive.primary__hover_alt.rgba};
|
|
30
30
|
}
|
|
31
|
-
`;function
|
|
32
|
-
background-color: ${
|
|
33
|
-
border: 1px solid ${
|
|
34
|
-
`}const
|
|
31
|
+
`;function m(t){let n=`none`,r=`none`;return t===`localhost`?(n=e.interactive.disabled__fill.rgba,r=e.interactive.disabled__text.rgba):t===`development`?(n=e.ui.background__info.rgba,r=e.infographic.substitute__blue_overcast.rgba):t===`staging`&&(n=e.ui.background__warning.rgba,r=e.interactive.warning__text.rgba),`
|
|
32
|
+
background-color: ${n};
|
|
33
|
+
border: 1px solid ${r};
|
|
34
|
+
`}const h=o.div`
|
|
35
35
|
width: 214px;
|
|
36
36
|
height: 36px;
|
|
37
37
|
border-radius: 4px;
|
|
@@ -42,24 +42,24 @@ import{EnvironmentType as e}from"../../atoms/enums/Environment.js";import{colors
|
|
|
42
42
|
left: 50%;
|
|
43
43
|
transform: translateX(-50%);
|
|
44
44
|
text-transform: capitalize;
|
|
45
|
-
${e=>
|
|
46
|
-
`,
|
|
47
|
-
background-color: ${
|
|
45
|
+
${e=>m(e.$environmentType)}
|
|
46
|
+
`,g=o.div`
|
|
47
|
+
background-color: ${e.interactive.danger__resting.rgba};
|
|
48
48
|
width: 10px;
|
|
49
49
|
height: 10px;
|
|
50
50
|
border-radius: 50%;
|
|
51
51
|
position: absolute;
|
|
52
52
|
right: 2px;
|
|
53
53
|
top: 4px;
|
|
54
|
-
border: 2px solid ${
|
|
54
|
+
border: 2px solid ${e.text.static_icons__primary_white.rgba};
|
|
55
55
|
// Box-sizing is a quickfix for use in PWEX because of global styling
|
|
56
56
|
box-sizing: content-box;
|
|
57
|
-
`,
|
|
58
|
-
&:hover ${
|
|
59
|
-
border: 2px solid ${
|
|
57
|
+
`,_=o(n)`
|
|
58
|
+
&:hover ${g} {
|
|
59
|
+
border: 2px solid ${e.interactive.primary__hover_alt.rgba};
|
|
60
60
|
}
|
|
61
|
-
${({$fieldSelector:e})=>{if(!e)return
|
|
61
|
+
${({$fieldSelector:e})=>{if(!e)return s`
|
|
62
62
|
height: 36px;
|
|
63
63
|
width: 36px;
|
|
64
64
|
`}}
|
|
65
|
-
`;export{
|
|
65
|
+
`;export{d as AppAndFieldContainer,u as AppIdentifier,f as AppName,l as Bar,p as CircularProgress,h as EnvironmentTag,_ as TopBarButton,g as UnreadRedDot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useSurvey as e}from"../hooks/useSurvey.js";import{SurveyQuestion as t}from"./SurveyQuestion/SurveyQuestion.js";import{Content as n}from"./SurveyDialog.styles.js";import{SurveyProgress as r}from"./SurveyProgress.js";import{Dialog as i}from"../../../molecules/Dialog/Dialog.js";import{UmuxDialog as a}from"./UmuxDialog.js";import{useState as o}from"react";import{Typography as s}from"@equinor/eds-core-react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{QuestionType as u,SurveyType as d}from"@equinor/subsurface-app-management";const f=()=>{let{activeSurvey:f,activeQuestionIndex:p,setActiveQuestionIndex:m,cancelSurvey:h,hideSurvey:g,answerQuestion:_,currentAnswer:v,setCurrentAnswer:y,isCancelled:b}=e(),[x,S]=o(!1);if(!f||p===void 0||b)return null;let C=[{text:p===0?`Maybe later`:`Back`,variant:`ghost`,onClick:()=>{if(p===0){h();return}let e=f.questions[p-1].answer;e&&(m(p-1),y({id:f.questions[p-1].questionId,...e}))}},{text:p===0?`Get started`:p===f.questions.length-1?`Complete`:`Next`,disabled:(()=>{if(!v)return!0;let e=f?.questions[p??0];switch(e.type){case u.CHOICE:return!v.selectedOptionIds||v.selectedOptionIds.length===0||v.selectedOptionIds.length>(e.multipleChoiceVm?.maxSelectableOptions??0);case u.LINEAR_SCALE:return v.numericAnswer===void 0;case u.TEXT:return!v.textAnswer||v.textAnswer.trim()===``}})(),onClick:async()=>{v
|
|
1
|
+
import{useSurvey as e}from"../hooks/useSurvey.js";import{SurveyQuestion as t}from"./SurveyQuestion/SurveyQuestion.js";import{Content as n}from"./SurveyDialog.styles.js";import{SurveyProgress as r}from"./SurveyProgress.js";import{Dialog as i}from"../../../molecules/Dialog/Dialog.js";import{UmuxDialog as a}from"./UmuxDialog.js";import{useState as o}from"react";import{Typography as s}from"@equinor/eds-core-react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{QuestionType as u,SurveyType as d}from"@equinor/subsurface-app-management";const f=()=>{let{activeSurvey:f,activeQuestionIndex:p,setActiveQuestionIndex:m,cancelSurvey:h,hideSurvey:g,answerQuestion:_,currentAnswer:v,setCurrentAnswer:y,isCancelled:b}=e(),[x,S]=o(!1);if(!f||p===void 0||b)return null;let C=[{text:p===0?`Maybe later`:`Back`,variant:`ghost`,onClick:()=>{if(p===0){h();return}let e=f.questions[p-1].answer;e&&(m(p-1),y({id:f.questions[p-1].questionId,...e}))}},{text:p===0?`Get started`:p===f.questions.length-1?`Complete`:`Next`,disabled:(()=>{if(!v)return!0;let e=f?.questions[p??0];switch(e.type){case u.CHOICE:return!v.selectedOptionIds||v.selectedOptionIds.length===0||v.selectedOptionIds.length>(e.multipleChoiceVm?.maxSelectableOptions??0);case u.LINEAR_SCALE:return v.numericAnswer===void 0;case u.TEXT:return!v.textAnswer||v.textAnswer.trim()===``}})(),onClick:async()=>{if(v){S(!0);try{await _({...v,selectedOptionIds:v?.selectedOptionIds??[]})}finally{S(!1)}}},isLoading:x}];return f.surveyType===d.UMUX?c(a,{}):c(i,{open:!0,width:650,title:f.title,onClose:h,actions:p===0?[{text:`Do not show me this again`,variant:`ghost`,onClick:g,position:`left`},...C]:C,children:l(n,{children:[c(r,{}),c(s,{variant:`body_short_bold`,children:f.questions[p].questionText}),c(t,{})]})})};export{f as SurveyDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useToasts as e}from"../ToastProvider/ToastProvider.js";import{useConfetti as t}from"../ConfettiProvider/ConfettiProvider.js";import{SurveyDialog as n}from"./SurveyDialog/SurveyDialog.js";import{createContext as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{useActiveSurvey as l,useAnswerQuestionActiveSurvey as u,useRespondActiveSurvey as
|
|
1
|
+
import{useToasts as e}from"../ToastProvider/ToastProvider.js";import{useConfetti as t}from"../ConfettiProvider/ConfettiProvider.js";import{SurveyDialog as n}from"./SurveyDialog/SurveyDialog.js";import{createContext as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{useActiveSurvey as l,useAnswerQuestionActiveSurvey as u,useCompleteActiveSurvey as d,useRespondActiveSurvey as f}from"@equinor/subsurface-app-management";const p=r(void 0),m=({children:r})=>{let{showToast:m}=e(),{shower:h}=t(),{data:g}=l(),[_,v]=o(0),[y,b]=o(void 0),[x,S]=o(!1),C=a(void 0),{mutateAsync:w}=f(),{mutateAsync:T}=u(),{mutate:E}=d();i(()=>{if(g&&C.current!==g.surveyId.value){C.current=g.surveyId.value;let e=g.questions.findIndex(e=>e.answer===void 0);v(e>=0?e:0)}},[g]);let D=()=>{!g||!g.surveyResponseId||(E(g.surveyResponseId.value),m({variant:`success`,title:`Survey completed`,description:`Thanks for helping us improve!`,duration:5}),g.showConfettiOnComplete&&h({mode:`shower`,shapes:[`square`],duration:5e3}))};return c(p.Provider,{value:{activeSurvey:g,activeQuestionIndex:_,setActiveQuestionIndex:v,answerQuestion:async e=>{if(!g||_===void 0||!g.questions[_])throw Error(`No active survey or question to answer`);let t=g.surveyResponseId?.value;t===void 0&&(t=(await w({surveyId:g.surveyId,optOut:!1})).value),await T({surveyResponseId:t??``,body:{id:g.questions[_].questionId,...e}}),b(void 0),_+1<g.questions.length?v(_+1):(v(void 0),D())},cancelSurvey:()=>{v(void 0),S(!0)},hideSurvey:()=>{g&&(v(void 0),w({surveyId:g.surveyId,optOut:!0}))},currentAnswer:y,setCurrentAnswer:b,isCancelled:x,completeSurvey:D},children:[r,s(n,{})]})};export{p as SurveyContext,m as SurveyProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLocalStorage as e}from"../../atoms/hooks/useLocalStorage.js";import{THEME_LOCALSTORAGE_KEY as t}from"./ThemeProvider.constants.js";import
|
|
1
|
+
import{useLocalStorage as e}from"../../atoms/hooks/useLocalStorage.js";import{THEME_LOCALSTORAGE_KEY as t}from"./ThemeProvider.constants.js";import"../../atoms/enums/Theme.js";import{createContext as n,useContext as r,useEffect as i}from"react";import{jsx as a}from"react/jsx-runtime";const o=n(void 0);function s(){let e=r(o);if(e===void 0)throw Error(`ThemeProvider must be used within Provider`);return e}const c=({children:n})=>{let[r,s]=e(t,`light`);return i(()=>{document.documentElement.setAttribute(`data-theme`,r)},[r]),a(o.Provider,{value:{theme:r,setTheme:e=>{s(e)}},children:n})};export{c as ThemeProvider,o as ThemeProviderContext,s as useThemeProvider};
|