mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-06 03:51:34 +00:00
[Documentation] Remove package credits (#8811)
* Remove hard-coded credits from docs - Extract *actual* package credits - Auto-build into docs * Include URLs when generating python license data * Update readthedocs process * Better URL extraction * Adjust build process for RTD * Spelling fixes * Install node and yarn * Command fix * Improved library sorting * Improved error message * Remove credits.md * Cleanup * Further cleanup * Tweak playwright test * Handle uncaught exception in fetchIcons * Fix for CORS settings in playwright testing * Enhance login check * Fix for barcode test --------- Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
@@ -1136,12 +1136,7 @@ COOKIE_MODE = (
|
||||
# Valid modes (as per the django settings documentation)
|
||||
valid_cookie_modes = ['lax', 'strict', 'none']
|
||||
|
||||
if not DEBUG and not TESTING and COOKIE_MODE in valid_cookie_modes:
|
||||
# Set the cookie mode (in production mode only)
|
||||
COOKIE_MODE = COOKIE_MODE.capitalize()
|
||||
else:
|
||||
# Default to False, as per the Django settings
|
||||
COOKIE_MODE = False
|
||||
COOKIE_MODE = COOKIE_MODE.capitalize() if COOKIE_MODE in valid_cookie_modes else False
|
||||
|
||||
# Additional CSRF settings
|
||||
CSRF_HEADER_NAME = 'HTTP_X_CSRFTOKEN'
|
||||
@@ -1149,13 +1144,14 @@ CSRF_COOKIE_NAME = 'csrftoken'
|
||||
|
||||
CSRF_COOKIE_SAMESITE = COOKIE_MODE
|
||||
SESSION_COOKIE_SAMESITE = COOKIE_MODE
|
||||
LANGUAGE_COOKIE_SAMESITE = COOKIE_MODE
|
||||
|
||||
"""Set the SESSION_COOKIE_SECURE value based on the following rules:
|
||||
- False if the server is running in DEBUG mode
|
||||
- True if samesite cookie setting is set to 'None'
|
||||
- Otherwise, use the value specified in the configuration file (or env var)
|
||||
"""
|
||||
SESSION_COOKIE_SECURE = (
|
||||
COOKIE_SECURE = (
|
||||
False
|
||||
if DEBUG
|
||||
else (
|
||||
@@ -1166,6 +1162,10 @@ SESSION_COOKIE_SECURE = (
|
||||
)
|
||||
)
|
||||
|
||||
CSRF_COOKIE_SECURE = COOKIE_SECURE
|
||||
SESSION_COOKIE_SECURE = COOKIE_SECURE
|
||||
LANGUAGE_COOKIE_SECURE = COOKIE_SECURE
|
||||
|
||||
# Ref: https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-SECURE_PROXY_SSL_HEADER
|
||||
if ssl_header := get_boolean_setting(
|
||||
'INVENTREE_USE_X_FORWARDED_PROTO', 'use_x_forwarded_proto', False
|
||||
|
@@ -40,7 +40,10 @@ export default defineConfig({
|
||||
env: {
|
||||
INVENTREE_DEBUG: 'True',
|
||||
INVENTREE_PLUGINS_ENABLED: 'True',
|
||||
INVENTREE_ADMIN_URL: 'test-admin'
|
||||
INVENTREE_ADMIN_URL: 'test-admin',
|
||||
INVENTREE_SITE_URL: 'http://localhost:8000',
|
||||
INVENTREE_CORS_ORIGIN_ALLOW_ALL: 'True',
|
||||
INVENTREE_COOKIE_SAMESITE: 'Lax'
|
||||
},
|
||||
url: 'http://127.0.0.1:8000/api/',
|
||||
reuseExistingServer: !process.env.CI,
|
||||
|
@@ -27,8 +27,7 @@ export function Boundary({
|
||||
}>): ReactNode {
|
||||
const onError = useCallback(
|
||||
(error: unknown, componentStack: string | undefined, eventId: string) => {
|
||||
console.error(`Error rendering component: ${label}`);
|
||||
console.error(error, componentStack);
|
||||
console.error(`ERR: Error rendering component: ${label}`);
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
@@ -36,7 +36,18 @@ export const useIconState = create<IconState>()((set, get) => ({
|
||||
fetchIcons: async () => {
|
||||
if (get().hasLoaded) return;
|
||||
|
||||
const packs = await api.get(apiUrl(ApiEndpoints.icons));
|
||||
const packs = await api.get(apiUrl(ApiEndpoints.icons)).catch((_error) => {
|
||||
console.error('ERR: Could not fetch icon packages');
|
||||
showNotification({
|
||||
title: t`Error`,
|
||||
message: t`Error loading icon package from server`,
|
||||
color: 'red'
|
||||
});
|
||||
});
|
||||
|
||||
if (!packs) {
|
||||
return;
|
||||
}
|
||||
|
||||
await Promise.all(
|
||||
packs.data.map(async (pack: any) => {
|
||||
|
@@ -34,6 +34,7 @@ export const doQuickLogin = async (
|
||||
await page.goto(`${url}/login/?login=${username}&password=${password}`);
|
||||
await page.waitForURL('**/platform/home');
|
||||
|
||||
await page.getByLabel('navigation-menu').waitFor();
|
||||
await page.getByText(/InvenTree Demo Server -/).waitFor();
|
||||
};
|
||||
|
||||
|
@@ -35,8 +35,24 @@ test('Purchase Orders - Barcodes', async ({ page }) => {
|
||||
await page.getByRole('img', { name: 'QR Code' }).waitFor();
|
||||
await page.getByRole('banner').getByRole('button').click();
|
||||
|
||||
// Link to barcode
|
||||
// Un-link barcode if a link exists
|
||||
await page.getByLabel('action-menu-barcode-actions').click();
|
||||
await page.waitForTimeout(100);
|
||||
|
||||
if (
|
||||
await page
|
||||
.getByLabel('action-menu-barcode-actions-unlink-barcode')
|
||||
.isVisible()
|
||||
) {
|
||||
await page.getByLabel('action-menu-barcode-actions-unlink-barcode').click();
|
||||
await page.getByRole('button', { name: 'Unlink Barcode' }).click();
|
||||
await page.waitForTimeout(100);
|
||||
} else {
|
||||
await page.keyboard.press('Escape');
|
||||
}
|
||||
|
||||
// Link to barcode
|
||||
await page.getByLabel('action-menu-barcode-actions', { exact: true }).click();
|
||||
await page.getByLabel('action-menu-barcode-actions-link-barcode').click();
|
||||
|
||||
await page.getByLabel('barcode-input-scanner').click();
|
||||
@@ -49,7 +65,7 @@ test('Purchase Orders - Barcodes', async ({ page }) => {
|
||||
await page.getByRole('button', { name: 'Issue Order' }).waitFor();
|
||||
|
||||
// Ensure we can scan back to this page, with the associated barcode
|
||||
await page.goto(`${baseUrl}/home`);
|
||||
await page.goto(`${baseUrl}/`);
|
||||
await page.waitForTimeout(250);
|
||||
await page.getByRole('button', { name: 'Open Barcode Scanner' }).click();
|
||||
await page.getByPlaceholder('Enter barcode data').fill('1234567890');
|
||||
|
Reference in New Issue
Block a user