Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #3082

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MirroredPageFieldWidget(forms.widgets.Select):
#: The current language slug
language_slug: str | None = None

# pylint: disable=too-many-arguments
# pylint: disable=too-many-arguments, too-many-positional-arguments
def create_option(
self,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion integreat_cms/cms/forms/pages/parent_field_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ParentFieldWidget(forms.widgets.Select):
#: The form this field is bound to
form = None

# pylint: disable=too-many-arguments
# pylint: disable=too-many-arguments,too-many-positional-arguments
def create_option(
self,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion integreat_cms/cms/forms/regions/region_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def duplicate_language_tree(
)


# pylint: disable=too-many-locals
# pylint: disable=too-many-locals, too-many-positional-arguments
def duplicate_pages(
source_region: Region,
target_region: Region,
Expand Down
2 changes: 1 addition & 1 deletion integreat_cms/cms/forms/users/organization_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class OrganizationFieldWidget(Select):
Select widget which puts the organization's region id as data attribute on <options>
"""

# pylint: disable=too-many-arguments
# pylint: disable=too-many-arguments, too-many-positional-arguments
def create_option(
self,
name: str,
Expand Down
2 changes: 1 addition & 1 deletion integreat_cms/cms/forms/users/password_reset_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CustomPasswordResetForm(PasswordResetForm):
widget=forms.EmailInput(attrs={"autocomplete": "email"}),
)

# pylint: disable=signature-differs
# pylint: disable=signature-differs,too-many-positional-arguments
def send_mail(
self,
subject_template_name: str,
Expand Down
2 changes: 1 addition & 1 deletion integreat_cms/cms/utils/media_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def generate_thumbnail(
# Get minimum of original size of the image because ImageOps.fit would otherwise increase the image size
size = min(image.width, image.height, size)
# Resize and crop the image into a square of at most the specified size.
image = ImageOps.fit(image, (size, size), method=Image.LANCZOS) # type: ignore[attr-defined]
image = ImageOps.fit(image, (size, size), method=Image.LANCZOS) # type: ignore[attr-defined,assignment]
else:
# Resize the image so that the longer side is at most the specified size
image.thumbnail((size, size), resample=Image.LANCZOS) # type: ignore[attr-defined]
Expand Down
6 changes: 4 additions & 2 deletions integreat_cms/static/src/css/style.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "sass:color";

// Country flags - define these before tailwind to make it possible to override
$fp-prepend: true;
$fp-enable-1x1: false;
Expand Down Expand Up @@ -27,8 +29,8 @@ $fp-4x3-path: "flagpack-dart-sass/flags/4x3/";

$list-bg-color: white;
$list-border-color: lightgray;
$hover-bg-color: darken($list-border-color, 20%);
$active-bg-color: darken($list-border-color, 10%);
$hover-bg-color: color.adjust($list-border-color, $lightness: -20%);
$active-bg-color: color.adjust($list-border-color, $lightness: -10%);

body,
html {
Expand Down
2 changes: 1 addition & 1 deletion integreat_cms/static/src/js/analytics/hix-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const updateHixFeedback = (hixFeedback: string) => {
feedbackSections.forEach((feedbackSection) => {
const categoryName = feedbackSection.getAttribute("hix-feedback-category");
const feedbackEntry = feedbackJson.find((item: { category: string }) => item.category === categoryName);
let feedbackResult = feedbackEntry ? feedbackEntry.result : [] || Number;
let feedbackResult = feedbackEntry ? feedbackEntry.result : [];

// Cast array into number if HIX feedback is in the old format
if (feedbackResult instanceof Array) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { route } from "preact-router";
import { FolderPlus } from "lucide-preact";
import { StateUpdater } from "preact/hooks";
import { Dispatch, StateUpdater } from "preact/hooks";
import { MediaApiPaths } from "../index";

type Props = {
Expand All @@ -12,7 +12,7 @@ type Props = {
mediaTranslations: any;
submitForm: (event: Event, successCallback: (data: any) => void) => void;
isLoading: boolean;
setCreateDirectory: StateUpdater<boolean>;
setCreateDirectory: Dispatch<StateUpdater<boolean>>;
};
const CreateDirectory = ({
parentDirectoryId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This component renders a grid of all subdirectories and all files of the current directory
*/
import { Link } from "preact-router";
import { StateUpdater } from "preact/hooks";
import { Dispatch, StateUpdater } from "preact/hooks";

import { MediaLibraryEntry, File, Directory } from "..";
import DirectoryEntry from "./directory-entry";
Expand All @@ -14,7 +14,7 @@ export type DraggedElement = {
};

type Props = {
fileIndexState: [number | null, StateUpdater<number | null>];
fileIndexState: [number | null, Dispatch<StateUpdater<number | null>>];
mediaLibraryContent: MediaLibraryEntry[];
mediaTranslations: any;
globalEdit?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* 6. submitForm() submits the deletion form via AJAX
* 7. On success, the media library is refreshed
*/
import { StateUpdater, useEffect, useState } from "preact/hooks";
import { Dispatch, StateUpdater, useEffect, useState } from "preact/hooks";
import {
AlertTriangle,
CheckCircle,
Expand All @@ -38,7 +38,7 @@ import { showConfirmationPopupAjax } from "../../confirmation-popups";
import { MediaApiPaths, File, MediaLibraryEntry, FileUsages } from "../index";

type Props = {
fileIndexState: [number | null, StateUpdater<number | null>];
fileIndexState: [number | null, Dispatch<StateUpdater<number | null>>];
mediaLibraryContent: MediaLibraryEntry[];
apiEndpoints: MediaApiPaths;
mediaTranslations: any;
Expand All @@ -52,7 +52,7 @@ type Props = {
url: string,
urlParams: URLSearchParams,
successCallback: (data: any) => void,
loadingSetter?: StateUpdater<boolean>
loadingSetter?: Dispatch<StateUpdater<boolean>>
) => void;
isLoading: boolean;
canDeleteFile: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This component renders a file upload field
*/
import { StateUpdater, useEffect, useRef } from "preact/hooks";
import { Dispatch, StateUpdater, useEffect, useRef } from "preact/hooks";
import { FilePlus } from "lucide-preact";
import Dropzone from "dropzone";
import "dropzone/dist/dropzone.css";
Expand All @@ -11,14 +11,14 @@ import { getCsrfToken } from "../../utils/csrf-token";

type Props = {
directory: Directory;
setUploadFile: StateUpdater<boolean>;
setUploadFile: Dispatch<StateUpdater<boolean>>;
apiEndpoints: MediaApiPaths;
mediaTranslations: any;
mediaTypes: { allowedMediaTypes: string };
submitForm: (event: Event, successCallback: () => void) => any;
/* eslint-disable-next-line react/no-unused-prop-types */
isLoading: boolean;
refreshState: [boolean, StateUpdater<boolean>];
refreshState: [boolean, Dispatch<StateUpdater<boolean>>];
};

const UploadFile = ({
Expand Down
18 changes: 9 additions & 9 deletions integreat_cms/static/src/js/media-management/library.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* so new directories and files can be added and the existing entries can be modified
*/
import { FilePlus, FolderPlus, Search, Loader, Filter, FilterX, X } from "lucide-preact";
import { StateUpdater, useEffect, useState } from "preact/hooks";
import { Dispatch, StateUpdater, useEffect, useState } from "preact/hooks";
import { route } from "preact-router";
import cn from "classnames";

Expand All @@ -24,13 +24,13 @@ export type LibraryProps = {
directoryId?: string;
searchQuery?: string;
mediaFilter?: string;
loadingState: [boolean, StateUpdater<boolean>];
refreshState: [boolean, StateUpdater<boolean>];
mediaLibraryContentState: [MediaLibraryEntry[], StateUpdater<MediaLibraryEntry[]>];
directoryPathState: [Directory[], StateUpdater<Directory[]>];
fileIndexState: [number, StateUpdater<number>];
sidebarFileState: [File, StateUpdater<File>];
showMessage: StateUpdater<Message>;
loadingState: [boolean, Dispatch<StateUpdater<boolean>>];
refreshState: [boolean, Dispatch<StateUpdater<boolean>>];
mediaLibraryContentState: [MediaLibraryEntry[], Dispatch<StateUpdater<MediaLibraryEntry[]>>];
directoryPathState: [Directory[], Dispatch<StateUpdater<Directory[]>>];
fileIndexState: [number, Dispatch<StateUpdater<number>>];
sidebarFileState: [File, Dispatch<StateUpdater<File>>];
showMessage: Dispatch<StateUpdater<Message>>;
apiEndpoints: MediaApiPaths;
mediaTranslations: any;
globalEdit?: boolean;
Expand All @@ -43,7 +43,7 @@ export type LibraryProps = {
url: string,
urlParams: URLSearchParams,
successCallback: (data: any) => void,
loadingSetter?: StateUpdater<boolean>
loadingSetter?: Dispatch<StateUpdater<boolean>>
) => void;
canDeleteFile: boolean;
canReplaceFile: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* This component renders the opening hours of a location
*/
import cn from "classnames";
import { StateUpdater } from "preact/hooks";
import { Dispatch, StateUpdater } from "preact/hooks";
import { OpeningHours } from "../index";

type Props = {
openingHours: OpeningHours[];
setSelectedDays: StateUpdater<number[]>;
setSelectedDays: Dispatch<StateUpdater<number[]>>;
translations: any;
days: any;
canChangeLocation: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/*
* This component renders the input fields for opening hours of locations
*/
import { StateUpdater, useEffect, useState } from "preact/hooks";
import { Dispatch, StateUpdater, useEffect, useState } from "preact/hooks";
import cn from "classnames";
import { XCircle, CalendarClock } from "lucide-preact";

import { deepCopy } from "../../../utils/deep-copy";
import { OpeningHours } from "../index";

type Props = {
openingHoursState: [OpeningHours[], StateUpdater<OpeningHours[]>];
selectedDaysState: [number[], StateUpdater<number[]>];
openingHoursState: [OpeningHours[], Dispatch<StateUpdater<OpeningHours[]>>];
selectedDaysState: [number[], Dispatch<StateUpdater<number[]>>];
translations: any;
days: any;
};
Expand Down
Loading
Loading