@equinor/amplify-component-lib 12.0.5 → 12.0.7

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 (85) hide show
  1. package/dist/atoms/hooks/useAmplifyKit.js +1 -1
  2. package/dist/atoms/utils/auth_environment.js +1 -1
  3. package/dist/atoms/utils/richtext.js +2 -2
  4. package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
  5. package/dist/deprecated/IconToggleButton.d.ts +2 -2
  6. package/dist/molecules/Chip/Chip.d.ts +2 -2
  7. package/dist/molecules/DatePicker/DatePicker.d.ts +3 -3
  8. package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
  9. package/dist/molecules/Dialog/Dialog.d.ts +2 -2
  10. package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
  11. package/dist/molecules/IconCell/IconCell.d.ts +2 -2
  12. package/dist/molecules/IconCell/IconCell.js +1 -1
  13. package/dist/molecules/IconCell/IconCell.utils.js +2 -2
  14. package/dist/molecules/ListItem/ListItem.d.ts +2 -2
  15. package/dist/molecules/OptionDrawer/OptionDrawer.d.ts +2 -2
  16. package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +4 -4
  17. package/dist/molecules/ProfileAvatar/ProfileAvatar.d.ts +2 -2
  18. package/dist/molecules/RichTextEditor/MenuBar/AddImageButton.js +1 -1
  19. package/dist/molecules/RichTextEditor/MenuBar/MenuBar.d.ts +7 -7
  20. package/dist/molecules/RichTextEditor/MenuBar/Table/Table.js +1 -1
  21. package/dist/molecules/RichTextEditor/MenuBar/TextAlignment.js +1 -1
  22. package/dist/molecules/RichTextEditor/MenuBar/TextClearFormatting.js +3 -3
  23. package/dist/molecules/RichTextEditor/MenuBar/TextCode.js +1 -1
  24. package/dist/molecules/RichTextEditor/MenuBar/TextColor.js +14 -14
  25. package/dist/molecules/RichTextEditor/MenuBar/TextFormatting.js +1 -1
  26. package/dist/molecules/RichTextEditor/MenuBar/TextHeaders.js +1 -1
  27. package/dist/molecules/RichTextEditor/MenuBar/TextHighlight.js +1 -1
  28. package/dist/molecules/RichTextEditor/MenuBar/TextHistory.js +1 -1
  29. package/dist/molecules/RichTextEditor/MenuBar/TextLinks.js +4 -4
  30. package/dist/molecules/RichTextEditor/MenuBar/TextLists.js +1 -1
  31. package/dist/molecules/RichTextEditor/RichTextEditor.types.js +1 -1
  32. package/dist/molecules/RichTextEditor/index.d.ts +7 -7
  33. package/dist/molecules/Search/Search.d.ts +2 -2
  34. package/dist/molecules/Select/ComboBox/ComboBox.d.ts +2 -2
  35. package/dist/molecules/Select/PersistentComboBox/PersistentComboBox.d.ts +2 -2
  36. package/dist/molecules/Select/Select.styles.d.ts +7 -7
  37. package/dist/molecules/Select/SingleSelect/SingleSelect.d.ts +2 -2
  38. package/dist/molecules/SelectionControls/Checkbox/Checkbox.d.ts +2 -2
  39. package/dist/molecules/SelectionControls/Radio/Radio.d.ts +2 -2
  40. package/dist/molecules/SelectionControls/Switch/Switch.d.ts +2 -2
  41. package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.d.ts +4 -4
  42. package/dist/molecules/TableHeader/TableHeader.js +1 -1
  43. package/dist/organisms/DataGrid/DataGrid.d.ts +2 -2
  44. package/dist/organisms/ReleaseNote/ReleaseNote.d.ts +3 -3
  45. package/dist/organisms/SideBar/SideBar.d.ts +2 -2
  46. package/dist/organisms/SideSheet/SideSheet.d.ts +1 -0
  47. package/dist/organisms/SideSheet/SideSheet.js +1 -1
  48. package/dist/organisms/SideSheet/SideSheet.styles.js +9 -3
  49. package/dist/organisms/SideSheet/SideSheet.types.d.ts +4 -1
  50. package/dist/organisms/Status/Action.d.ts +2 -2
  51. package/dist/organisms/Status/Description.d.ts +2 -2
  52. package/dist/organisms/Status/MissingAccesses.d.ts +2 -2
  53. package/dist/organisms/Status/Title.d.ts +2 -2
  54. package/dist/organisms/Status/collections/GenericError.d.ts +2 -2
  55. package/dist/organisms/Status/collections/MissingPermissions.d.ts +2 -2
  56. package/dist/organisms/Template/Template.d.ts +5 -5
  57. package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
  58. package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
  59. package/dist/organisms/TopBar/Account/Account.js +1 -1
  60. package/dist/organisms/TopBar/Actions.d.ts +2 -2
  61. package/dist/organisms/TopBar/FieldMenu/FieldMenu.d.ts +2 -2
  62. package/dist/organisms/TopBar/Notifications/FilterOptions.js +17 -17
  63. package/dist/organisms/TopBar/Notifications/NotificationsInner.js +3 -3
  64. package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationElements/DefaultNotification.js +2 -2
  65. package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationElements/ReadyToReportNotification.js +6 -6
  66. package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationElements/RequestReviewOrca.js +4 -4
  67. package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationTemplate.js +1 -1
  68. package/dist/organisms/TopBar/Resources/Feedback/Feedback.const.js +1 -1
  69. package/dist/organisms/TopBar/Resources/Feedback/Feedback.types.js +1 -1
  70. package/dist/organisms/TopBar/Resources/Feedback/Feedback.utils.js +5 -5
  71. package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/Description.js +3 -3
  72. package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/FeedbackForm.js +1 -1
  73. package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/RequestStatus.js +2 -2
  74. package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/ResponseStatus.js +1 -1
  75. package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/Success.js +4 -4
  76. package/dist/organisms/TopBar/Resources/Feedback/providers/FeedbackContextProvider.js +1 -1
  77. package/dist/organisms/TopBar/Resources/Resources.js +3 -3
  78. package/dist/organisms/TopBar/Settings.js +4 -4
  79. package/dist/organisms/TopBar/TopBar.js +1 -1
  80. package/dist/organisms/TopBar/TopBar.styles.js +25 -25
  81. package/dist/providers/SurveyProvider/SurveyDialog/SurveyDialog.js +1 -1
  82. package/dist/providers/SurveyProvider/SurveyProvider.js +1 -1
  83. package/dist/providers/ThemeProvider/ThemeProvider.js +1 -1
  84. package/package.json +3 -3
  85. package/dist/organisms/TopBar/Notifications/NotificationsTemplate/Notifications.types.js +0 -1
@@ -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{NotificationsTypes as a}from"./Notifications.types.js";import{DefaultNotification as o}from"./NotificationElements/DefaultNotification.js";import{ExperienceDue3Weeks as s}from"./NotificationElements/ExperienceDue3Weeks.js";import{MergedBranchOrca as c}from"./NotificationElements/MergedBranchOrca.js";import{ReadyToBePublished as l}from"./NotificationElements/ReadyToBePublished.js";import{ReadyToReportNotification as u}from"./NotificationElements/ReadyToReportNotification.js";import{RequestChangeOrca as d}from"./NotificationElements/RequestChangeOrca.js";import{RequestReviewOrca as f}from"./NotificationElements/RequestReviewOrca.js";import{ReviewQANotification as p}from"./NotificationElements/ReviewQANotification.js";import{Content as m,DeleteButton as h,Divider as g,Dot as _,FooterContainer as v,GridContainer as y,TopContainer as b,UserInformation as x,Wrapper as S}from"./NotificationTemplate.style.js";import{useMemo as C}from"react";import{Icon as w,Typography as T}from"@equinor/eds-core-react";import{Fragment as E,jsx as D,jsxs as O}from"react/jsx-runtime";import{delete_to_trash as k}from"@equinor/eds-icons";const{colors:A}=e,j=e=>{let{user:j,notificationType:M,applicationName:N,Read:P,field:F,time:I,footer:L=!0,onDelete:R}=e,z=C(()=>{switch(M){case a.READY_TO_REPORT:return D(u,{...e});case a.DEFAULT:return D(o,{...e});case a.REQUESTED_REVIEW:return D(f,{...e});case a.REQUESTED_CHANGES:return D(d,{...e});case a.MERGE_BRANCH:return D(c,{...e});case a.QA_COMMENTS:return D(p,{...e});case a.EXPERIENCE_READY_TO_PUBLISH:return D(l,{...e});case a.DUE_3_WEEKS:return D(s,{...e})}},[e,M]);return O(E,{children:[D(S,{children:O(y,{children:[O(b,{children:[j?O(x,{children:[!P&&D(_,{}),D(i,{url:j?.image,name:j?.shortName,size:`large`}),O(`div`,{children:[D(T,{color:A.text.static_icons__default.rgba,group:`heading`,variant:`h6`,children:j?.displayName}),D(T,{group:`paragraph`,variant:`caption`,color:A.text.static_icons__secondary.rgba,children:j?.shortName})]})]}):O(x,{$systemUser:!0,children:[!P&&D(_,{"data-testid":`unread-dot-system`}),D(n,{name:N}),D(T,{group:`heading`,variant:`h6`,children:N})]}),D(T,{group:`navigation`,variant:`label`,color:P?A.text.static_icons__secondary.rgba:A.infographic.substitute__blue_overcast.rgba,"data-testid":`notification-date`,children:t(I)})]}),D(m,{children:z}),L&&O(v,{children:[O(`div`,{style:{display:`flex`,gap:`5px`},children:[D(T,{group:`navigation`,variant:`label`,color:A.text.static_icons__tertiary.rgba,children:N}),D(T,{group:`navigation`,variant:`label`,color:A.text.static_icons__tertiary.rgba,children:F})]}),D(r,{title:`Delete notification`,children:D(h,{onClick:R,variant:`ghost_icon`,children:D(w,{data:k})})})]})]})}),D(g,{})]})};export{j as NotificationTemplate};
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
- import{StatusEnum as e}from"./Feedback.types.js";const t=1048575,n=`serviceNowIncident`,r=`slackPostMessage`,i=`slackFileUpload`,a=`.equinor.com`,o=`There was an error with the request`,s=1e3*60*60,c={feedbackContent:{title:``,description:``,url:``,urgency:``},serviceNowRequestResponse:{status:e.idle}};export{c as DEFAULT_FEEDBACK_LOCAL_STORAGE,o as DEFAULT_REQUEST_ERROR_MESSAGE,a as EQUINOR_EMAIL_SUFFIX,t as MAX_FILE_SIZE_BYTES,s as ONE_HOUR_IN_MS,n as SERVICE_NOW_QUERY_KEY,i as SLACK_FILE_QUERY_KEY,r as SLACK_POST_QUERY_KEY};
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}({}),t=function(e){return e.BUG=`bug`,e.SUGGESTION=`suggestion`,e}({}),n=function(e){return e.error=`error`,e.idle=`idle`,e.pending=`pending`,e.success=`success`,e.partial=`partial`,e}({}),r=function(e){return e.EDGE=`Edge`,e.EDGE_SHORT=`Edg`,e.FIREFOX=`Firefox`,e.CHROME=`Chrome`,e.SAFARI=`Safari`,e}({});export{r as Browsers,t as FeedbackType,n as StatusEnum,e as UrgencyOption};
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{EnvironmentType as e}from"../../../../atoms/enums/Environment.js";import{environment as t}from"../../../../atoms/utils/auth_environment.js";import{formatDate as n}from"../../../../atoms/utils/date.js";import{capitalize as r}from"../../../../atoms/utils/string.js";import{Browsers as i,FeedbackType as a,UrgencyOption as o}from"./Feedback.types.js";import{ServiceNowUrgency as s}from"@equinor/subsurface-app-management";const{getAppName:c,getEnvironmentName:l}=t,u=e=>e.urgency===o.NO_IMPACT?`:large_yellow_circle:`:e.urgency===o.IMPEDES?`:large_orange_circle:`:`:red_circle:`,d=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)})},f=e=>{switch(e){case o.UNABLE:return s.NORMAL;case o.IMPEDES:return s.NORMAL;case o.NO_IMPACT:return s.NORMAL}},p=(e,t)=>{let n=`Url location of bug: ${e.url} \n`,i=`Severity of bug: ${e.urgency} \n`,a=`Field: ${r(t??``)} \n`,o=`Browser: ${_()} \n`;return`${e.url?n:``}
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}`},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*
6
- `+c(import.meta.env.VITE_NAME)},{type:`mrkdwn`,text:`*User* \n ${o}`}]},{type:`section`,fields:[{type:`mrkdwn`,text:`*Browser*
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};
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{FeedbackType as r}from"../Feedback.types.js";import{useFeedbackContext as i}from"../hooks/useFeedbackContext.js";import{LockedInputTooltip as a}from"./LockedInputTooltip.js";import{useMemo as o}from"react";import{Typography as s}from"@equinor/eds-core-react";import c from"styled-components";import{jsx as l,jsxs as u}from"react/jsx-runtime";const{colors:d}=e,f=c.div`
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: ${d.text.static_icons__default.rgba};
7
+ color: ${u.text.static_icons__default.rgba};
8
8
  }
9
- `,p=()=>{let{serviceNowSuccess:e,feedbackContent:t,selectedType:c,updateFeedback:p}=i(),m=o(()=>e?d.interactive.disabled__text.rgba:d.text.static_icons__default.rgba,[e]);return u(f,{children:[c===r.BUG&&u(`div`,{children:[l(s,{group:`input`,variant:`text`,color:m,children:`What is the specific bug?`}),l(s,{group:`input`,variant:`text`,color:m,children:`What are the expected results?`}),l(s,{group:`input`,variant:`text`,color:m,children:`How can we reproduce the issue?`}),l(s,{group:`input`,variant:`text`,color:m,children:`Is there a known workaround?`})]}),l(a,{show:e,children:l(n,{id:`feedback-description`,label:`Description`,disabled:e,meta:`Required`,value:t.description,placeholder:c===r.BUG?`Describe the bug, including expectations, reproductions steps, any workarounds...`:`Describe the feature. What would be the value for you?`,rows:4,onChange:e=>p(`description`,e.currentTarget.value),multiline:!0})})]})};export{p as Description};
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{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
+ 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{StatusEnum as t}from"../Feedback.types.js";import"../Feedback.const.js";import{Status as n}from"./ResponsePage.styles.js";import{useMemo as r}from"react";import{Icon as i,Typography as a}from"@equinor/eds-core-react";import o from"styled-components";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{check_circle_outlined as l,info_circle as u}from"@equinor/eds-icons";const{colors:d}=e,f=o.div`
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
- `,p=({requestStatus:e,title:o})=>{let p=r(()=>{switch(e.status){case t.partial:return`Partially Failed`;case t.idle:case t.pending:return`Sending...`;case t.success:return`Success`;default:return``}},[e]),m=e.status===t.partial||e.status===t.error;return c(f,{children:[s(a,{group:`ui`,variant:`accordion_header`,children:o}),c(n,{children:[s(a,{color:m?d.interactive.warning__text.rgba:``,group:`ui`,variant:`snackbar`,children:e.status===t.error?e.errorText??`There was an error with the request`:p}),(m||e.status===t.success)&&s(i,{color:m?d.interactive.warning__text.rgba:d.interactive.success__resting.rgba,data:m?u:l})]})]})};export{p as RequestStatus};
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{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
+ 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{FeedbackType as n}from"../Feedback.types.js";import{useFeedbackContext as r}from"../hooks/useFeedbackContext.js";import{Typography as i}from"@equinor/eds-core-react";import a from"styled-components";import{jsx as o,jsxs as s}from"react/jsx-runtime";const{colors:c}=e,l=a.div`
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
- `,u=a.a`
5
- color: ${c.interactive.primary__resting.rgba};
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
- `,d=()=>{let{selectedType:e,serviceNowUrl:t}=r();return s(l,{children:[o(i,{variant:`h3`,children:`Thank you, we have received your ${e===n.BUG?`report!`:`suggestion!`}`}),e===n.BUG&&t.length>0&&o(u,{href:t,children:`See ticket in ServiceNow`})]})};export{d as Success};
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{FeedbackType as i,StatusEnum as a}from"../Feedback.types.js";import{DEFAULT_FEEDBACK_LOCAL_STORAGE as o,ONE_HOUR_IN_MS as ee}from"../Feedback.const.js";import{createServiceNowDescription as te,createServiceNowUrl as s,createSlackMessage as c,getUrgencyNumber as l}from"../Feedback.utils.js";import{useServiceNowIncident as u}from"../hooks/useServiceNowIncident.js";import{useSlackFileUpload as ne}from"../hooks/useSlackFileUpload.js";import{useSlackPostMessage as re}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 g}from"react/jsx-runtime";const{getServiceNowConfigurationItem:ie}=e,_=d(void 0),v=({children:e,selectedType:d,onClose:v})=>{let{selectedField:y}=r(),b=ie(import.meta.env.VITE_SERVICE_NOW_CONFIGURATION_ITEM)||`117499`,{account:ae}=t(),x=ae?.username,[S,C]=n(d+`-feedbackContentAndRequestStatus`,{...o},ee),{feedbackContent:w,serviceNowRequestResponse:T}=S,[E,D]=h([]),[O,k]=h({status:a.idle}),[A,j]=h([]),[M,N]=h(!1),[P,F]=h(!1),{mutateAsync:I,isPending:L}=ne(w),{mutateAsync:R,status:z}=re(w),{mutateAsync:B,status:V}=u(w),[H,U]=h(``),[W,G]=h(!1),K=m(()=>z===`pending`||V===`pending`||L,[L,z,V]),q=m(()=>T.status===a.success,[T.status]),J=m(()=>{let e=[O.status,...A.map(e=>e.status)];return e.every(e=>e===a.success)?a.success:e.includes(a.error)?a.partial:a.idle},[A,O.status]),Y=m(()=>J===a.error||J===a.partial,[J]),oe=m(()=>Y||T.status===a.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),o=i.find(e=>e.fileName===t);return o&&(o.status=e,o.errorText=e===a.error?n?.message:void 0),i})},$=({status:e,error:t})=>{k({status:e,errorText:t?.message??void 0})},se=()=>{W?v():X()},ce=(e,t)=>{C({...S,feedbackContent:{...w,[e]:t}})},le=async()=>{X();let e=``;if(d===i.BUG&&x&&T.status!==a.success){let t=new FormData;t.append(`ConfigurationItem`,b),t.append(`Title`,w.title),t.append(`Description`,te(w,y?.name)),t.append(`CallerEmail`,x),w.urgency&&t.append(`urgency`,l(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:a.success,response:n})}catch(e){Z({status:a.error,error:e})}}let t=new FormData;t.append(`comment`,c(w,y?.name,d,x,e));try{await R(t),$({status:a.success})}catch(e){$({status:a.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:a.success,filename:e.name})}catch(t){Q({status:a.error,filename:e.name,error:t})}}},ue=f(()=>{C(o),D([]),k({status:a.idle}),j([])},[C]);return p(()=>()=>{T.status===a.success&&J===a.success&&setTimeout(()=>{C(o)},1100)},[J,T.status,C]),p(()=>{A.length!==E.length&&j(E.map(e=>({status:a.idle,fileName:e.name})))},[E,A.length]),p(()=>{T.serviceNowId&&T.serviceNowId.length!==0&&U(s(T.serviceNowId,!0))},[T.serviceNowId]),p(()=>{(d===i.SUGGESTION&&J===a.success||T.status===a.success&&J===a.success)&&G(!0)},[J,d,T.status]),g(_.Provider,{value:{selectedType:d,showResponsePage:M,feedbackAttachments:E,slackAttachmentsRequestResponse:A,slackRequestResponse:O,updateFeedback:ce,feedbackContent:w,serviceNowRequestResponse:T,handleResponsePageOnClose:se,toggleShowResponsePage:X,onDialogClose:v,handleSave:le,resetForm:ue,requestIsLoading:K,serviceNowSuccess:q,isWrongDomain:P,setIsWrongDomain:F,setFeedbackAttachments:D,requestHasError:oe,showAllSlackRequests:Y,allSlackRequestStatus:J,serviceNowUrl:H,relevantRequestsHaveBeenSuccess:W},children:e})};export{_ as FeedbackContext,v as FeedbackContextProvider};
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{FeedbackType as c}from"./Feedback/Feedback.types.js";import{Feedback as l}from"./Feedback/Feedback.js";import{ResourceMenuItem as u}from"./ResourceMenuItem.js";import{ReleaseNotesDialog as d}from"./ReleaseNotesDialog/ReleaseNotesDialog.js";import{useMemo as f,useRef as p,useState as m}from"react";import{Button as h,Dialog as g,Divider as _,Icon as v}from"@equinor/eds-core-react";import y from"styled-components";import{Fragment as b,jsx as x,jsxs as S}from"react/jsx-runtime";import{arrow_back as C,file_description as w,lightbulb as T,report_bug as E,school as D}from"@equinor/eds-icons";const{PORTAL_URL_WITHOUT_LOCALHOST:O}=e,k=y(g)`
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
- `,A=y.div`
3
+ `,k=v.div`
4
4
  padding: ${t.medium} ${t.medium} ${t.small}
5
5
  ${t.medium};
6
- `,j=({hideFeedback:e=!1,hideReleaseNotes:t=!1,hideLearnMore:y=!1,children:j,customButton:M})=>{let{open:N,setOpen:P}=i(),[F,I]=m(!1),[L,R]=m(!1),[z,B]=m(!1),[V,H]=m(void 0),U=p(null),[W,G]=m(void 0),K=()=>{H(void 0),I(!1)},q=()=>I(e=>!e),J=e=>{G(e?.currentTarget.id),R(!0)},Y=()=>{G(void 0),K(),R(!1)},X=()=>{P(!0),K()},Z=()=>H(void 0),Q=()=>H(`learn-more`),$=()=>{B(!0)},ee=()=>{B(!1),K()},te=f(()=>{switch(V){case`learn-more`:return S(b,{children:[x(u,{text:`Open Application portal`,icon:r,onClick:$,isHref:!0}),j&&!e&&!t&&x(_,{style:{margin:0}}),j&&x(`div`,{onClick:K,children:j}),x(A,{children:S(h,{variant:`outlined`,onClick:Z,children:[x(v,{data:C}),` Back`]})})]});default:return null}},[j,e,t,V]);return S(b,{children:[M?M(U,q):x(o,{variant:`ghost_icon`,ref:U,id:`anchor-match`,"aria-haspopup":`true`,"aria-expanded":F,"aria-controls":`menu-match`,onClick:q,children:x(v,{data:n})}),x(a,{open:F&&!N&&!L,title:`Resources`,onClose:K,anchorEl:U.current,children:te||S(`section`,{children:[x(u,{id:c.BUG,onClick:J,icon:E,text:`Report a bug`,lastItem:!0}),x(u,{id:c.SUGGESTION,onClick:J,icon:T,text:`Suggest idea`,lastItem:!0}),!t&&x(u,{id:`release-notes`,icon:w,onClick:X,text:`Open release notes`,isHref:!0}),!y&&x(u,{text:`Learn more`,icon:D,onClick:Q})]})}),N&&x(d,{}),!e&&W!==void 0&&S(k,{open:W===c.BUG||W===c.SUGGESTION,onClose:Y,isDismissable:!0,children:[x(g.Header,{children:W===c.BUG?`Report a bug - ServiceNow`:`Suggest a feature`}),x(l,{selectedType:W,onClose:Y})]}),z&&x(s,{onClose:ee,url:O,applicationName:`Portal`})]})};export{j as Resources};
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{Theme as n}from"../../atoms/enums/Theme.js";import{ThemeProviderContext as r}from"../../providers/ThemeProvider/ThemeProvider.js";import{TopBarMenu as i}from"./TopBarMenu.js";import{TopBarButton as a}from"./TopBar.styles.js";import{useContext as o,useMemo as s,useRef as c,useState as l}from"react";import{Icon as u,Radio as d,Typography as f}from"@equinor/eds-core-react";import p from"styled-components";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{settings as _}from"@equinor/eds-icons";const v=p.div`
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
- `,y=p.div`
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
- `,b=p.div`
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
- `,x=({allSettings:e,children:t})=>{let p=c(null),[x,S]=l(!1),C=o(r),w=()=>S(!1),T=()=>S(!x),E=s(()=>C?[{title:`Theme`,value:C.theme,onChange:e=>C.setTheme(e),items:[{label:`Light Mode`,name:`theme-group`,value:n.LIGHT,colorBox:`#ffffff`},{label:`Dark Mode`,name:`theme-group`,value:n.DARK,colorBox:`#243746`}]},...e??[]]:e??[],[e,C]);if(E.length===0)throw Error(`Empty settings in TopBar.Settings!`);return g(m,{children:[h(a,{variant:`ghost_icon`,onClick:T,ref:p,"data-testid":`show-hide-button`,children:h(u,{data:_,size:24})}),g(i,{open:x,title:`Settings`,onClose:w,anchorEl:p.current,children:[h(b,{children:E.map((e,t)=>g(`div`,{children:[h(f,{variant:`overline`,children:e.title}),e.items.map((t,n)=>g(v,{children:[h(d,{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&&h(y,{$color:t.colorBox,"data-testid":`colorbox-${t.colorBox}`}),t.text&&h(f,{variant:`h6`,children:t.text}),t.element&&t.element]},n))]},t))}),t]})]})};x.displayName=`TopBar.Settings`;export{x as Settings};
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{EnvironmentType as e}from"../../atoms/enums/Environment.js";import{ApplicationIcon as t}from"../../molecules/ApplicationIcon/ApplicationIcon.js";import{AppAndFieldContainer as n,AppIdentifier as r,AppName as i,Bar as a,CircularProgress as o,EnvironmentTag as s}from"./TopBar.styles.js";import{TopBarInternalContextProvider as c}from"./TopBarInternalContextProvider.js";import{FieldMenu as l}from"./FieldMenu/FieldMenu.js";import{forwardRef as u}from"react";import{Typography as d}from"@equinor/eds-core-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m=u(({id:u,children:m,headerLink:h,applicationIcon:g,applicationName:_,environment:v,isFetching:y=!1,capitalize:b=!1,availableFields:x,onSelectField:S,currentField:C,showAccessITLink:w,itemNameSingular:T},E)=>f(c,{selectedField:C,children:p(a,{ref:E,children:[p(n,{id:u,children:[p(r,{tabIndex:0,to:h||`/`,children:[f(t,{name:g,size:32,withHover:!0}),f(i,{group:`navigation`,variant:`menu_title`,$capitalize:b,children:b?_.toLowerCase():_})]}),x&&S&&f(l,{availableFields:x,onSelect:S,showAccessITLink:w,itemNameSingular:T}),y&&f(o,{size:16})]}),(v===e.DEVELOP||v===e.STAGING||v===e.LOCALHOST)&&f(s,{$environmentType:v,children:f(d,{group:`heading`,variant:`h5`,children:v})}),m]})}));m.displayName=`TopBar`;export{m as TopBar};
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{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{createLink as l}from"@tanstack/react-router";const u=s(a)`
2
- border-bottom: 1px solid ${t.ui.background__medium.rgba};
3
- padding-left: ${n.medium};
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
- `,d=l(s.a`
6
+ `,u=c(o.a`
7
7
  display: flex;
8
8
  flex-direction: row;
9
9
  align-items: center;
10
- gap: ${n.medium_small};
10
+ gap: ${t.medium_small};
11
11
  padding: 0;
12
- outline-offset: ${n.x_small};
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
- `),f=s(a.Header)`
18
+ `),d=o(i.Header)`
19
19
  display: flex;
20
20
  align-items: center;
21
- gap: ${n.medium};
22
- `,p=s(o)`
21
+ gap: ${t.medium};
22
+ `,f=o(a)`
23
23
  text-transform: ${e=>e.$capitalize?`capitalize`:`none`};
24
- `,m=s(i)`
24
+ `,p=o(r)`
25
25
  circle {
26
- stroke: ${t.interactive.primary__resting.rgba};
26
+ stroke: ${e.interactive.primary__resting.rgba};
27
27
  }
28
28
  circle:first-child {
29
- stroke: ${t.interactive.primary__hover_alt.rgba};
29
+ stroke: ${e.interactive.primary__hover_alt.rgba};
30
30
  }
31
- `;function h(n){let r=`none`,i=`none`;return n===e.LOCALHOST?(r=t.interactive.disabled__fill.rgba,i=t.interactive.disabled__text.rgba):n===e.DEVELOP?(r=t.ui.background__info.rgba,i=t.infographic.substitute__blue_overcast.rgba):n===e.STAGING&&(r=t.ui.background__warning.rgba,i=t.interactive.warning__text.rgba),`
32
- background-color: ${r};
33
- border: 1px solid ${i};
34
- `}const g=s.div`
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=>h(e.$environmentType)}
46
- `,_=s.div`
47
- background-color: ${t.interactive.danger__resting.rgba};
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 ${t.text.static_icons__primary_white.rgba};
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
- `,v=s(r)`
58
- &:hover ${_} {
59
- border: 2px solid ${t.interactive.primary__hover_alt.rgba};
57
+ `,_=o(n)`
58
+ &:hover ${g} {
59
+ border: 2px solid ${e.interactive.primary__hover_alt.rgba};
60
60
  }
61
- ${({$fieldSelector:e})=>{if(!e)return c`
61
+ ${({$fieldSelector:e})=>{if(!e)return s`
62
62
  height: 36px;
63
63
  width: 36px;
64
64
  `}}
65
- `;export{f as AppAndFieldContainer,d as AppIdentifier,p as AppName,u as Bar,m as CircularProgress,g as EnvironmentTag,v as TopBarButton,_ as UnreadRedDot};
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&&(S(!0),await _({...v,selectedOptionIds:v?.selectedOptionIds??[]}),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
+ 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 d}from"@equinor/subsurface-app-management";const f=r(void 0),p=({children:r})=>{let{showToast:p}=e(),{shower:m}=t(),{data:h}=l(),[g,_]=o(0),[v,y]=o(void 0),[b,x]=o(!1),S=a(void 0),{mutateAsync:C}=d(),{mutateAsync:w}=u();i(()=>{if(h&&S.current!==h.surveyId.value){S.current=h.surveyId.value;let e=h.questions.findIndex(e=>e.answer===void 0);_(e>=0?e:0)}},[h]);let T=()=>{h&&(p({variant:`success`,title:`Survey completed`,description:`Thanks for helping us improve!`,duration:5}),h.showConfettiOnComplete&&m({mode:`shower`,shapes:[`square`],duration:5e3}))};return c(f.Provider,{value:{activeSurvey:h,activeQuestionIndex:g,setActiveQuestionIndex:_,answerQuestion:async e=>{if(!h||g===void 0||!h.questions[g])throw Error(`No active survey or question to answer`);let t=h.surveyResponseId?.value;t===void 0&&(t=(await C({surveyId:h.surveyId,optOut:!1})).value),await w({surveyResponseId:t??``,body:{id:h.questions[g].questionId,...e}}),y(void 0),g+1<h.questions.length?_(g+1):(_(void 0),T())},cancelSurvey:()=>{_(void 0),x(!0)},hideSurvey:()=>{h&&(_(void 0),C({surveyId:h.surveyId,optOut:!0}))},currentAnswer:v,setCurrentAnswer:y,isCancelled:b,completeSurvey:T},children:[r,s(n,{})]})};export{f as SurveyContext,p as SurveyProvider};
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{Theme as n}from"../../atoms/enums/Theme.js";import{createContext as r,useContext as i,useEffect as a}from"react";import{jsx as o}from"react/jsx-runtime";const s=r(void 0);function c(){let e=i(s);if(e===void 0)throw Error(`ThemeProvider must be used within Provider`);return e}const l=({children:r})=>{let[i,c]=e(t,n.LIGHT);return a(()=>{document.documentElement.setAttribute(`data-theme`,i)},[i]),o(s.Provider,{value:{theme:i,setTheme:e=>{c(e)}},children:r})};export{l as ThemeProvider,s as ThemeProviderContext,c as useThemeProvider};
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/amplify-component-lib",
3
- "version": "12.0.5",
3
+ "version": "12.0.7",
4
4
  "description": "Frontend Typescript components for the Amplify team",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@equinor/eds-icons": "^0.22.0",
55
- "@equinor/subsurface-app-management": "5.4.6",
55
+ "@equinor/subsurface-app-management": "5.4.7",
56
56
  "@eslint/js": "^9.22.0",
57
57
  "@faker-js/faker": "^9.6.0",
58
58
  "@storybook/addon-coverage": "^2.0.0",
@@ -114,7 +114,7 @@
114
114
  "@equinor/eds-core-react": "0.44.0",
115
115
  "@equinor/eds-data-grid-react": "^0.7.5",
116
116
  "@equinor/eds-icons": "*",
117
- "@equinor/subsurface-app-management": "^5.4.6",
117
+ "@equinor/subsurface-app-management": "^5.4.7",
118
118
  "@tanstack/react-query": "*",
119
119
  "@tanstack/react-router": "*",
120
120
  "@tiptap/core": "^3.1.0",
@@ -1 +0,0 @@
1
- let e=function(e){return e.READY_TO_REPORT=`readytoreport`,e.DEFAULT=`default`,e.REQUESTED_REVIEW=`requestReview`,e.REQUESTED_CHANGES=`requestedChanges`,e.MERGE_BRANCH=`mergeBranch`,e.QA_COMMENTS=` TaskInReview`,e.DUE_3_WEEKS=`WellDueForReport`,e.EXPERIENCE_READY_TO_PUBLISH=`WellReadyForPublishing `,e.SYSTEM_USER=`systemUser`,e}({}),t=function(e){return e.UNREAD=`unread`,e.SYSTEM=`systemUser`,e.USER=`user`,e}({}),n=function(e){return e.NEW_OLDEST=`newtoold`,e.OLD_NEWEST=`oldtonew`,e.UNREAD=`unread`,e}({});export{t as FilterNotification,e as NotificationsTypes,n as SortNotification};