Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- Warning message in the admin panel informing that Download Requests and Process Unsent will require a License Manager resource starting on a date to be defined.

## [1.14.2] - 2026-05-05

### Fixed
Expand Down
3 changes: 2 additions & 1 deletion messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
"admin/settings.process-unsent-helptext": "Process all unsent requests to notify and download an XLS file of the results.",
"admin/settings.verify-availability-helptext": "Runs a shipping simulation to verify that the item can be shipped to the shopper before sending a notification.",
"admin/settings.marketplace-to-notify-helptext": "Allows a seller account to specify a comma separated list of marketplace account names to notify of inventory updates.",
"admin/settings.label": "Settings"
"admin/settings.label": "Settings",
"admin/settings.permission-warning": "Starting dd/mm/yyyy, accessing Download Requests and Process Unsent will require the [resource-name] resource in License Manager. Make sure the users who need this feature have the appropriate role assigned."
}
3 changes: 2 additions & 1 deletion messages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
"admin/settings.process-unsent-helptext": "Process all unsent requests to notify and download an XLS file of the results.",
"admin/settings.verify-availability-helptext": "Runs a shipping simulation to verify that the item can be shipped to the shopper before sending a notificaiton.",
"admin/settings.marketplace-to-notify-helptext": "Allows a seller account to specify a comma separated list of marketplace account names to notify of inventory updates.",
"admin/settings.label": "Settings"
"admin/settings.label": "Settings",
"admin/settings.permission-warning": "A partir de dd/mm/yyyy, o acesso ao Download Requests e ao Process Unsent exigirá o recurso [resource-name] no License Manager. Certifique-se de que os usuários que precisam dessa funcionalidade tenham a role adequada atribuída."
}
11 changes: 11 additions & 0 deletions react/NotifyAdmin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import React, { useState, useEffect } from 'react'
import { injectIntl, defineMessages } from 'react-intl'
import {
Alert,
ToastProvider,
ToastConsumer,
Layout,
Expand All @@ -23,8 +24,8 @@
import SaveAppSettings from './mutations/saveAppSettings.gql'
import ProcessUnsentRequests from './graphql/processUnsentRequests.gql'

interface Props {

Check warning on line 27 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
intl: any

Check warning on line 28 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
}

const messages = defineMessages({
Expand Down Expand Up @@ -64,6 +65,11 @@
id: 'admin/settings.label',
defaultMessage: 'Settings',
},
permissionWarning: {
id: 'admin/settings.permission-warning',
defaultMessage:
'Starting dd/mm/yyyy, accessing Download Requests and Process Unsent will require the [resource-name] resource in License Manager. Make sure the users who need this feature have the appropriate role assigned.',
},
downloadHelptext: {
id: 'admin/settings.download-helptext',
defaultMessage: 'Download an XLS file of all notify request records.',
Expand All @@ -79,14 +85,14 @@
'Runs a shipping simulation to verify that the item can be shipped to the shopper before sending a notificaiton.',
},
marketplaceToNotifyHelptext: {
id: 'admin/settings.marketplace-to-notify-helptext',

Check warning on line 88 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
defaultMessage:

Check warning on line 89 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
'Allows a seller account to specify a comma separated list of marketplace account names to notify of inventory updates.',
},
})

const NotifyAdmin: FC<any> = ({ intl }: Props) => {

Check warning on line 94 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
const [state, setState] = useState<any>({

Check warning on line 95 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
loading: false,
processing: false,
})
Expand All @@ -101,13 +107,13 @@
const [saveSettings] = useMutation(SaveAppSettings)
const [processUnsentRequess] = useMutation(ProcessUnsentRequests)
const [settingsLoading, setSettingsLoading] = useState(false)

Check warning on line 110 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
const [settingsState, setSettingsState] = useState({
doShippingSim: false,
marketplaceToNotify: '',
})

const handleSaveSettings = async (showToast: any) => {

Check warning on line 116 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
setSettingsLoading(true)

try {
Expand All @@ -130,31 +136,31 @@
duration: 5000,
})
setSettingsLoading(false)
}

Check warning on line 139 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
}

useEffect(() => {
if (!data?.appSettings?.message) return

const parsedSettings: any = JSON.parse(data.appSettings.message)

Check warning on line 145 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type

Check warning on line 146 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
setSettingsState(parsedSettings)
}, [data])

const { loading, processing } = state

const downloadRequests = (allRequests: any) => {

Check warning on line 152 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
const header = [
'Id',
'Name',
'Email',
'Sku Id',

Check warning on line 157 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
'Requested At',
'Sent',
'Sent At',
]

const result: any = []

Check warning on line 163 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type

for (const request of allRequests) {
const requestData = {
Expand All @@ -173,13 +179,13 @@
const ws = XLSX.utils.json_to_sheet(result, { header })
const wb = XLSX.utils.book_new()

XLSX.utils.book_append_sheet(wb, ws, 'Sheet1')

Check warning on line 182 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
const exportFileName = `requests.xls`

XLSX.writeFile(wb, exportFileName)
}

const processRequestsResults = (processedRequests: any) => {

Check warning on line 188 in react/NotifyAdmin.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
const header = ['Sku Id', 'Quantity Available', 'Email', 'Sent', 'Updated']

const result: any = []
Expand Down Expand Up @@ -297,6 +303,11 @@
</div>

<div className="bg-muted-5 pa8">
<div className="mb5">
<Alert type="warning">
{intl.formatMessage(messages.permissionWarning)}
</Alert>
</div>
<PageBlock
variation="annotated"
title={intl.formatMessage(messages.download)}
Expand Down
Loading