Skip to content

Commit

Permalink
lock react-aria and react-aria-components to specific versions that work
Browse files Browse the repository at this point in the history
  • Loading branch information
Frizi committed Jan 6, 2025
1 parent 62bba23 commit a110035
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 79 deletions.
4 changes: 2 additions & 2 deletions app/gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@
"postcss-nesting": "^12.1.5",
"qrcode.react": "3.1.0",
"react": "^18.3.1",
"react-aria": "^3.36.0",
"react-aria-components": "^1.5.0",
"react-aria": "3.34.3",
"react-aria-components": "1.3.3",
"react-compiler-runtime": "19.0.0-beta-a7bf2bd-20241110",
"react-dom": "^18.3.1",
"react-error-boundary": "4.0.13",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export const Button: (props: ButtonProps & { ref?: ForwardedRef<HTMLButtonElemen
}
})()

const tooltipElement = shouldShowTooltip ? tooltip ?? ariaProps['aria-label'] : null
const tooltipElement = shouldShowTooltip ? (tooltip ?? ariaProps['aria-label']) : null

const isLoading = loading || implicitlyLoading
const isDisabled = props.isDisabled ?? isLoading
Expand Down
24 changes: 21 additions & 3 deletions app/gui/src/dashboard/components/dashboard/AssetRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ export const AssetRow = React.memo(function AssetRow(props: AssetRowProps) {
case backendModule.AssetType.specialError: {
return <AssetSpecialRow columnsLength={columns.length} depth={depth} type={type} />
}
case backendModule.AssetType.project:
case backendModule.AssetType.file:
case backendModule.AssetType.secret:
case backendModule.AssetType.datalink:
case backendModule.AssetType.directory:
default: {
// This is safe because we filter out special asset types in the switch statement above.
// eslint-disable-next-line no-restricted-syntax
Expand Down Expand Up @@ -224,6 +229,11 @@ const AssetSpecialRow = React.memo(function AssetSpecialRow(props: AssetSpecialR
</tr>
)
}
case backendModule.AssetType.project:
case backendModule.AssetType.file:
case backendModule.AssetType.secret:
case backendModule.AssetType.datalink:
case backendModule.AssetType.directory:
default: {
invariant(false, 'Unsupported special asset type: ' + type)
}
Expand Down Expand Up @@ -325,11 +335,11 @@ export function RealAssetInternalRow(props: RealAssetRowInternalProps) {

const isDeleting =
useBackendMutationState(backend, 'deleteAsset', {
predicate: ({ state: { variables: [assetId] = [] } }) => assetId === asset.id,
predicate: ({ state: { variables } }) => variables?.[0] === asset.id,
}).length !== 0
const isRestoring =
useBackendMutationState(backend, 'undoDeleteAsset', {
predicate: ({ state: { variables: [assetId] = [] } }) => assetId === asset.id,
predicate: ({ state: { variables } }) => variables?.[0] === asset.id,
}).length !== 0

const isCloud = isCloudCategory(category)
Expand Down Expand Up @@ -366,7 +376,7 @@ export function RealAssetInternalRow(props: RealAssetRowInternalProps) {
const visibility =
isRemovingSelf ? Visibility.hidden
: visibilityRaw === Visibility.visible ? insertionVisibility
: visibilityRaw ?? insertionVisibility
: (visibilityRaw ?? insertionVisibility)
const hidden = isDeleting || isRestoring || hiddenRaw || visibility === Visibility.hidden

const setSelected = useEventCallback((newSelected: boolean) => {
Expand Down Expand Up @@ -543,6 +553,11 @@ export function RealAssetInternalRow(props: RealAssetRowInternalProps) {
}
break
}
case backendModule.AssetType.secret:
case backendModule.AssetType.directory:
case backendModule.AssetType.specialLoading:
case backendModule.AssetType.specialEmpty:
case backendModule.AssetType.specialError:
default: {
toastAndLog('downloadInvalidTypeError')
break
Expand Down Expand Up @@ -869,6 +884,9 @@ export function RealAssetInternalRow(props: RealAssetRowInternalProps) {
</>
)
}
case backendModule.AssetType.specialLoading:
case backendModule.AssetType.specialEmpty:
case backendModule.AssetType.specialError:
default: {
invariant(
false,
Expand Down
4 changes: 2 additions & 2 deletions app/gui/src/dashboard/hooks/backendHooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ export function useListUserGroupsWithUsers(
return null
} else {
const result = listUserGroupsQuery.data.map((userGroup) => {
const usersInGroup: readonly User[] = listUsersQuery.data.filter((user) =>
user.userGroups?.includes(userGroup.id),
const usersInGroup: readonly User[] = listUsersQuery.data.filter(
(user) => user.userGroups?.includes(userGroup.id) ?? false,
)
return { ...userGroup, users: usersInGroup }
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import SessionProvider from '../SessionProvider'

describe('SessionProvider', () => {
const mainPageUrl = new URL('https://enso.dev')
const userSession = vi.fn<[], Promise<UserSession>>(() =>
Promise.resolve({
const userSession = vi.fn(() =>
Promise.resolve<UserSession>({
email: '[email protected]',
accessToken: 'accessToken',
refreshToken: 'refreshToken',
Expand Down
8 changes: 6 additions & 2 deletions app/gui/src/project-view/components/TooltipTrigger.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<script setup lang="ts">
import { useTooltipRegistry } from '@/providers/tooltipRegistry'
import { usePropagateScopesToAllRoots } from '@/util/patching'
import { toRef, useSlots } from 'vue'
import { toRef } from 'vue'
usePropagateScopesToAllRoots()
const registry = useTooltipRegistry()
const slots = useSlots()
const slots = defineSlots<{
default(props: any): any
tooltip(): any
}>()
const tooltipSlot = toRef(slots, 'tooltip')
const registered = registry.registerTooltip(tooltipSlot)
function onEnter(e: PointerEvent) {
Expand Down
15 changes: 7 additions & 8 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const RESTRICTED_SYNTAXES = [
// === ESLint configuration ===
// ============================

export default [
const config = [
{
// Playwright build cache and Vite build directory.
ignores: [
Expand All @@ -212,12 +212,6 @@ export default [
tsconfigRootDir: DIR_NAME,
ecmaVersion: 'latest',
extraFileExtensions: ['.vue'],
projectService: {
allowDefaultProject: [
'app/ydoc-server/vitest.config.ts',
'app/ydoc-shared/vitest.config.ts',
],
},
},
},
rules: {
Expand Down Expand Up @@ -451,7 +445,10 @@ export default [
'@typescript-eslint/restrict-template-expressions': 'error',
'@typescript-eslint/sort-type-constituents': 'error',
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/switch-exhaustiveness-check': [
'error',
{ allowDefaultCaseForExhaustiveSwitch: true },
],
'default-param-last': 'off',
'@typescript-eslint/default-param-last': 'error',
'no-invalid-this': 'off',
Expand Down Expand Up @@ -591,3 +588,5 @@ export default [
rules: { 'react-compiler/react-compiler': 'error' },
},
]

export default config
Loading

0 comments on commit a110035

Please sign in to comment.