mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -05:00
fix(frontend): reformat source files
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
e260b77760
commit
e390c0dd15
669 changed files with 1741 additions and 2354 deletions
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { testNoteId } from '../support/visit-test-editor'
|
import { testNoteId } from '../support/visit-test-editor'
|
||||||
|
|
||||||
describe('Delete note', () => {
|
describe('Delete note', () => {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { PAGE_MODE } from '../support/visit'
|
import { PAGE_MODE } from '../support/visit'
|
||||||
|
|
||||||
describe('Document read only page', () => {
|
describe('Document read only page', () => {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { branding } from '../support/config'
|
import { branding } from '../support/config'
|
||||||
|
|
||||||
const title = 'This is a test title'
|
const title = 'This is a test title'
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { languages } from '../fixtures/languages'
|
import { languages } from '../fixtures/languages'
|
||||||
|
|
||||||
describe('Languages', () => {
|
describe('Languages', () => {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { AuthProvider } from '../../src/api/config/types'
|
import type { AuthProvider } from '../../src/api/config/types'
|
||||||
import { AuthProviderType } from '../../src/api/config/types'
|
import { AuthProviderType } from '../../src/api/config/types'
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { PAGE_MODE } from '../support/visit'
|
import { PAGE_MODE } from '../support/visit'
|
||||||
|
|
||||||
describe('Slideshow only page', () => {
|
describe('Slideshow only page', () => {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { AuthProviderType } from '../../src/api/config/types'
|
import { AuthProviderType } from '../../src/api/config/types'
|
||||||
|
|
||||||
declare namespace Cypress {
|
declare namespace Cypress {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// ***********************************************************
|
// ***********************************************************
|
||||||
// This example support/index.ts is processed and
|
// This example support/index.ts is processed and
|
||||||
// loaded automatically before your test files.
|
// loaded automatically before your test files.
|
||||||
|
@ -18,13 +17,12 @@
|
||||||
// You can read more here:
|
// You can read more here:
|
||||||
// https://on.cypress.io/configuration
|
// https://on.cypress.io/configuration
|
||||||
// ***********************************************************
|
// ***********************************************************
|
||||||
|
|
||||||
import 'cypress-commands'
|
|
||||||
import './check-links'
|
import './check-links'
|
||||||
import './config'
|
import './config'
|
||||||
import './fill'
|
import './fill'
|
||||||
import './get-by-id'
|
import './get-by-id'
|
||||||
import './get-iframe-content'
|
import './get-iframe-content'
|
||||||
import './logout'
|
import './logout'
|
||||||
import './visit-test-editor'
|
|
||||||
import './visit'
|
import './visit'
|
||||||
|
import './visit-test-editor'
|
||||||
|
import 'cypress-commands'
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { RendererType } from '../../src/components/render-page/window-post-message-communicator/rendering-message'
|
import { RendererType } from '../../src/components/render-page/window-post-message-communicator/rendering-message'
|
||||||
|
|
||||||
declare namespace Cypress {
|
declare namespace Cypress {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { testNoteId } from './visit-test-editor'
|
import { testNoteId } from './visit-test-editor'
|
||||||
|
|
||||||
declare namespace Cypress {
|
declare namespace Cypress {
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import type { Alias, NewAliasDto, PrimaryAliasDto } from './types'
|
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
||||||
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
||||||
import { PutApiRequestBuilder } from '../common/api-request-builder/put-api-request-builder'
|
import { PutApiRequestBuilder } from '../common/api-request-builder/put-api-request-builder'
|
||||||
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
import type { Alias, NewAliasDto, PrimaryAliasDto } from './types'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an alias to an existing note.
|
* Adds an alias to an existing note.
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
||||||
import type { LoginDto } from './types'
|
import type { LoginDto } from './types'
|
||||||
import { AuthError } from './types'
|
import { AuthError } from './types'
|
||||||
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests to log in a user via LDAP credentials.
|
* Requests to log in a user via LDAP credentials.
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import type { ChangePasswordDto, LoginDto, RegisterDto } from './types'
|
|
||||||
import { AuthError, RegisterError } from './types'
|
|
||||||
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
||||||
import { PutApiRequestBuilder } from '../common/api-request-builder/put-api-request-builder'
|
import { PutApiRequestBuilder } from '../common/api-request-builder/put-api-request-builder'
|
||||||
|
import type { ChangePasswordDto, LoginDto, RegisterDto } from './types'
|
||||||
|
import { AuthError, RegisterError } from './types'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests to do a local login with a provided username and password.
|
* Requests to do a local login with a provided username and password.
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ApiRequestBuilder } from './api-request-builder'
|
import { ApiRequestBuilder } from './api-request-builder'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import deepmerge from 'deepmerge'
|
|
||||||
import { defaultConfig, defaultHeaders } from '../default-config'
|
|
||||||
import { ApiResponse } from '../api-response'
|
import { ApiResponse } from '../api-response'
|
||||||
|
import { defaultConfig, defaultHeaders } from '../default-config'
|
||||||
|
import deepmerge from 'deepmerge'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builder to construct and execute a call to the HTTP API.
|
* Builder to construct and execute a call to the HTTP API.
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { expectFetch } from './test-utils/expect-fetch'
|
|
||||||
import { DeleteApiRequestBuilder } from './delete-api-request-builder'
|
import { DeleteApiRequestBuilder } from './delete-api-request-builder'
|
||||||
|
import { expectFetch } from './test-utils/expect-fetch'
|
||||||
|
|
||||||
describe('DeleteApiRequestBuilder', () => {
|
describe('DeleteApiRequestBuilder', () => {
|
||||||
let originalFetch: typeof global['fetch']
|
let originalFetch: typeof global['fetch']
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { expectFetch } from './test-utils/expect-fetch'
|
|
||||||
import { GetApiRequestBuilder } from './get-api-request-builder'
|
import { GetApiRequestBuilder } from './get-api-request-builder'
|
||||||
|
import { expectFetch } from './test-utils/expect-fetch'
|
||||||
|
|
||||||
describe('GetApiRequestBuilder', () => {
|
describe('GetApiRequestBuilder', () => {
|
||||||
let originalFetch: typeof global['fetch']
|
let originalFetch: typeof global['fetch']
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ApiRequestBuilder } from './api-request-builder'
|
|
||||||
import type { ApiResponse } from '../api-response'
|
import type { ApiResponse } from '../api-response'
|
||||||
|
import { ApiRequestBuilder } from './api-request-builder'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builder to construct a GET request to the API.
|
* Builder to construct a GET request to the API.
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { PostApiRequestBuilder } from './post-api-request-builder'
|
import { PostApiRequestBuilder } from './post-api-request-builder'
|
||||||
import { expectFetch } from './test-utils/expect-fetch'
|
import { expectFetch } from './test-utils/expect-fetch'
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { expectFetch } from './test-utils/expect-fetch'
|
|
||||||
import { PutApiRequestBuilder } from './put-api-request-builder'
|
import { PutApiRequestBuilder } from './put-api-request-builder'
|
||||||
|
import { expectFetch } from './test-utils/expect-fetch'
|
||||||
|
|
||||||
describe('PutApiRequestBuilder', () => {
|
describe('PutApiRequestBuilder', () => {
|
||||||
let originalFetch: typeof global['fetch']
|
let originalFetch: typeof global['fetch']
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { defaultConfig } from '../../default-config'
|
import { defaultConfig } from '../../default-config'
|
||||||
import { Mock } from 'ts-mockery'
|
import { Mock } from 'ts-mockery'
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Mock } from 'ts-mockery'
|
|
||||||
import { ApiResponse } from './api-response'
|
import { ApiResponse } from './api-response'
|
||||||
|
import { Mock } from 'ts-mockery'
|
||||||
|
|
||||||
describe('ApiResponse', () => {
|
describe('ApiResponse', () => {
|
||||||
it('getResponse returns input response', () => {
|
it('getResponse returns input response', () => {
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Config } from './types'
|
|
||||||
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
||||||
|
import type { Config } from './types'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches the frontend config from the backend.
|
* Fetches the frontend config from the backend.
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { GroupInfo } from './types'
|
|
||||||
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
||||||
|
import type { GroupInfo } from './types'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves information about a group with a given name.
|
* Retrieves information about a group with a given name.
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import type { ChangePinStatusDto, HistoryEntry, HistoryEntryPutDto } from './types'
|
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
||||||
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
||||||
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
||||||
import { PutApiRequestBuilder } from '../common/api-request-builder/put-api-request-builder'
|
import { PutApiRequestBuilder } from '../common/api-request-builder/put-api-request-builder'
|
||||||
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
import type { ChangePinStatusDto, HistoryEntry, HistoryEntryPutDto } from './types'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches the remote history for the user from the server.
|
* Fetches the remote history for the user from the server.
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
||||||
|
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
||||||
|
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
||||||
import type { MediaUpload } from '../media/types'
|
import type { MediaUpload } from '../media/types'
|
||||||
import type { ChangeDisplayNameDto, LoginUserInfo } from './types'
|
import type { ChangeDisplayNameDto, LoginUserInfo } from './types'
|
||||||
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
|
||||||
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
|
||||||
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns metadata about the currently signed-in user from the API.
|
* Returns metadata about the currently signed-in user from the API.
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import type { ImageProxyRequestDto, ImageProxyResponse, MediaUpload } from './types'
|
|
||||||
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
|
||||||
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
||||||
|
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
||||||
|
import type { ImageProxyRequestDto, ImageProxyResponse, MediaUpload } from './types'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests an image-proxy URL from the backend for a given image URL.
|
* Requests an image-proxy URL from the backend for a given image URL.
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import type { Note, NoteDeletionOptions, NoteMetadata } from './types'
|
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
||||||
import type { MediaUpload } from '../media/types'
|
|
||||||
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
||||||
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
||||||
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
import type { MediaUpload } from '../media/types'
|
||||||
|
import type { Note, NoteDeletionOptions, NoteMetadata } from './types'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the content and metadata about the specified note.
|
* Retrieves the content and metadata about the specified note.
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
||||||
|
import { PutApiRequestBuilder } from '../common/api-request-builder/put-api-request-builder'
|
||||||
import type { NotePermissions } from '../notes/types'
|
import type { NotePermissions } from '../notes/types'
|
||||||
import type { OwnerChangeDto, PermissionSetDto } from './types'
|
import type { OwnerChangeDto, PermissionSetDto } from './types'
|
||||||
import { PutApiRequestBuilder } from '../common/api-request-builder/put-api-request-builder'
|
|
||||||
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the owner of a note.
|
* Sets the owner of a note.
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import type { RevisionDetails, RevisionMetadata } from './types'
|
|
||||||
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
|
||||||
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
||||||
|
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
||||||
|
import type { RevisionDetails, RevisionMetadata } from './types'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a note revision while using a cache for often retrieved revisions.
|
* Retrieves a note revision while using a cache for often retrieved revisions.
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { NoteEdit } from '../notes/types'
|
import type { NoteEdit } from '../notes/types'
|
||||||
|
|
||||||
export interface RevisionDetails extends RevisionMetadata {
|
export interface RevisionDetails extends RevisionMetadata {
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import type { AccessToken, AccessTokenWithSecret, CreateAccessTokenDto } from './types'
|
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
||||||
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
||||||
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
||||||
import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-api-request-builder'
|
import type { AccessToken, AccessTokenWithSecret, CreateAccessTokenDto } from './types'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the access tokens for the current user.
|
* Retrieves the access tokens for the current user.
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { UserInfo } from './types'
|
|
||||||
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
||||||
|
import type { UserInfo } from './types'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves information about a specific user while using a cache to avoid many requests for the same username.
|
* Retrieves information about a specific user while using a cache to avoid many requests for the same username.
|
||||||
|
|
|
@ -3,14 +3,13 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { Logger } from '../../utils/logger'
|
||||||
import type { PropsWithChildren } from 'react'
|
import { ApplicationLoaderError } from './application-loader-error'
|
||||||
import React, { Fragment, Suspense, useMemo } from 'react'
|
|
||||||
import { createSetUpTaskList } from './initializers'
|
import { createSetUpTaskList } from './initializers'
|
||||||
import { LoadingScreen } from './loading-screen/loading-screen'
|
import { LoadingScreen } from './loading-screen/loading-screen'
|
||||||
import { Logger } from '../../utils/logger'
|
import type { PropsWithChildren } from 'react'
|
||||||
|
import React, { Fragment, Suspense, useMemo } from 'react'
|
||||||
import { useAsync } from 'react-use'
|
import { useAsync } from 'react-use'
|
||||||
import { ApplicationLoaderError } from './application-loader-error'
|
|
||||||
|
|
||||||
const log = new Logger('ApplicationLoader')
|
const log = new Logger('ApplicationLoader')
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { getConfig } from '../../../api/config'
|
import { getConfig } from '../../../api/config'
|
||||||
import { setConfig } from '../../../redux/config/methods'
|
import { setConfig } from '../../../redux/config/methods'
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,13 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { setUpI18n } from './setupI18n'
|
|
||||||
import { refreshHistoryState } from '../../../redux/history/methods'
|
import { refreshHistoryState } from '../../../redux/history/methods'
|
||||||
|
import { Logger } from '../../../utils/logger'
|
||||||
|
import { isDevMode, isTestMode } from '../../../utils/test-modes'
|
||||||
import { fetchAndSetUser } from '../../login-page/auth/utils'
|
import { fetchAndSetUser } from '../../login-page/auth/utils'
|
||||||
import { fetchFrontendConfig } from './fetch-frontend-config'
|
import { fetchFrontendConfig } from './fetch-frontend-config'
|
||||||
import { loadDarkMode } from './load-dark-mode'
|
import { loadDarkMode } from './load-dark-mode'
|
||||||
import { isDevMode, isTestMode } from '../../../utils/test-modes'
|
import { setUpI18n } from './setupI18n'
|
||||||
import { Logger } from '../../../utils/logger'
|
|
||||||
|
|
||||||
const logger = new Logger('Application Loader')
|
const logger = new Logger('Application Loader')
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import { setDarkModePreference } from '../../../redux/dark-mode/methods'
|
|
||||||
import { Logger } from '../../../utils/logger'
|
|
||||||
import { isClientSideRendering } from '../../../utils/is-client-side-rendering'
|
|
||||||
import { DarkModePreference } from '../../../redux/dark-mode/types'
|
|
||||||
import { DARK_MODE_LOCAL_STORAGE_KEY } from '../../../hooks/common/use-apply-dark-mode'
|
import { DARK_MODE_LOCAL_STORAGE_KEY } from '../../../hooks/common/use-apply-dark-mode'
|
||||||
|
import { setDarkModePreference } from '../../../redux/dark-mode/methods'
|
||||||
|
import { DarkModePreference } from '../../../redux/dark-mode/types'
|
||||||
|
import { isClientSideRendering } from '../../../utils/is-client-side-rendering'
|
||||||
|
import { Logger } from '../../../utils/logger'
|
||||||
|
|
||||||
const logger = new Logger('Dark mode initializer')
|
const logger = new Logger('Dark mode initializer')
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,13 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { isDevMode } from '../../../utils/test-modes'
|
||||||
import type { ResourceKey } from 'i18next'
|
import type { ResourceKey } from 'i18next'
|
||||||
import i18n, { use as i18nUse } from 'i18next'
|
import i18n, { use as i18nUse } from 'i18next'
|
||||||
import LanguageDetector from 'i18next-browser-languagedetector'
|
import LanguageDetector from 'i18next-browser-languagedetector'
|
||||||
import resourcesToBackend from 'i18next-resources-to-backend'
|
import resourcesToBackend from 'i18next-resources-to-backend'
|
||||||
import { Settings } from 'luxon'
|
import { Settings } from 'luxon'
|
||||||
import { initReactI18next } from 'react-i18next'
|
import { initReactI18next } from 'react-i18next'
|
||||||
import { isDevMode } from '../../../utils/test-modes'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up the internationalisation framework i18n.
|
* Set up the internationalisation framework i18n.
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useMemo } from 'react'
|
|
||||||
import { createNumberRangeArray } from '../../common/number-range/number-range'
|
import { createNumberRangeArray } from '../../common/number-range/number-range'
|
||||||
import { RandomIcon } from './random-icon'
|
|
||||||
import styles from './animations.module.scss'
|
import styles from './animations.module.scss'
|
||||||
|
import { RandomIcon } from './random-icon'
|
||||||
|
import React, { useMemo } from 'react'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows a number of {@link RandomIcon random icons in a row}.
|
* Shows a number of {@link RandomIcon random icons in a row}.
|
||||||
|
|
|
@ -3,12 +3,11 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useMemo } from 'react'
|
|
||||||
import styles from './animations.module.scss'
|
|
||||||
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
||||||
import { IconRow } from './icon-row'
|
|
||||||
import { createNumberRangeArray } from '../../common/number-range/number-range'
|
import { createNumberRangeArray } from '../../common/number-range/number-range'
|
||||||
|
import styles from './animations.module.scss'
|
||||||
|
import { IconRow } from './icon-row'
|
||||||
|
import React, { useMemo } from 'react'
|
||||||
|
|
||||||
export interface HedgeDocLogoProps {
|
export interface HedgeDocLogoProps {
|
||||||
error: boolean
|
error: boolean
|
||||||
|
|
|
@ -3,13 +3,12 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { ShowIf } from '../../common/show-if/show-if'
|
||||||
|
import styles from '../application-loader.module.scss'
|
||||||
|
import { LoadingAnimation } from './loading-animation'
|
||||||
import type { ReactElement } from 'react'
|
import type { ReactElement } from 'react'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Alert } from 'react-bootstrap'
|
import { Alert } from 'react-bootstrap'
|
||||||
import { LoadingAnimation } from './loading-animation'
|
|
||||||
import { ShowIf } from '../../common/show-if/show-if'
|
|
||||||
import styles from '../application-loader.module.scss'
|
|
||||||
|
|
||||||
export interface LoadingScreenProps {
|
export interface LoadingScreenProps {
|
||||||
errorMessage?: string | ReactElement
|
errorMessage?: string | ReactElement
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useEffect, useState } from 'react'
|
|
||||||
import type { IconName } from '../../common/fork-awesome/types'
|
|
||||||
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
||||||
|
import type { IconName } from '../../common/fork-awesome/types'
|
||||||
import styles from './animations.module.scss'
|
import styles from './animations.module.scss'
|
||||||
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
const elements: IconName[] = [
|
const elements: IconName[] = [
|
||||||
'file-text',
|
'file-text',
|
||||||
|
|
|
@ -3,12 +3,11 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { WaitSpinner } from './wait-spinner/wait-spinner'
|
||||||
import type { PropsWithChildren, ReactNode } from 'react'
|
import type { PropsWithChildren, ReactNode } from 'react'
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
|
||||||
import { WaitSpinner } from './wait-spinner/wait-spinner'
|
|
||||||
import { Alert } from 'react-bootstrap'
|
import { Alert } from 'react-bootstrap'
|
||||||
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
export interface AsyncLoadingBoundaryProps {
|
export interface AsyncLoadingBoundaryProps {
|
||||||
loading: boolean
|
loading: boolean
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { createContext, useState } from 'react'
|
import React, { createContext, useState } from 'react'
|
||||||
import type { PropsWithChildren } from 'react'
|
import type { PropsWithChildren } from 'react'
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { useApplicationState } from '../../../hooks/common/use-application-state'
|
||||||
import React, { useMemo } from 'react'
|
|
||||||
import { ShowIf } from '../show-if/show-if'
|
import { ShowIf } from '../show-if/show-if'
|
||||||
import styles from './branding.module.scss'
|
import styles from './branding.module.scss'
|
||||||
import { useApplicationState } from '../../../hooks/common/use-application-state'
|
import React, { useMemo } from 'react'
|
||||||
|
|
||||||
export interface BrandingProps {
|
export interface BrandingProps {
|
||||||
inline?: boolean
|
inline?: boolean
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { mockI18n } from '../../../markdown-renderer/test-utils/mock-i18n'
|
import { mockI18n } from '../../../markdown-renderer/test-utils/mock-i18n'
|
||||||
import { CopyToClipboardButton } from './copy-to-clipboard-button'
|
import { CopyToClipboardButton } from './copy-to-clipboard-button'
|
||||||
import { act, render, screen } from '@testing-library/react'
|
import { act, render, screen } from '@testing-library/react'
|
||||||
|
|
|
@ -3,15 +3,14 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import type { PropsWithDataCypressId } from '../../../../utils/cypress-attribute'
|
||||||
|
import { cypressId } from '../../../../utils/cypress-attribute'
|
||||||
|
import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon'
|
||||||
|
import { useCopyOverlay } from '../hooks/use-copy-overlay'
|
||||||
import React, { Fragment, useRef } from 'react'
|
import React, { Fragment, useRef } from 'react'
|
||||||
import { Button } from 'react-bootstrap'
|
import { Button } from 'react-bootstrap'
|
||||||
import type { Variant } from 'react-bootstrap/types'
|
import type { Variant } from 'react-bootstrap/types'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon'
|
|
||||||
import { useCopyOverlay } from '../hooks/use-copy-overlay'
|
|
||||||
import type { PropsWithDataCypressId } from '../../../../utils/cypress-attribute'
|
|
||||||
import { cypressId } from '../../../../utils/cypress-attribute'
|
|
||||||
|
|
||||||
export interface CopyToClipboardButtonProps extends PropsWithDataCypressId {
|
export interface CopyToClipboardButtonProps extends PropsWithDataCypressId {
|
||||||
content: string
|
content: string
|
||||||
|
|
|
@ -3,15 +3,14 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { isClientSideRendering } from '../../../../utils/is-client-side-rendering'
|
||||||
|
import { Logger } from '../../../../utils/logger'
|
||||||
|
import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon'
|
||||||
|
import { ShowIf } from '../../show-if/show-if'
|
||||||
|
import { CopyToClipboardButton } from '../copy-to-clipboard-button/copy-to-clipboard-button'
|
||||||
import React, { useCallback, useMemo } from 'react'
|
import React, { useCallback, useMemo } from 'react'
|
||||||
import { Button, FormControl, InputGroup } from 'react-bootstrap'
|
import { Button, FormControl, InputGroup } from 'react-bootstrap'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon'
|
|
||||||
import { ShowIf } from '../../show-if/show-if'
|
|
||||||
import { Logger } from '../../../../utils/logger'
|
|
||||||
import { isClientSideRendering } from '../../../../utils/is-client-side-rendering'
|
|
||||||
import { CopyToClipboardButton } from '../copy-to-clipboard-button/copy-to-clipboard-button'
|
|
||||||
|
|
||||||
export interface CopyableFieldProps {
|
export interface CopyableFieldProps {
|
||||||
content: string
|
content: string
|
||||||
|
|
|
@ -3,16 +3,15 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { isClientSideRendering } from '../../../../utils/is-client-side-rendering'
|
||||||
|
import { Logger } from '../../../../utils/logger'
|
||||||
|
import { ShowIf } from '../../show-if/show-if'
|
||||||
import type { ReactElement, RefObject } from 'react'
|
import type { ReactElement, RefObject } from 'react'
|
||||||
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
import { Overlay, Tooltip } from 'react-bootstrap'
|
import { Overlay, Tooltip } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { v4 as uuid } from 'uuid'
|
|
||||||
import { ShowIf } from '../../show-if/show-if'
|
|
||||||
import { Logger } from '../../../../utils/logger'
|
|
||||||
import { isClientSideRendering } from '../../../../utils/is-client-side-rendering'
|
|
||||||
import { useTimeoutFn } from 'react-use'
|
import { useTimeoutFn } from 'react-use'
|
||||||
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
||||||
const log = new Logger('useCopyOverlay')
|
const log = new Logger('useCopyOverlay')
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import type { ButtonProps } from 'react-bootstrap'
|
import type { ButtonProps } from 'react-bootstrap'
|
||||||
import { Button } from 'react-bootstrap'
|
import { Button } from 'react-bootstrap'
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react'
|
|
||||||
import type { CommonFieldProps } from './fields'
|
import type { CommonFieldProps } from './fields'
|
||||||
|
import React from 'react'
|
||||||
import { Form } from 'react-bootstrap'
|
import { Form } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useMemo } from 'react'
|
|
||||||
import type { CommonFieldProps } from './fields'
|
import type { CommonFieldProps } from './fields'
|
||||||
|
import React, { useMemo } from 'react'
|
||||||
import { Form } from 'react-bootstrap'
|
import { Form } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { ChangeEvent } from 'react'
|
import type { ChangeEvent } from 'react'
|
||||||
|
|
||||||
export interface CommonFieldProps {
|
export interface CommonFieldProps {
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useMemo } from 'react'
|
|
||||||
import type { CommonFieldProps } from './fields'
|
import type { CommonFieldProps } from './fields'
|
||||||
|
import React, { useMemo } from 'react'
|
||||||
import { Form } from 'react-bootstrap'
|
import { Form } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useMemo } from 'react'
|
|
||||||
import type { CommonFieldProps } from './fields'
|
import type { CommonFieldProps } from './fields'
|
||||||
|
import React, { useMemo } from 'react'
|
||||||
import { Form } from 'react-bootstrap'
|
import { Form } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useMemo } from 'react'
|
|
||||||
import type { CommonFieldProps } from './fields'
|
import type { CommonFieldProps } from './fields'
|
||||||
|
import React, { useMemo } from 'react'
|
||||||
import { Form } from 'react-bootstrap'
|
import { Form } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { ForkAwesomeIcon } from './fork-awesome-icon'
|
||||||
import type { IconName } from './types'
|
import type { IconName } from './types'
|
||||||
import { render } from '@testing-library/react'
|
import { render } from '@testing-library/react'
|
||||||
import { ForkAwesomeIcon } from './fork-awesome-icon'
|
|
||||||
|
|
||||||
describe('ForkAwesomeIcon', () => {
|
describe('ForkAwesomeIcon', () => {
|
||||||
const icon: IconName = 'heart'
|
const icon: IconName = 'heart'
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react'
|
|
||||||
import type { IconName, IconSize } from './types'
|
import type { IconName, IconSize } from './types'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
export interface ForkAwesomeIconProps {
|
export interface ForkAwesomeIconProps {
|
||||||
icon: IconName
|
icon: IconName
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { render } from '@testing-library/react'
|
|
||||||
import { ForkAwesomeStack } from './fork-awesome-stack'
|
|
||||||
import type { ForkAwesomeIconProps } from './fork-awesome-icon'
|
import type { ForkAwesomeIconProps } from './fork-awesome-icon'
|
||||||
import { ForkAwesomeIcon } from './fork-awesome-icon'
|
import { ForkAwesomeIcon } from './fork-awesome-icon'
|
||||||
|
import { ForkAwesomeStack } from './fork-awesome-stack'
|
||||||
|
import { render } from '@testing-library/react'
|
||||||
import type { ReactElement } from 'react'
|
import type { ReactElement } from 'react'
|
||||||
|
|
||||||
describe('ForkAwesomeStack', () => {
|
describe('ForkAwesomeStack', () => {
|
||||||
|
|
|
@ -3,12 +3,11 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { ReactElement } from 'react'
|
|
||||||
import React from 'react'
|
|
||||||
import type { ForkAwesomeIconProps } from './fork-awesome-icon'
|
import type { ForkAwesomeIconProps } from './fork-awesome-icon'
|
||||||
import { ForkAwesomeIcon } from './fork-awesome-icon'
|
import { ForkAwesomeIcon } from './fork-awesome-icon'
|
||||||
import type { IconSize } from './types'
|
import type { IconSize } from './types'
|
||||||
|
import type { ReactElement } from 'react'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
export interface ForkAwesomeStackProps {
|
export interface ForkAwesomeStackProps {
|
||||||
size?: IconSize
|
size?: IconSize
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { ForkAwesomeIcons } from './fork-awesome-icons'
|
import type { ForkAwesomeIcons } from './fork-awesome-icons'
|
||||||
|
|
||||||
export type IconName = typeof ForkAwesomeIcons[number]
|
export type IconName = typeof ForkAwesomeIcons[number]
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useMemo } from 'react'
|
|
||||||
import LogoBwHorizontal from './logo_text_bw_horizontal.svg'
|
import LogoBwHorizontal from './logo_text_bw_horizontal.svg'
|
||||||
import LogoColorVertical from './logo_text_color_vertical.svg'
|
import LogoColorVertical from './logo_text_color_vertical.svg'
|
||||||
import LogoWbHorizontal from './logo_text_wb_horizontal.svg'
|
import LogoWbHorizontal from './logo_text_wb_horizontal.svg'
|
||||||
|
import React, { useMemo } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
export enum HedgeDocLogoSize {
|
export enum HedgeDocLogoSize {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { IconName } from '../fork-awesome/types'
|
import type { IconName } from '../fork-awesome/types'
|
||||||
import { IconButton } from './icon-button'
|
import { IconButton } from './icon-button'
|
||||||
import { fireEvent, render, screen } from '@testing-library/react'
|
import { fireEvent, render, screen } from '@testing-library/react'
|
||||||
|
|
|
@ -3,16 +3,15 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import type { PropsWithDataTestId } from '../../../utils/test-id'
|
||||||
import React from 'react'
|
import { testId } from '../../../utils/test-id'
|
||||||
import type { ButtonProps } from 'react-bootstrap'
|
|
||||||
import { Button } from 'react-bootstrap'
|
|
||||||
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
||||||
import type { IconName } from '../fork-awesome/types'
|
import type { IconName } from '../fork-awesome/types'
|
||||||
import { ShowIf } from '../show-if/show-if'
|
import { ShowIf } from '../show-if/show-if'
|
||||||
import styles from './icon-button.module.scss'
|
import styles from './icon-button.module.scss'
|
||||||
import type { PropsWithDataTestId } from '../../../utils/test-id'
|
import React from 'react'
|
||||||
import { testId } from '../../../utils/test-id'
|
import type { ButtonProps } from 'react-bootstrap'
|
||||||
|
import { Button } from 'react-bootstrap'
|
||||||
|
|
||||||
export interface IconButtonProps extends ButtonProps, PropsWithDataTestId {
|
export interface IconButtonProps extends ButtonProps, PropsWithDataTestId {
|
||||||
icon: IconName
|
icon: IconName
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||||
import { render } from '@testing-library/react'
|
|
||||||
import { TranslatedIconButton } from './translated-icon-button'
|
import { TranslatedIconButton } from './translated-icon-button'
|
||||||
|
import { render } from '@testing-library/react'
|
||||||
|
|
||||||
describe('TranslatedIconButton', () => {
|
describe('TranslatedIconButton', () => {
|
||||||
it('renders heart icon with i18nKey', async () => {
|
it('renders heart icon with i18nKey', async () => {
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react'
|
|
||||||
import { Trans } from 'react-i18next'
|
|
||||||
import type { IconButtonProps } from './icon-button'
|
import type { IconButtonProps } from './icon-button'
|
||||||
import { IconButton } from './icon-button'
|
import { IconButton } from './icon-button'
|
||||||
|
import React from 'react'
|
||||||
|
import { Trans } from 'react-i18next'
|
||||||
|
|
||||||
export interface TranslatedIconButtonProps extends IconButtonProps {
|
export interface TranslatedIconButtonProps extends IconButtonProps {
|
||||||
i18nKey: string
|
i18nKey: string
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { render } from '@testing-library/react'
|
|
||||||
import { ExternalLink } from './external-link'
|
import { ExternalLink } from './external-link'
|
||||||
|
import { render } from '@testing-library/react'
|
||||||
|
|
||||||
describe('ExternalLink', () => {
|
describe('ExternalLink', () => {
|
||||||
const href = 'https://example.com'
|
const href = 'https://example.com'
|
||||||
|
|
|
@ -3,12 +3,11 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react'
|
|
||||||
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
||||||
import type { IconName } from '../fork-awesome/types'
|
import type { IconName } from '../fork-awesome/types'
|
||||||
import { ShowIf } from '../show-if/show-if'
|
import { ShowIf } from '../show-if/show-if'
|
||||||
import type { LinkWithTextProps } from './types'
|
import type { LinkWithTextProps } from './types'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An external link.
|
* An external link.
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { render } from '@testing-library/react'
|
|
||||||
import { InternalLink } from './internal-link'
|
import { InternalLink } from './internal-link'
|
||||||
|
import { render } from '@testing-library/react'
|
||||||
|
|
||||||
describe('InternalLink', () => {
|
describe('InternalLink', () => {
|
||||||
const href = '/test'
|
const href = '/test'
|
||||||
|
|
|
@ -3,13 +3,12 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Link from 'next/link'
|
|
||||||
import React from 'react'
|
|
||||||
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
||||||
import type { IconName } from '../fork-awesome/types'
|
import type { IconName } from '../fork-awesome/types'
|
||||||
import { ShowIf } from '../show-if/show-if'
|
import { ShowIf } from '../show-if/show-if'
|
||||||
import type { LinkWithTextProps } from './types'
|
import type { LinkWithTextProps } from './types'
|
||||||
|
import Link from 'next/link'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An internal link.
|
* An internal link.
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { TranslatedExternalLink } from './translated-external-link'
|
|
||||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||||
|
import { TranslatedExternalLink } from './translated-external-link'
|
||||||
import { render } from '@testing-library/react'
|
import { render } from '@testing-library/react'
|
||||||
|
|
||||||
describe('TranslatedExternalLink', () => {
|
describe('TranslatedExternalLink', () => {
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react'
|
|
||||||
import { useTranslation } from 'react-i18next'
|
|
||||||
import { ExternalLink } from './external-link'
|
import { ExternalLink } from './external-link'
|
||||||
import type { TranslatedLinkProps } from './types'
|
import type { TranslatedLinkProps } from './types'
|
||||||
|
import React from 'react'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An {@link ExternalLink external link} with translated text.
|
* An {@link ExternalLink external link} with translated text.
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { TranslatedInternalLink } from './translated-internal-link'
|
|
||||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||||
|
import { TranslatedInternalLink } from './translated-internal-link'
|
||||||
import { render } from '@testing-library/react'
|
import { render } from '@testing-library/react'
|
||||||
|
|
||||||
describe('TranslatedInternalLink', () => {
|
describe('TranslatedInternalLink', () => {
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react'
|
|
||||||
import { useTranslation } from 'react-i18next'
|
|
||||||
import { InternalLink } from './internal-link'
|
import { InternalLink } from './internal-link'
|
||||||
import type { TranslatedLinkProps } from './types'
|
import type { TranslatedLinkProps } from './types'
|
||||||
|
import React from 'react'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An {@link InternalLink internal link} with translated text.
|
* An {@link InternalLink internal link} with translated text.
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { TOptions } from 'i18next'
|
|
||||||
import type { IconName } from '../fork-awesome/fork-awesome-icon'
|
import type { IconName } from '../fork-awesome/fork-awesome-icon'
|
||||||
|
import type { TOptions } from 'i18next'
|
||||||
|
|
||||||
interface GeneralLinkProp {
|
interface GeneralLinkProp {
|
||||||
href: string
|
href: string
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Button } from 'react-bootstrap'
|
import { Button } from 'react-bootstrap'
|
||||||
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
|
||||||
|
|
||||||
export interface LockButtonProps {
|
export interface LockButtonProps {
|
||||||
locked: boolean
|
locked: boolean
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { fireEvent, render, screen } from '@testing-library/react'
|
|
||||||
import { CommonModal } from './common-modal'
|
import { CommonModal } from './common-modal'
|
||||||
|
import { fireEvent, render, screen } from '@testing-library/react'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
describe('CommonModal', () => {
|
describe('CommonModal', () => {
|
||||||
|
|
|
@ -3,17 +3,16 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import type { PropsWithDataCypressId } from '../../../utils/cypress-attribute'
|
||||||
|
import { cypressId } from '../../../utils/cypress-attribute'
|
||||||
|
import { testId } from '../../../utils/test-id'
|
||||||
|
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
||||||
|
import type { IconName } from '../fork-awesome/types'
|
||||||
|
import { ShowIf } from '../show-if/show-if'
|
||||||
import type { PropsWithChildren } from 'react'
|
import type { PropsWithChildren } from 'react'
|
||||||
import React, { useMemo } from 'react'
|
import React, { useMemo } from 'react'
|
||||||
import { Modal } from 'react-bootstrap'
|
import { Modal } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
|
||||||
import type { IconName } from '../fork-awesome/types'
|
|
||||||
import { ShowIf } from '../show-if/show-if'
|
|
||||||
import type { PropsWithDataCypressId } from '../../../utils/cypress-attribute'
|
|
||||||
import { cypressId } from '../../../utils/cypress-attribute'
|
|
||||||
import { testId } from '../../../utils/test-id'
|
|
||||||
|
|
||||||
export interface ModalVisibilityProps {
|
export interface ModalVisibilityProps {
|
||||||
show: boolean
|
show: boolean
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||||
import { render, screen } from '@testing-library/react'
|
|
||||||
import { DeletionModal } from './deletion-modal'
|
import { DeletionModal } from './deletion-modal'
|
||||||
|
import { render, screen } from '@testing-library/react'
|
||||||
|
|
||||||
describe('DeletionModal', () => {
|
describe('DeletionModal', () => {
|
||||||
it('renders correctly with deletionButtonI18nKey', async () => {
|
it('renders correctly with deletionButtonI18nKey', async () => {
|
||||||
|
|
|
@ -3,14 +3,13 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { cypressId } from '../../../utils/cypress-attribute'
|
||||||
|
import type { CommonModalProps } from './common-modal'
|
||||||
|
import { CommonModal } from './common-modal'
|
||||||
import type { PropsWithChildren } from 'react'
|
import type { PropsWithChildren } from 'react'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Button, Modal } from 'react-bootstrap'
|
import { Button, Modal } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import type { CommonModalProps } from './common-modal'
|
|
||||||
import { CommonModal } from './common-modal'
|
|
||||||
import { cypressId } from '../../../utils/cypress-attribute'
|
|
||||||
|
|
||||||
export interface DeletionModalProps extends CommonModalProps {
|
export interface DeletionModalProps extends CommonModalProps {
|
||||||
onConfirm: () => void
|
onConfirm: () => void
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Mock } from 'ts-mockery'
|
|
||||||
import { fetchMotd } from './fetch-motd'
|
import { fetchMotd } from './fetch-motd'
|
||||||
|
import { Mock } from 'ts-mockery'
|
||||||
|
|
||||||
describe('fetch motd', () => {
|
describe('fetch motd', () => {
|
||||||
const motdUrl = 'public/motd.md'
|
const motdUrl = 'public/motd.md'
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Logger } from '../../../utils/logger'
|
|
||||||
import { defaultConfig } from '../../../api/common/default-config'
|
import { defaultConfig } from '../../../api/common/default-config'
|
||||||
|
import { Logger } from '../../../utils/logger'
|
||||||
|
|
||||||
export const MOTD_LOCAL_STORAGE_KEY = 'motd.lastModified'
|
export const MOTD_LOCAL_STORAGE_KEY = 'motd.lastModified'
|
||||||
const log = new Logger('Motd')
|
const log = new Logger('Motd')
|
||||||
|
|
|
@ -3,18 +3,17 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import * as UseBaseUrlModule from '../../../hooks/common/use-base-url'
|
||||||
import { MotdModal } from './motd-modal'
|
import { testId } from '../../../utils/test-id'
|
||||||
import { act, render, screen } from '@testing-library/react'
|
import * as RenderIframeModule from '../../editor-page/renderer-pane/render-iframe'
|
||||||
import * as fetchMotdModule from './fetch-motd'
|
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||||
import type { CommonModalProps } from '../modals/common-modal'
|
import type { CommonModalProps } from '../modals/common-modal'
|
||||||
import * as CommonModalModule from '../modals/common-modal'
|
import * as CommonModalModule from '../modals/common-modal'
|
||||||
|
import * as fetchMotdModule from './fetch-motd'
|
||||||
|
import { MotdModal } from './motd-modal'
|
||||||
|
import { act, render, screen } from '@testing-library/react'
|
||||||
import type { PropsWithChildren } from 'react'
|
import type { PropsWithChildren } from 'react'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
|
||||||
import * as RenderIframeModule from '../../editor-page/renderer-pane/render-iframe'
|
|
||||||
import { testId } from '../../../utils/test-id'
|
|
||||||
import * as UseBaseUrlModule from '../../../hooks/common/use-base-url'
|
|
||||||
|
|
||||||
jest.mock('./fetch-motd')
|
jest.mock('./fetch-motd')
|
||||||
jest.mock('../modals/common-modal')
|
jest.mock('../modals/common-modal')
|
||||||
|
|
|
@ -3,19 +3,18 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { cypressId } from '../../../utils/cypress-attribute'
|
||||||
import React, { useCallback, useMemo, useEffect, useState } from 'react'
|
|
||||||
import { Button, Modal } from 'react-bootstrap'
|
|
||||||
import { CommonModal } from '../modals/common-modal'
|
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
|
||||||
import { fetchMotd, MOTD_LOCAL_STORAGE_KEY } from './fetch-motd'
|
|
||||||
import { useAsync } from 'react-use'
|
|
||||||
import { Logger } from '../../../utils/logger'
|
import { Logger } from '../../../utils/logger'
|
||||||
import { testId } from '../../../utils/test-id'
|
import { testId } from '../../../utils/test-id'
|
||||||
|
import { EditorToRendererCommunicatorContextProvider } from '../../editor-page/render-context/editor-to-renderer-communicator-context-provider'
|
||||||
import { RenderIframe } from '../../editor-page/renderer-pane/render-iframe'
|
import { RenderIframe } from '../../editor-page/renderer-pane/render-iframe'
|
||||||
import { RendererType } from '../../render-page/window-post-message-communicator/rendering-message'
|
import { RendererType } from '../../render-page/window-post-message-communicator/rendering-message'
|
||||||
import { EditorToRendererCommunicatorContextProvider } from '../../editor-page/render-context/editor-to-renderer-communicator-context-provider'
|
import { CommonModal } from '../modals/common-modal'
|
||||||
import { cypressId } from '../../../utils/cypress-attribute'
|
import { fetchMotd, MOTD_LOCAL_STORAGE_KEY } from './fetch-motd'
|
||||||
|
import React, { useCallback, useMemo, useEffect, useState } from 'react'
|
||||||
|
import { Button, Modal } from 'react-bootstrap'
|
||||||
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
|
import { useAsync } from 'react-use'
|
||||||
|
|
||||||
const logger = new Logger('Motd')
|
const logger = new Logger('Motd')
|
||||||
|
|
||||||
|
|
|
@ -3,15 +3,14 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as useSingleStringUrlParameterModule from '../../../hooks/common/use-single-string-url-parameter'
|
|
||||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
|
||||||
import { act, render, screen, waitFor } from '@testing-library/react'
|
|
||||||
import { CreateNonExistingNoteHint } from './create-non-existing-note-hint'
|
|
||||||
import * as createNoteWithPrimaryAliasModule from '../../../api/notes'
|
import * as createNoteWithPrimaryAliasModule from '../../../api/notes'
|
||||||
import type { Note, NoteMetadata } from '../../../api/notes/types'
|
import type { Note, NoteMetadata } from '../../../api/notes/types'
|
||||||
import { Mock } from 'ts-mockery'
|
import * as useSingleStringUrlParameterModule from '../../../hooks/common/use-single-string-url-parameter'
|
||||||
import { waitForOtherPromisesToFinish } from '../../../utils/wait-for-other-promises-to-finish'
|
import { waitForOtherPromisesToFinish } from '../../../utils/wait-for-other-promises-to-finish'
|
||||||
|
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||||
|
import { CreateNonExistingNoteHint } from './create-non-existing-note-hint'
|
||||||
|
import { act, render, screen, waitFor } from '@testing-library/react'
|
||||||
|
import { Mock } from 'ts-mockery'
|
||||||
|
|
||||||
jest.mock('../../../api/notes')
|
jest.mock('../../../api/notes')
|
||||||
jest.mock('../../../hooks/common/use-single-string-url-parameter')
|
jest.mock('../../../hooks/common/use-single-string-url-parameter')
|
||||||
|
|
|
@ -3,16 +3,15 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { createNoteWithPrimaryAlias } from '../../../api/notes'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { useSingleStringUrlParameter } from '../../../hooks/common/use-single-string-url-parameter'
|
||||||
|
import { testId } from '../../../utils/test-id'
|
||||||
|
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
||||||
|
import { ShowIf } from '../show-if/show-if'
|
||||||
import React, { useCallback, useEffect } from 'react'
|
import React, { useCallback, useEffect } from 'react'
|
||||||
import { Alert, Button } from 'react-bootstrap'
|
import { Alert, Button } from 'react-bootstrap'
|
||||||
import { useSingleStringUrlParameter } from '../../../hooks/common/use-single-string-url-parameter'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { createNoteWithPrimaryAlias } from '../../../api/notes'
|
|
||||||
import { useAsyncFn } from 'react-use'
|
import { useAsyncFn } from 'react-use'
|
||||||
import { ShowIf } from '../show-if/show-if'
|
|
||||||
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
|
||||||
import { testId } from '../../../utils/test-id'
|
|
||||||
|
|
||||||
export interface CreateNonExistingNoteHintProps {
|
export interface CreateNonExistingNoteHintProps {
|
||||||
onNoteCreated: () => void
|
onNoteCreated: () => void
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useAsyncFn } from 'react-use'
|
|
||||||
import { getNote } from '../../../../api/notes'
|
import { getNote } from '../../../../api/notes'
|
||||||
import { setNoteDataFromServer } from '../../../../redux/note-details/methods'
|
|
||||||
import { useSingleStringUrlParameter } from '../../../../hooks/common/use-single-string-url-parameter'
|
import { useSingleStringUrlParameter } from '../../../../hooks/common/use-single-string-url-parameter'
|
||||||
|
import { setNoteDataFromServer } from '../../../../redux/note-details/methods'
|
||||||
|
import { useAsyncFn } from 'react-use'
|
||||||
import type { AsyncState } from 'react-use/lib/useAsyncFn'
|
import type { AsyncState } from 'react-use/lib/useAsyncFn'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,19 +3,19 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import * as useSingleStringUrlParameterModule from '../../../hooks/common/use-single-string-url-parameter'
|
|
||||||
import * as getNoteModule from '../../../api/notes'
|
import * as getNoteModule from '../../../api/notes'
|
||||||
import * as setNoteDataFromServerModule from '../../../redux/note-details/methods'
|
|
||||||
import type { Note } from '../../../api/notes/types'
|
import type { Note } from '../../../api/notes/types'
|
||||||
import { Mock } from 'ts-mockery'
|
|
||||||
import { render, screen } from '@testing-library/react'
|
|
||||||
import { NoteLoadingBoundary } from './note-loading-boundary'
|
|
||||||
import { testId } from '../../../utils/test-id'
|
|
||||||
import { Fragment } from 'react'
|
|
||||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
|
||||||
import * as CommonErrorPageModule from '../../error-pages/common-error-page'
|
|
||||||
import * as LoadingScreenModule from '../../../components/application-loader/loading-screen/loading-screen'
|
import * as LoadingScreenModule from '../../../components/application-loader/loading-screen/loading-screen'
|
||||||
|
import * as useSingleStringUrlParameterModule from '../../../hooks/common/use-single-string-url-parameter'
|
||||||
|
import * as setNoteDataFromServerModule from '../../../redux/note-details/methods'
|
||||||
|
import { testId } from '../../../utils/test-id'
|
||||||
|
import * as CommonErrorPageModule from '../../error-pages/common-error-page'
|
||||||
|
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||||
import * as CreateNonExistingNoteHintModule from './create-non-existing-note-hint'
|
import * as CreateNonExistingNoteHintModule from './create-non-existing-note-hint'
|
||||||
|
import { NoteLoadingBoundary } from './note-loading-boundary'
|
||||||
|
import { render, screen } from '@testing-library/react'
|
||||||
|
import { Fragment } from 'react'
|
||||||
|
import { Mock } from 'ts-mockery'
|
||||||
|
|
||||||
jest.mock('../../../hooks/common/use-single-string-url-parameter')
|
jest.mock('../../../hooks/common/use-single-string-url-parameter')
|
||||||
jest.mock('../../../api/notes')
|
jest.mock('../../../api/notes')
|
||||||
|
|
|
@ -3,14 +3,13 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PropsWithChildren } from 'react'
|
|
||||||
import React, { Fragment, useEffect } from 'react'
|
|
||||||
import { useLoadNoteFromServer } from './hooks/use-load-note-from-server'
|
|
||||||
import { LoadingScreen } from '../../application-loader/loading-screen/loading-screen'
|
import { LoadingScreen } from '../../application-loader/loading-screen/loading-screen'
|
||||||
import { CommonErrorPage } from '../../error-pages/common-error-page'
|
import { CommonErrorPage } from '../../error-pages/common-error-page'
|
||||||
import { CreateNonExistingNoteHint } from './create-non-existing-note-hint'
|
|
||||||
import { ShowIf } from '../show-if/show-if'
|
import { ShowIf } from '../show-if/show-if'
|
||||||
|
import { CreateNonExistingNoteHint } from './create-non-existing-note-hint'
|
||||||
|
import { useLoadNoteFromServer } from './hooks/use-load-note-from-server'
|
||||||
|
import type { PropsWithChildren } from 'react'
|
||||||
|
import React, { Fragment, useEffect } from 'react'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the note identified by the note-id in the URL.
|
* Loads the note identified by the note-id in the URL.
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { createNumberRangeArray } from './number-range'
|
import { createNumberRangeArray } from './number-range'
|
||||||
|
|
||||||
describe('number range', () => {
|
describe('number range', () => {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export interface PageItemProps {
|
export interface PageItemProps {
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useEffect, useMemo, useState } from 'react'
|
|
||||||
import { Pagination } from 'react-bootstrap'
|
|
||||||
import { ShowIf } from '../show-if/show-if'
|
import { ShowIf } from '../show-if/show-if'
|
||||||
import { PagerItem } from './pager-item'
|
import { PagerItem } from './pager-item'
|
||||||
|
import React, { useEffect, useMemo, useState } from 'react'
|
||||||
|
import { Pagination } from 'react-bootstrap'
|
||||||
|
|
||||||
export interface PaginationProps {
|
export interface PaginationProps {
|
||||||
numberOfPageButtonsToShowAfterAndBeforeCurrent: number
|
numberOfPageButtonsToShowAfterAndBeforeCurrent: number
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PropsWithChildren } from 'react'
|
import type { PropsWithChildren } from 'react'
|
||||||
import React, { Fragment, useEffect, useMemo } from 'react'
|
import React, { Fragment, useEffect, useMemo } from 'react'
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useEffect } from 'react'
|
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
|
import React, { useEffect } from 'react'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redirects the user back to the previous URL.
|
* Redirects the user back to the previous URL.
|
||||||
|
|
|
@ -3,12 +3,11 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Link from 'next/link'
|
|
||||||
import React, { useEffect } from 'react'
|
|
||||||
import { useRouter } from 'next/router'
|
|
||||||
import { Logger } from '../../utils/logger'
|
import { Logger } from '../../utils/logger'
|
||||||
import { testId } from '../../utils/test-id'
|
import { testId } from '../../utils/test-id'
|
||||||
|
import Link from 'next/link'
|
||||||
|
import { useRouter } from 'next/router'
|
||||||
|
import React, { useEffect } from 'react'
|
||||||
|
|
||||||
export interface RedirectProps {
|
export interface RedirectProps {
|
||||||
to: string
|
to: string
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { render } from '@testing-library/react'
|
|
||||||
import { ShowIf } from './show-if'
|
import { ShowIf } from './show-if'
|
||||||
|
import { render } from '@testing-library/react'
|
||||||
|
|
||||||
describe('ShowIf', () => {
|
describe('ShowIf', () => {
|
||||||
it('renders child if condition is true', () => {
|
it('renders child if condition is true', () => {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PropsWithChildren } from 'react'
|
import type { PropsWithChildren } from 'react'
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import React from 'react'
|
|
||||||
import { useAsync } from 'react-use'
|
|
||||||
import { getUser } from '../../../api/users'
|
import { getUser } from '../../../api/users'
|
||||||
|
import type { UserInfo } from '../../../api/users/types'
|
||||||
|
import { AsyncLoadingBoundary } from '../async-loading-boundary'
|
||||||
import type { UserAvatarProps } from './user-avatar'
|
import type { UserAvatarProps } from './user-avatar'
|
||||||
import { UserAvatar } from './user-avatar'
|
import { UserAvatar } from './user-avatar'
|
||||||
import type { UserInfo } from '../../../api/users/types'
|
import React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { AsyncLoadingBoundary } from '../async-loading-boundary'
|
import { useAsync } from 'react-use'
|
||||||
|
|
||||||
export interface UserAvatarForUsernameProps extends Omit<UserAvatarProps, 'user'> {
|
export interface UserAvatarForUsernameProps extends Omit<UserAvatarProps, 'user'> {
|
||||||
username: string | null
|
username: string | null
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { UserAvatar } from './user-avatar'
|
|
||||||
import { render } from '@testing-library/react'
|
|
||||||
import type { UserInfo } from '../../../api/users/types'
|
import type { UserInfo } from '../../../api/users/types'
|
||||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||||
|
import { UserAvatar } from './user-avatar'
|
||||||
|
import { render } from '@testing-library/react'
|
||||||
|
|
||||||
describe('UserAvatar', () => {
|
describe('UserAvatar', () => {
|
||||||
const user: UserInfo = {
|
const user: UserInfo = {
|
||||||
|
|
|
@ -3,15 +3,14 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useCallback, useMemo } from 'react'
|
|
||||||
import { useTranslation } from 'react-i18next'
|
|
||||||
import { ShowIf } from '../show-if/show-if'
|
|
||||||
import styles from './user-avatar.module.scss'
|
|
||||||
import type { UserInfo } from '../../../api/users/types'
|
import type { UserInfo } from '../../../api/users/types'
|
||||||
|
import { ShowIf } from '../show-if/show-if'
|
||||||
import defaultAvatar from './default-avatar.png'
|
import defaultAvatar from './default-avatar.png'
|
||||||
|
import styles from './user-avatar.module.scss'
|
||||||
|
import React, { useCallback, useMemo } from 'react'
|
||||||
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
|
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
|
||||||
import type { OverlayInjectedProps } from 'react-bootstrap/Overlay'
|
import type { OverlayInjectedProps } from 'react-bootstrap/Overlay'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
export interface UserAvatarProps {
|
export interface UserAvatarProps {
|
||||||
size?: 'sm' | 'lg'
|
size?: 'sm' | 'lg'
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue