mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 98d54da0de | |||
| 4b638ae346 | |||
| abb849e1f6 | |||
| 2ec65e3dfc | |||
| 4e493972e5 |
@@ -125,8 +125,8 @@ function Collaborators(props: Props) {
|
||||
|
||||
return (
|
||||
<AvatarWithPresence
|
||||
{...rest}
|
||||
key={collaborator.id}
|
||||
{...rest}
|
||||
user={collaborator}
|
||||
isPresent={isPresent}
|
||||
isEditing={isEditing}
|
||||
|
||||
@@ -31,7 +31,7 @@ const HoverPreviewIssue = React.forwardRef(function _HoverPreviewIssue(
|
||||
const authorName = author.name;
|
||||
const urlObj = new URL(url);
|
||||
let service;
|
||||
|
||||
|
||||
if (urlObj.hostname === "github.com") {
|
||||
service = IntegrationService.GitHub;
|
||||
} else if (urlObj.hostname === "gitlab.com") {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from "react";
|
||||
import lazyWithRetry from "~/utils/lazyWithRetry";
|
||||
|
||||
export interface LazyComponent<T extends React.ComponentType<any>> {
|
||||
export interface LazyComponent<T extends React.ComponentType<unknown>> {
|
||||
Component: React.LazyExoticComponent<T>;
|
||||
preload: () => Promise<{ default: T }>;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ interface LazyLoadOptions {
|
||||
* MyComponent.preload();
|
||||
* ```
|
||||
*/
|
||||
export function createLazyComponent<T extends React.ComponentType<any>>(
|
||||
export function createLazyComponent<T extends React.ComponentType<unknown>>(
|
||||
factory: () => Promise<{ default: T }>,
|
||||
options: LazyLoadOptions = {}
|
||||
): LazyComponent<T> {
|
||||
|
||||
@@ -14,7 +14,7 @@ describe("PaginatedList", () => {
|
||||
i18n,
|
||||
tReady: true,
|
||||
t: ((key: string) => key) as TFunction,
|
||||
} as any;
|
||||
} as unknown;
|
||||
|
||||
it("with no items renders nothing", () => {
|
||||
const result = render(
|
||||
|
||||
@@ -34,11 +34,11 @@ interface Props<T extends PaginatedItem>
|
||||
* @param options Pagination and other query options
|
||||
*/
|
||||
fetch?: (
|
||||
options: Record<string, any> | undefined
|
||||
options: Record<string, unknown> | undefined
|
||||
) => Promise<unknown[] | undefined> | undefined;
|
||||
|
||||
/** Additional options to pass to the fetch function */
|
||||
options?: Record<string, any>;
|
||||
options?: Record<string, unknown>;
|
||||
|
||||
/** Optional header content to display above the list */
|
||||
heading?: React.ReactNode;
|
||||
@@ -77,7 +77,9 @@ interface Props<T extends PaginatedItem>
|
||||
* Function to render section headings (typically date-based)
|
||||
* @param name The heading text or element to render
|
||||
*/
|
||||
renderHeading?: (name: React.ReactElement<any> | string) => React.ReactNode;
|
||||
renderHeading?: (
|
||||
name: React.ReactElement<unknown> | string
|
||||
) => React.ReactNode;
|
||||
|
||||
/**
|
||||
* Handler for escape key press
|
||||
@@ -206,7 +208,7 @@ const PaginatedList = <T extends PaginatedItem>({
|
||||
if (fetch) {
|
||||
void fetchResults();
|
||||
}
|
||||
}, [fetch]);
|
||||
}, [fetch, fetchResults]);
|
||||
|
||||
// Handle updates to fetch or options
|
||||
React.useEffect(() => {
|
||||
|
||||
@@ -9,7 +9,7 @@ function Toasts() {
|
||||
|
||||
return (
|
||||
<StyledToaster
|
||||
theme={ui.resolvedTheme as any}
|
||||
theme={ui.resolvedTheme as unknown}
|
||||
closeButton
|
||||
toastOptions={{
|
||||
duration: 5000,
|
||||
|
||||
@@ -87,7 +87,7 @@ function useIsActive(state: EditorState) {
|
||||
|
||||
const slice = selection.content();
|
||||
const fragment = slice.content;
|
||||
const nodes = (fragment as any).content;
|
||||
const nodes = (fragment as unknown).content;
|
||||
|
||||
return some(nodes, (n) => n.content.size);
|
||||
}
|
||||
|
||||
+2
-2
@@ -125,7 +125,7 @@ export type Action = {
|
||||
* Perform the action – note this should generally not be called directly, use `performAction`
|
||||
* instead. Errors will be caught and displayed to the user as a toast message.
|
||||
*/
|
||||
perform?: (context: ActionContext) => any;
|
||||
perform?: (context: ActionContext) => unknown;
|
||||
to?: string | { url: string; target?: string };
|
||||
children?: ((context: ActionContext) => Action[]) | Action[];
|
||||
};
|
||||
@@ -154,7 +154,7 @@ export type ActionV2 = BaseActionV2 & {
|
||||
tooltip?:
|
||||
| ((context: ActionContext) => React.ReactChild | undefined)
|
||||
| React.ReactChild;
|
||||
perform: (context: ActionContext) => any;
|
||||
perform: (context: ActionContext) => unknown;
|
||||
};
|
||||
|
||||
export type InternalLinkActionV2 = BaseActionV2 & {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react";
|
||||
|
||||
type ComponentPromise<T extends React.ComponentType<any>> = Promise<{
|
||||
type ComponentPromise<T extends React.ComponentType<unknown>> = Promise<{
|
||||
default: T;
|
||||
}>;
|
||||
|
||||
@@ -12,7 +12,7 @@ type ComponentPromise<T extends React.ComponentType<any>> = Promise<{
|
||||
* @param interval The interval between retries in milliseconds, defaults to 1000.
|
||||
* @returns A lazy component.
|
||||
*/
|
||||
export default function lazyWithRetry<T extends React.ComponentType<any>>(
|
||||
export default function lazyWithRetry<T extends React.ComponentType<unknown>>(
|
||||
component: () => ComponentPromise<T>,
|
||||
retries?: number,
|
||||
interval?: number
|
||||
@@ -20,7 +20,7 @@ export default function lazyWithRetry<T extends React.ComponentType<any>>(
|
||||
return React.lazy(() => retry(component, retries, interval));
|
||||
}
|
||||
|
||||
function retry<T extends React.ComponentType<any>>(
|
||||
function retry<T extends React.ComponentType<unknown>>(
|
||||
fn: () => ComponentPromise<T>,
|
||||
retriesLeft = 3,
|
||||
interval = 1000
|
||||
|
||||
@@ -573,7 +573,7 @@ router.post(
|
||||
});
|
||||
|
||||
let document: Document | null;
|
||||
let serializedDocument: Record<string, any> | undefined;
|
||||
let serializedDocument: Record<string, unknown> | undefined;
|
||||
let isPublic = false;
|
||||
|
||||
if (shareId) {
|
||||
|
||||
@@ -227,20 +227,22 @@ describe("#groups.list", () => {
|
||||
},
|
||||
});
|
||||
const body = await res.json();
|
||||
|
||||
expect(res.status).toEqual(200);
|
||||
expect(body.data.groups.length).toEqual(2);
|
||||
expect(body.data.groups[0].id).toEqual(anotherGroup.id);
|
||||
expect(body.data.groups[1].id).toEqual(group.id);
|
||||
|
||||
expect(body.data.groupMemberships.length).toEqual(2);
|
||||
expect(body.data.groupMemberships[0].groupId).toEqual(group.id);
|
||||
expect(body.data.groupMemberships[1].groupId).toEqual(group.id);
|
||||
expect(
|
||||
body.data.groupMemberships.map((u: any) => u.user.id).includes(user.id)
|
||||
body.data.groupMemberships
|
||||
.map((u: { user: { id: string }; groupId: string }) => u.user.id)
|
||||
.includes(user.id)
|
||||
).toBe(true);
|
||||
expect(
|
||||
body.data.groupMemberships
|
||||
.map((u: any) => u.user.id)
|
||||
.map((u: { user: { id: string }; groupId: string }) => u.user.id)
|
||||
.includes(anotherUser.id)
|
||||
).toBe(true);
|
||||
expect(body.policies.length).toEqual(2);
|
||||
@@ -259,11 +261,13 @@ describe("#groups.list", () => {
|
||||
expect(anotherBody.data.groupMemberships[0].groupId).toEqual(group.id);
|
||||
expect(anotherBody.data.groupMemberships[1].groupId).toEqual(group.id);
|
||||
expect(
|
||||
body.data.groupMemberships.map((u: any) => u.user.id).includes(user.id)
|
||||
body.data.groupMemberships
|
||||
.map((u: { user: { id: string }; groupId: string }) => u.user.id)
|
||||
.includes(user.id)
|
||||
).toBe(true);
|
||||
expect(
|
||||
body.data.groupMemberships
|
||||
.map((u: any) => u.user.id)
|
||||
.map((u: { user: { id: string }; groupId: string }) => u.user.id)
|
||||
.includes(anotherUser.id)
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
@@ -14,5 +14,5 @@ export class MutexLock {
|
||||
};
|
||||
}
|
||||
|
||||
private static redlock: any;
|
||||
private static redlock: unknown;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import * as React from "react";
|
||||
import { useTheme } from "styled-components";
|
||||
import { isSafari } from "../../utils/browser";
|
||||
import { BaseIconProps } from ".";
|
||||
|
||||
/** Renders an icon for a specific GitLab issue state */
|
||||
export function GitLabIssueStatusIcon(props: BaseIconProps) {
|
||||
const theme = useTheme();
|
||||
// No theme needed for this component
|
||||
const { state } = props;
|
||||
const isOpen = state.name === "opened";
|
||||
const color = state.color || (isOpen ? "#1aaa55" : "#db3b21"); // Green for open, red for closed
|
||||
@@ -29,16 +28,8 @@ export function GitLabIssueStatusIcon(props: BaseIconProps) {
|
||||
/>
|
||||
)}
|
||||
{state.draft && (
|
||||
<rect
|
||||
x="4"
|
||||
y="7"
|
||||
width="8"
|
||||
height="2"
|
||||
rx="1"
|
||||
fill={color}
|
||||
/>
|
||||
<rect x="4" y="7" width="8" height="2" rx="1" fill={color} />
|
||||
)}
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ export type CommandFactory = (attrs?: Record<string, Primitive>) => Command;
|
||||
export type WidgetProps = { rtl: boolean; readOnly: boolean | undefined };
|
||||
|
||||
export default class Extension {
|
||||
options: any;
|
||||
options: Record<string, unknown>;
|
||||
editor: Editor;
|
||||
|
||||
constructor(options: Record<string, any> = {}) {
|
||||
constructor(options: Record<string, unknown> = {}) {
|
||||
this.options = {
|
||||
...this.defaultOptions,
|
||||
...options,
|
||||
|
||||
Reference in New Issue
Block a user