diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index d9e92a820ba..9d18ec233a7 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -30,6 +30,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released - Fixed a bug where a user with multiple organizations could not log in anymore after one of their organization accounts got deactivated. [#6719](https://github.com/scalableminds/webknossos/pull/6719) - Fixed rare crash in new Datasets tab in dashboard. [#6750](https://github.com/scalableminds/webknossos/pull/6750) and [#6753](https://github.com/scalableminds/webknossos/pull/6753) - Fixed a bug where remote datasets without authentication could not be explored. [#6764](https://github.com/scalableminds/webknossos/pull/6764) +- Fixed deprecation warnings for antd props. [#6765](https://github.com/scalableminds/webknossos/pull/6765) ### Removed diff --git a/frontend/javascripts/admin/auth/accept_invite_view.tsx b/frontend/javascripts/admin/auth/accept_invite_view.tsx index a56b494d6ad..7c1c7e48dfc 100644 --- a/frontend/javascripts/admin/auth/accept_invite_view.tsx +++ b/frontend/javascripts/admin/auth/accept_invite_view.tsx @@ -22,7 +22,7 @@ export default function AcceptInviteView({ activeUser: APIUser | null | undefined; }) { const history = useHistory(); - const [isAuthenticationModalVisible, setIsAuthenticationModalVisible] = useState(false); + const [isAuthenticationModalOpen, setIsAuthenticationModalOpen] = useState(false); const [targetOrganization, exception] = useFetch( async () => { try { @@ -78,7 +78,7 @@ export default function AcceptInviteView({ Join this Organization ) : ( - ); @@ -94,7 +94,7 @@ export default function AcceptInviteView({ alertMessage={`Please register or login to join ${targetOrganizationName}.`} inviteToken={token} onLoggedIn={async (userJustRegistered) => { - setIsAuthenticationModalVisible(false); + setIsAuthenticationModalOpen(false); if (!userJustRegistered) { await onClickJoin(); @@ -104,8 +104,8 @@ export default function AcceptInviteView({ onSuccessfulJoin(userJustRegistered); } }} - onCancel={() => setIsAuthenticationModalVisible(false)} - visible={isAuthenticationModalVisible} + onCancel={() => setIsAuthenticationModalOpen(false)} + isOpen={isAuthenticationModalOpen} /> unknown; onCancel: () => void; - visible: boolean; + isOpen: boolean; alertMessage: string; inviteToken?: string; }; export default function AuthenticationModal({ onLoggedIn, onCancel, - visible, + isOpen, alertMessage, inviteToken, }: Props) { @@ -47,7 +47,7 @@ export default function AuthenticationModal({ ); return ( - + >( WrappedComponent: C, ): ComponentType> { return function Wrapper(props: AuthenticationProps

) { - const [isAuthenticationModalVisible, setIsAuthenticationModalVisible] = useState(false); + const [isAuthenticationModalOpen, setIsAuthenticationModalOpen] = useState(false); const { activeUser, authenticationMessage, onClick: originalOnClick, ...rest } = props; if (activeUser != null) { @@ -91,15 +91,15 @@ export function withAuthentication>( return ( <> {/* @ts-expect-error ts-migrate(2322) FIXME: Type 'Omit, "activeUser" | ... Remove this comment to see the full error message */} - setIsAuthenticationModalVisible(true)} /> + setIsAuthenticationModalOpen(true)} /> { - setIsAuthenticationModalVisible(false); + setIsAuthenticationModalOpen(false); originalOnClick(); }} - onCancel={() => setIsAuthenticationModalVisible(false)} - visible={isAuthenticationModalVisible} + onCancel={() => setIsAuthenticationModalOpen(false)} + isOpen={isAuthenticationModalOpen} /> ); diff --git a/frontend/javascripts/admin/dataset/dataset_add_zarr_view.tsx b/frontend/javascripts/admin/dataset/dataset_add_zarr_view.tsx index 3375c6cb211..63925f39cf6 100644 --- a/frontend/javascripts/admin/dataset/dataset_add_zarr_view.tsx +++ b/frontend/javascripts/admin/dataset/dataset_add_zarr_view.tsx @@ -176,7 +176,7 @@ function DatasetAddZarrView(props: Props) { setShowAddLayerModal(false)} > diff --git a/frontend/javascripts/admin/dataset/dataset_upload_view.tsx b/frontend/javascripts/admin/dataset/dataset_upload_view.tsx index 4308e9522d6..61ffc5637c8 100644 --- a/frontend/javascripts/admin/dataset/dataset_upload_view.tsx +++ b/frontend/javascripts/admin/dataset/dataset_upload_view.tsx @@ -433,7 +433,7 @@ class DatasetUploadView extends React.Component { const { isRetrying, isFinishing, uploadProgress, isUploading } = this.state; return ( ) => any; destroy?: (...args: Array) => any; organizationName: string; @@ -311,7 +311,7 @@ export class InviteUsersModal extends React.Component< return ( Invite Users @@ -497,7 +497,7 @@ class OnboardingView extends React.PureComponent { > {this.state.isDatasetUploadModalVisible && ( { {" "} this.setState({ isInviteModalVisible, diff --git a/frontend/javascripts/admin/project/transfer_all_tasks_modal.tsx b/frontend/javascripts/admin/project/transfer_all_tasks_modal.tsx index 82778ddee82..a07250c13f6 100644 --- a/frontend/javascripts/admin/project/transfer_all_tasks_modal.tsx +++ b/frontend/javascripts/admin/project/transfer_all_tasks_modal.tsx @@ -129,7 +129,7 @@ class TransferAllTasksModal extends React.PureComponent { if (!project) { return ( - +

{messages["project.none_selected"]}

); @@ -138,7 +138,7 @@ class TransferAllTasksModal extends React.PureComponent { return ( ; currentAnnotation: APIAnnotation | null | undefined; }; @@ -48,7 +48,7 @@ type State = { class TaskAnnotationView extends React.PureComponent { state: State = { currentAnnotation: null, - isTransferModalVisible: false, + isTransferModalOpen: false, annotations: [], }; @@ -94,7 +94,7 @@ class TaskAnnotationView extends React.PureComponent { updateAnnotationState = (updatedAnnotation: APIAnnotation) => { this.setState((prevState) => ({ - isTransferModalVisible: false, + isTransferModalOpen: false, annotations: prevState.annotations.map((a) => a.id === updatedAnnotation.id ? updatedAnnotation : a, ), @@ -131,7 +131,7 @@ class TaskAnnotationView extends React.PureComponent { onClick={() => this.setState({ currentAnnotation: annotation, - isTransferModalVisible: true, + isTransferModalOpen: true, }) } > @@ -219,11 +219,11 @@ class TaskAnnotationView extends React.PureComponent { {this.state.currentAnnotation?.owner ? ( this.setState({ - isTransferModalVisible: false, + isTransferModalOpen: false, }) } onChange={this.updateAnnotationState} diff --git a/frontend/javascripts/admin/task/task_list_view.tsx b/frontend/javascripts/admin/task/task_list_view.tsx index 385957abf43..005dad351cc 100644 --- a/frontend/javascripts/admin/task/task_list_view.tsx +++ b/frontend/javascripts/admin/task/task_list_view.tsx @@ -46,7 +46,7 @@ type State = { users: APIUser[]; searchQuery: string; selectedUserIdForAssignment: string | null; - isAnonymousTaskLinkModalVisible: boolean; + isAnonymousTaskLinkModalOpen: boolean; }; const typeHint: Array = []; const persistence = new Persistence>( @@ -63,7 +63,7 @@ class TaskListView extends React.PureComponent { users: [], searchQuery: "", selectedUserIdForAssignment: null, - isAnonymousTaskLinkModalVisible: Utils.hasUrlParam("showAnonymousLinks"), + isAnonymousTaskLinkModalOpen: Utils.hasUrlParam("showAnonymousLinks"), }; componentDidMount() { @@ -200,7 +200,7 @@ class TaskListView extends React.PureComponent { getAnonymousTaskLinkModal() { const anonymousTaskId = Utils.getUrlParamValue("showAnonymousLinks"); - if (!this.state.isAnonymousTaskLinkModalVisible) { + if (!this.state.isAnonymousTaskLinkModalOpen) { return null; } @@ -211,18 +211,18 @@ class TaskListView extends React.PureComponent { return ( { navigator.clipboard .writeText(tasksString) .then(() => Toast.success("Links copied to clipboard")); this.setState({ - isAnonymousTaskLinkModalVisible: false, + isAnonymousTaskLinkModalOpen: false, }); }} onCancel={() => this.setState({ - isAnonymousTaskLinkModalVisible: false, + isAnonymousTaskLinkModalOpen: false, }) } > diff --git a/frontend/javascripts/admin/team/create_team_modal_view.tsx b/frontend/javascripts/admin/team/create_team_modal_view.tsx index d0c0bf788bf..56ef7752eae 100644 --- a/frontend/javascripts/admin/team/create_team_modal_view.tsx +++ b/frontend/javascripts/admin/team/create_team_modal_view.tsx @@ -7,10 +7,10 @@ const FormItem = Form.Item; type Props = { onOk: (...args: Array) => any; onCancel: (...args: Array) => any; - isVisible: boolean; + isOpen: boolean; }; -function CreateTeamModalForm({ onOk: onOkCallback, onCancel, isVisible }: Props) { +function CreateTeamModalForm({ onOk: onOkCallback, onCancel, isOpen }: Props) { const [form] = Form.useForm(); const onOk = async () => { @@ -32,7 +32,7 @@ function CreateTeamModalForm({ onOk: onOkCallback, onCancel, isVisible }: Props) }; return ( - +
diff --git a/frontend/javascripts/admin/team/team_list_view.tsx b/frontend/javascripts/admin/team/team_list_view.tsx index ae83aebbf7d..5164866b03c 100644 --- a/frontend/javascripts/admin/team/team_list_view.tsx +++ b/frontend/javascripts/admin/team/team_list_view.tsx @@ -193,7 +193,7 @@ class TeamListView extends React.PureComponent { this.setState({ diff --git a/frontend/javascripts/admin/user/experience_modal_view.tsx b/frontend/javascripts/admin/user/experience_modal_view.tsx index 1f00dea7a89..ae2ea69f229 100644 --- a/frontend/javascripts/admin/user/experience_modal_view.tsx +++ b/frontend/javascripts/admin/user/experience_modal_view.tsx @@ -26,7 +26,7 @@ type TableEntry = { type Props = { onChange: (arg0: Array) => void; onCancel: () => void; - visible: boolean; + isOpen: boolean; selectedUsers: Array; initialDomainToEdit: string | null | undefined; }; @@ -230,7 +230,7 @@ class ExperienceModalView extends React.PureComponent { render() { const selectedUsersCount = this.props.selectedUsers.length; - if (!this.props.visible && selectedUsersCount === 0) { + if (!this.props.isOpen && selectedUsersCount === 0) { return null; } @@ -244,7 +244,7 @@ class ExperienceModalView extends React.PureComponent { ? `Change Experiences of ${selectedUsersCount} Users` : `Change Experiences for ${this.props.selectedUsers[0].firstName} ${this.props.selectedUsers[0].lastName}` } - visible={this.props.visible} + open={this.props.isOpen} onCancel={this.props.onCancel} width={multipleUsers ? 800 : 600} maskClosable={false} diff --git a/frontend/javascripts/admin/user/permissions_and_teams_modal_view.tsx b/frontend/javascripts/admin/user/permissions_and_teams_modal_view.tsx index 04c40b1b2b8..8a51d740aa0 100644 --- a/frontend/javascripts/admin/user/permissions_and_teams_modal_view.tsx +++ b/frontend/javascripts/admin/user/permissions_and_teams_modal_view.tsx @@ -23,7 +23,7 @@ enum PERMISSIONS { type TeamRoleModalProp = { onChange: (...args: Array) => any; onCancel: (...args: Array) => any; - visible: boolean; + isOpen: boolean; selectedUserIds: Key[]; users: Array; activeUser: APIUser; @@ -340,7 +340,7 @@ class PermissionsAndTeamsModalView extends React.PureComponent diff --git a/frontend/javascripts/admin/user/user_list_view.tsx b/frontend/javascripts/admin/user/user_list_view.tsx index 56ffa0d0879..96189349f17 100644 --- a/frontend/javascripts/admin/user/user_list_view.tsx +++ b/frontend/javascripts/admin/user/user_list_view.tsx @@ -51,9 +51,9 @@ type State = { isLoading: boolean; users: Array; selectedUserIds: Key[]; - isExperienceModalVisible: boolean; - isTeamRoleModalVisible: boolean; - isInviteModalVisible: boolean; + isExperienceModalOpen: boolean; + isTeamRoleModalOpen: boolean; + isInviteModalOpen: boolean; singleSelectedUser: APIUser | null | undefined; activationFilter: Array<"true" | "false">; searchQuery: string; @@ -73,9 +73,9 @@ class UserListView extends React.PureComponent { isLoading: true, users: [], selectedUserIds: [], - isExperienceModalVisible: false, - isTeamRoleModalVisible: false, - isInviteModalVisible: false, + isExperienceModalOpen: false, + isTeamRoleModalOpen: false, + isInviteModalOpen: false, activationFilter: ["true"], searchQuery: "", singleSelectedUser: null, @@ -90,7 +90,7 @@ class UserListView extends React.PureComponent { if (location.hash === "#invite") { this.setState({ - isInviteModalVisible: true, + isInviteModalOpen: true, }); } } @@ -131,7 +131,7 @@ class UserListView extends React.PureComponent { this.setState({ users: newUsers, selectedUserIds: [selectedUser.id], - isTeamRoleModalVisible: isActive, + isTeamRoleModalOpen: isActive, }); }, () => {}, // Do nothing, change did not succeed @@ -169,8 +169,8 @@ class UserListView extends React.PureComponent { handleUsersChange = (updatedUsers: Array): void => { this.setState({ users: updatedUsers, - isExperienceModalVisible: false, - isTeamRoleModalVisible: false, + isExperienceModalOpen: false, + isTeamRoleModalOpen: false, }); }; @@ -178,7 +178,7 @@ class UserListView extends React.PureComponent { const updatedUsersMap = _.keyBy(updatedUsers, (u) => u.id); this.setState((prevState) => ({ - isExperienceModalVisible: false, + isExperienceModalOpen: false, users: prevState.users.map((user) => updatedUsersMap[user.id] || user), singleSelectedUser: null, selectedUserIds: prevState.singleSelectedUser == null ? [] : prevState.selectedUserIds, @@ -246,7 +246,7 @@ class UserListView extends React.PureComponent { renderInviteUsersAlert() { const inviteUsersCallback = () => this.setState({ - isInviteModalVisible: true, + isInviteModalOpen: true, }); const noUsersMessage = ( @@ -359,7 +359,7 @@ class UserListView extends React.PureComponent {