Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
9fc95a9
client/modules/User/reducers: update to ts, no-verify
clairep94 Oct 26, 2025
fda6632
client/modules/Users/reducers: update to named export and add types, …
clairep94 Oct 26, 2025
9623321
server/types/apiKey: add token? to apiKey
clairep94 Oct 26, 2025
3533425
server/PublicUser: update apiKeys to be sanitised api keys
clairep94 Oct 26, 2025
6bcdebf
update UserState in root redux to include User
clairep94 Oct 26, 2025
2c0342d
resolve remaining type-errors from PublicUser vs User apiKey differences
clairep94 Oct 26, 2025
70880de
client/modules/User/actions: update to ts, no-verify
clairep94 Oct 26, 2025
0ddb69d
client/modules/User/actions: add types from server user request/respo…
clairep94 Oct 26, 2025
aae6687
server/types/apiKey: update to add comment about token property on la…
clairep94 Oct 26, 2025
90335b3
server/types/apiKey: update toJson method return type to IApiKey
clairep94 Oct 26, 2025
276356f
server/types/PublicUser: update with accurate PublicUser apiKeys, sho…
clairep94 Oct 26, 2025
ad4df7a
client/modules/User/reducers: update root state of state.user to add …
clairep94 Oct 26, 2025
997180a
server/types/user: remove typo for totalSize optional
clairep94 Oct 27, 2025
fa7d951
client/modules/User/pages/EmailVerificationView: update to ts, no-verify
clairep94 Oct 26, 2025
c7f73e3
client/modules/User/pages/EmailVerificationView: add types for emailV…
clairep94 Oct 26, 2025
05998d9
client/modules/User/pages/EmailVerificationView: update to named export
clairep94 Oct 26, 2025
b56adb0
client/modules/User/pages/CollectionView: update to ts, no-verify
clairep94 Oct 26, 2025
c57ae93
client/modules/User/pages/CollectionView: add tests and update to nam…
clairep94 Oct 26, 2025
2fe9aa9
client/modules/User/pages/LoginView: update to ts, no-verify
clairep94 Oct 26, 2025
5db6d3a
resolve merge conflict with LoginView
clairep94 Oct 26, 2025
a2a5a00
client/modules/User/components/SocialAuthButton: update to ts, no-verify
clairep94 Oct 26, 2025
10490e2
client/modules/User/components/SocialAuthButton: update to named expo…
clairep94 Oct 26, 2025
01d99c7
client/modules/User/components/SocialAuthButton: add types & add Soci…
clairep94 Oct 26, 2025
0e8c664
client/modules/User/components/LoginForm: update to ts, no-verfy
clairep94 Oct 26, 2025
62cee39
client/modules/User/components/LoginForm: update to named export, no-…
clairep94 Oct 26, 2025
e8750ed
client/modules/User/components/LoginForm: update with types & update …
clairep94 Oct 26, 2025
0fcc661
client/modules/User/components/Notification: delete unused file
clairep94 Oct 26, 2025
af68d0b
client/modules/User/pages/NewPasswordView: update to ts, no-verify
clairep94 Oct 26, 2025
7758612
client/modules/User/pages/NewPasswordView: add types and update to na…
clairep94 Oct 26, 2025
edbf29e
client/modules/User/components/ResponseiveForm: delete unused file
clairep94 Oct 26, 2025
70d088f
package.json: add react-helmet types
clairep94 Oct 27, 2025
851681a
client/modules/User/pages/ResetPasswordView: update to ts, no-verify
clairep94 Oct 26, 2025
a647f19
client/modules/User/pages/ResetPasswordView: add types & update to na…
clairep94 Oct 26, 2025
9b49e68
client/modules/User/components/NewPasswordForm: update to ts, no-verify
clairep94 Oct 26, 2025
8d0fe3e
client/modules/User/components/NewPasswordForm: add types & update to…
clairep94 Oct 26, 2025
8226165
client/modules/User/pages/SignupView: update to ts, no-verify
clairep94 Oct 26, 2025
fd92236
client/modules/User/pages/SignupView: update to named export
clairep94 Oct 26, 2025
ad990c0
client/modules/User/components/ResetPasswordForm: update to ts, no-ve…
clairep94 Oct 26, 2025
c58e78b
client/modules/User/components/ResetPasswordForm: update named export…
clairep94 Oct 26, 2025
b8e7361
client/modules/User/components/SignupForm: update to ts, no-verify
clairep94 Oct 26, 2025
023096b
client/modules/User/components/SignupForm: add types and update to na…
clairep94 Oct 26, 2025
248e2c2
client/modules/User/components/CookieConsent: update to ts, no-verify
clairep94 Oct 27, 2025
ebe8215
client/modules/User/components/CookieConsent: add type dependencies, …
clairep94 Oct 27, 2025
57ab540
client/modules/User/components/VisibilityDropdown: update to ts, no-v…
clairep94 Oct 27, 2025
3e93724
client/modules/User/components/VisibilityDropdown: update to named ex…
clairep94 Oct 27, 2025
7302701
client/modules/User/components/DashboardTabSwitcher: update to ts, no…
clairep94 Oct 27, 2025
239b7f3
client/modules/User/components/DashboardTabSwitcher: update to named …
clairep94 Oct 27, 2025
619de8e
CollectionShareButton: update to ts, no-verify
clairep94 Oct 27, 2025
1468ad2
CollectionShareButton: update to named export, add ref type
clairep94 Oct 27, 2025
8b78e70
clean up stray leftover PropTypes
clairep94 Oct 27, 2025
16fc438
client/modules/User/pages/AccountView: update to ts, no-verify
clairep94 Oct 27, 2025
dc98920
client/modules/User/pages/AccountView: update to named export, resolv…
clairep94 Oct 27, 2025
6dc6910
client/modules/User/components/AccountForm: update to ts, no-verify
clairep94 Oct 27, 2025
c53a8e4
client/modules/User/components/AccountForm: add types & update to nam…
clairep94 Oct 27, 2025
e0d0342
client/modules/User/components/APIKeyForm: update to ts, no-verify
clairep94 Oct 27, 2025
5dcca1f
client/modules/User/components/APIKeyForm: add types & update to name…
clairep94 Oct 27, 2025
7a55433
client/modules/User/components/APIKeyList: update to ts,no-verify
clairep94 Oct 27, 2025
2496027
client/modules/User/components/APIKeyList: add types, remove extra Pr…
clairep94 Oct 27, 2025
79d584d
client/common/icons: update to ts, no-verify
clairep94 Oct 26, 2025
48b3705
client/common/icons: add types & update snapshot test
clairep94 Oct 26, 2025
12b1f7c
add GetRootState function type, and refactor modules/User/actions & p…
clairep94 Oct 27, 2025
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
1 change: 1 addition & 0 deletions client/common/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export interface ButtonProps extends React.HTMLAttributes<HTMLElement> {
* but React will automatically convert a boolean prop to the correct string value.
*/
focusable?: boolean;
label?: string;
}

interface StyledButtonProps extends ButtonProps {
Expand Down
40 changes: 26 additions & 14 deletions client/common/icons.jsx → client/common/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,25 @@ import Filter from '../images/filter.svg';
import Cross from '../images/cross.svg';
import Copy from '../images/copy.svg';

export interface IconColors {
default?: string;
hover?: string;
}

export interface IconProps extends React.SVGProps<SVGSVGElement> {
'aria-label'?: string;
Icon?: IconColors;
}

// HOC that adds the right web accessibility props
// https://www.scottohara.me/blog/2019/05/22/contextual-images-svgs-and-a11y.html

// could also give these a default size, color, etc. based on the theme
// Need to add size to these - like small icon, medium icon, large icon. etc.
function withLabel(SvgComponent) {
const StyledIcon = styled(SvgComponent)`
function withLabel(
SvgComponent: React.ComponentType<React.SVGProps<SVGSVGElement>>
) {
const StyledIcon = styled(SvgComponent)<IconProps>`
&&& {
color: ${(props) => props.Icon?.default};
& g,
Expand All @@ -53,27 +65,27 @@ function withLabel(SvgComponent) {
}
`;

const Icon = (props) => {
const { 'aria-label': ariaLabel } = props;
// Necessary because styled components inject a different type for the ref prop
type StyledIconProps = Omit<
React.ComponentProps<typeof StyledIcon>,
'ref'
> & {
ref?: React.Ref<SVGSVGElement>;
};

const Icon = (props: StyledIconProps) => {
const { 'aria-label': ariaLabel, ...rest } = props;
if (ariaLabel) {
return (
<StyledIcon
{...props}
{...rest}
aria-label={ariaLabel}
role="img"
focusable="false"
/>
);
}
return <StyledIcon {...props} aria-hidden focusable="false" />;
};

Icon.propTypes = {
'aria-label': PropTypes.string
};

Icon.defaultProps = {
'aria-label': null
return <StyledIcon {...rest} aria-hidden focusable="false" />;
};

return Icon;
Expand Down
24 changes: 13 additions & 11 deletions client/common/useSyncFormTranslations.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
import { useEffect, MutableRefObject } from 'react';
import type { FormApi } from 'final-form';

export interface FormLike {
getState(): { values: Record<string, unknown> };
reset(): void;
change(field: string, value: unknown): void;
}
// Generic FormLike that mirrors FormApi for any form value type
export type FormLike<FormValues = Record<string, unknown>> = Pick<
FormApi<FormValues>,
'getState' | 'reset' | 'change'
>;

/**
* This hook ensures that form values are preserved when the language changes.
* @param formRef
* @param language
*/
export const useSyncFormTranslations = (
formRef: MutableRefObject<FormLike>,
export const useSyncFormTranslations = <FormValues extends Record<string, any>>(
formRef: MutableRefObject<FormLike<FormValues> | null>,
language: string
) => {
useEffect(() => {
const form = formRef.current;
const form = formRef?.current;
if (!form) return;

const { values } = form.getState();
form.reset();

Object.keys(values).forEach((field) => {
if (values[field]) {
form.change(field, values[field]);
(Object.keys(values) as (keyof FormValues)[]).forEach((field) => {
const value = values[field];
if (value !== undefined && value !== null && value !== '') {
form.change(field, value);
}
});
}, [language]);
Expand Down
2 changes: 1 addition & 1 deletion client/modules/App/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { showReduxDevTools } from '../../store';
import DevTools from './components/DevTools';
import { setPreviousPath } from '../IDE/actions/ide';
import { setLanguage } from '../IDE/actions/preferences';
import CookieConsent from '../User/components/CookieConsent';
import { CookieConsent } from '../User/components/CookieConsent';

function hideCookieConsent(pathname) {
if (pathname.includes('/full/') || pathname.includes('/embed/')) {
Expand Down
2 changes: 1 addition & 1 deletion client/modules/IDE/actions/preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type {
UpdatePreferencesDispatch,
SetPreferencesTabValue,
SetFontSizeValue,
GetRootState,
SetLineNumbersValue,
SetAutocloseBracketsQuotesValue,
SetAutocompleteHinterValue,
Expand All @@ -20,6 +19,7 @@ import type {
SetLanguageValue,
SetThemeValue
} from './preferences.types';
import type { GetRootState } from '../../../reducers';

function updatePreferences(
formParams: UpdatePreferencesRequestBody,
Expand Down
4 changes: 1 addition & 3 deletions client/modules/IDE/actions/preferences.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as ActionTypes from '../../../constants';
import type { PreferencesState } from '../reducers/preferences';
import type { RootState } from '../../../reducers';
import type { GetRootState } from '../../../reducers';

// Value Definitions:
export type SetPreferencesTabValue = PreferencesState['tabIndex'];
Expand Down Expand Up @@ -112,5 +112,3 @@ export type PreferencesThunk = (
dispatch: UpdatePreferencesDispatch,
getState: GetRootState
) => void;

export type GetRootState = () => RootState;
2 changes: 1 addition & 1 deletion client/modules/IDE/components/Header/Toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import StopIcon from '../../../../images/stop.svg';
import PreferencesIcon from '../../../../images/preferences.svg';
import ProjectName from './ProjectName';
import VersionIndicator from '../VersionIndicator';
import VisibilityDropdown from '../../../User/components/VisibilityDropdown';
import { VisibilityDropdown } from '../../../User/components/VisibilityDropdown';
import { changeVisibility } from '../../actions/project';

const Toolbar = (props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ exports[`Nav renders dashboard version for mobile 1`] = `
>
<test-file-stub
aria-hidden="true"
classname="icons__StyledIcon-sc-xmer15-0 kjSZIe"
classname="icons__StyledIcon-sc-1rmv3zl-0 bKwKVB"
focusable="false"
/>
</button>
Expand All @@ -367,7 +367,7 @@ exports[`Nav renders dashboard version for mobile 1`] = `
>
<test-file-stub
aria-hidden="true"
classname="icons__StyledIcon-sc-xmer15-0 kjSZIe"
classname="icons__StyledIcon-sc-1rmv3zl-0 bKwKVB"
focusable="false"
/>
</button>
Expand Down Expand Up @@ -971,7 +971,7 @@ exports[`Nav renders editor version for mobile 1`] = `
>
<test-file-stub
aria-hidden="true"
classname="icons__StyledIcon-sc-xmer15-0 kjSZIe"
classname="icons__StyledIcon-sc-1rmv3zl-0 bKwKVB"
focusable="false"
/>
</button>
Expand All @@ -987,7 +987,7 @@ exports[`Nav renders editor version for mobile 1`] = `
>
<test-file-stub
aria-hidden="true"
classname="icons__StyledIcon-sc-xmer15-0 kjSZIe"
classname="icons__StyledIcon-sc-1rmv3zl-0 bKwKVB"
focusable="false"
/>
</button>
Expand Down
2 changes: 1 addition & 1 deletion client/modules/IDE/components/SketchListRowBase.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { TableDropdown } from '../../../components/Dropdown/TableDropdown';
import { MenuItem } from '../../../components/Dropdown/MenuItem';
import { formatDateToString } from '../../../utils/formatDate';
import { getConfig } from '../../../utils/getConfig';
import VisibilityDropdown from '../../User/components/VisibilityDropdown';
import { VisibilityDropdown } from '../../User/components/VisibilityDropdown';

const ROOT_URL = getConfig('API_URL');

Expand Down
Loading
Loading