refactor(frontend): switch to DTOs from @hedgedoc/commons

Co-authored-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2025-03-29 13:51:02 +01:00 committed by Philip Molares
parent deee8e885f
commit e411ddf099
121 changed files with 620 additions and 819 deletions

View file

@ -1,11 +1,11 @@
/*
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import type { NotePermissions } from '@hedgedoc/commons'
import type { NotePermissionsDto } from '@hedgedoc/commons'
const mockPermissionChangeApiRoutes = (permission: NotePermissions) => {
const mockPermissionChangeApiRoutes = (permission: NotePermissionsDto) => {
cy.intercept('PUT', 'api/private/notes/mock-note/metadata/permissions/groups/_EVERYONE', {
statusCode: 200,
body: permission

View file

@ -1,12 +1,12 @@
/*
* SPDX-FileCopyrightText: 2024 The HedgeDoc developers (see AUTHORS file)
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import type { AuthProvider } from '../../src/api/config/types'
import { AuthProviderType } from '../../src/api/config/types'
import type { ProviderType } from '../../src/api/config/types'
import { ProviderType } from '../../src/api/config/types'
const initLoggedOutTestWithCustomAuthProviders = (cy: Cypress.cy, enabledProviders: AuthProvider[]) => {
const initLoggedOutTestWithCustomAuthProviders = (cy: Cypress.cy, enabledProviders: ProviderType[]) => {
cy.logOut()
cy.loadConfig({
authProviders: enabledProviders
@ -48,7 +48,7 @@ describe('When logged-out ', () => {
it('sign-in button points to login route: internal', () => {
initLoggedOutTestWithCustomAuthProviders(cy, [
{
type: AuthProviderType.LOCAL
type: ProviderType.LOCAL
}
])
cy.getByCypressId('sign-in-button')
@ -60,7 +60,7 @@ describe('When logged-out ', () => {
it('sign-in button points to login route: ldap', () => {
initLoggedOutTestWithCustomAuthProviders(cy, [
{
type: AuthProviderType.LDAP,
type: ProviderType.LDAP,
identifier: 'cy-ldap',
providerName: 'cy LDAP'
}
@ -76,7 +76,7 @@ describe('When logged-out ', () => {
it('sign-in button points to auth-provider', () => {
initLoggedOutTestWithCustomAuthProviders(cy, [
{
type: AuthProviderType.OIDC,
type: ProviderType.OIDC,
identifier: 'github',
providerName: 'GitHub',
theme: 'github'
@ -94,13 +94,13 @@ describe('When logged-out ', () => {
it('sign-in button points to login route', () => {
initLoggedOutTestWithCustomAuthProviders(cy, [
{
type: AuthProviderType.OIDC,
type: ProviderType.OIDC,
identifier: 'github',
providerName: 'GitHub',
theme: 'github'
},
{
type: AuthProviderType.OIDC,
type: ProviderType.OIDC,
identifier: 'gitlab',
providerName: 'GitLab',
theme: 'gitlab'
@ -117,13 +117,13 @@ describe('When logged-out ', () => {
it('sign-in button points to login route', () => {
initLoggedOutTestWithCustomAuthProviders(cy, [
{
type: AuthProviderType.OIDC,
type: ProviderType.OIDC,
identifier: 'github',
providerName: 'GitHub',
theme: 'github'
},
{
type: AuthProviderType.LOCAL
type: ProviderType.LOCAL
}
])
cy.getByCypressId('sign-in-button')