2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 03:55:41 +00:00

Notification permissions (#9449)

* Updated type hints

* Fix tooltip bug

* Check user when sending notification

* Fix test

* Update unit test

* More unit test fixes

* Tweak playwright tests
This commit is contained in:
Oliver
2025-04-05 10:30:58 +11:00
committed by GitHub
parent f66efa7733
commit 544a3c6263
10 changed files with 141 additions and 59 deletions

View File

@ -54,7 +54,11 @@ export default function StarredToggleButton({
color={instance.starred ? 'green' : 'blue'}
size='lg'
variant={instance.starred ? 'filled' : 'outline'}
tooltip={t`Unsubscribe from part`}
tooltip={
instance.starred
? t`Unsubscribe from notifications`
: t`Subscribe to notifications`
}
onClick={() => change(instance.starred, instance.pk)}
tooltipAlignment='bottom'
/>

View File

@ -75,9 +75,14 @@ test('Plugins - Functionality', async ({ browser }) => {
// Activate the plugin
const cell = await page.getByText('Sample API Caller', { exact: true });
await clickOnRowMenu(cell);
await page.getByRole('menuitem', { name: 'Activate' }).click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('The plugin was activated').waitFor();
await page.waitForTimeout(100);
// Activate the plugin (unless already activated)
if ((await page.getByRole('menuitem', { name: 'Deactivate' }).count()) == 0) {
await page.getByRole('menuitem', { name: 'Activate' }).click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('The plugin was activated').waitFor();
}
// Deactivate the plugin again
await clickOnRowMenu(cell);