Skip to content

Commit

Permalink
chore: more format issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyynthia committed Jan 22, 2024
1 parent 05346e8 commit 2e51a02
Show file tree
Hide file tree
Showing 28 changed files with 278 additions and 175 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ import org.springframework.data.domain.Pageable
import org.springframework.data.web.PagedResourcesAssembler
import org.springframework.data.web.SortDefault
import org.springframework.hateoas.PagedModel
import org.springframework.web.bind.annotation.*
import org.springframework.web.bind.annotation.CrossOrigin
import org.springframework.web.bind.annotation.DeleteMapping
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PutMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import io.swagger.v3.oas.annotations.tags.Tag as OpenApiTag

@Suppress("SpringJavaInjectionPointsAutowiringInspection")
Expand Down
6 changes: 5 additions & 1 deletion backend/app/src/test/kotlin/io/tolgee/AuthTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import io.tolgee.constants.Message
import io.tolgee.controllers.PublicController
import io.tolgee.fixtures.*
import io.tolgee.fixtures.andAssertThatJson
import io.tolgee.fixtures.andIsForbidden
import io.tolgee.fixtures.andIsUnauthorized
import io.tolgee.fixtures.generateUniqueString
import io.tolgee.fixtures.mapResponseTo
import io.tolgee.model.Project
import io.tolgee.security.authentication.JwtService
import io.tolgee.security.thirdParty.GithubOAuthDelegate.GithubEmailResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import io.tolgee.ProjectAuthControllerTest
import io.tolgee.batch.BatchJobService
import io.tolgee.development.testDataBuilder.data.BaseTestData
import io.tolgee.development.testDataBuilder.data.BatchJobsTestData
import io.tolgee.fixtures.*
import io.tolgee.fixtures.AuthorizedRequestFactory
import io.tolgee.fixtures.andAssertThatJson
import io.tolgee.fixtures.andIsOk
import io.tolgee.fixtures.andPrettyPrint
import io.tolgee.fixtures.isValidId
import io.tolgee.fixtures.node
import io.tolgee.fixtures.waitFor
import io.tolgee.fixtures.waitForNotThrowing
import io.tolgee.testing.annotations.ProjectJWTAuthTestMethod
import io.tolgee.testing.assert
import net.javacrumbs.jsonunit.assertj.JsonAssert
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package io.tolgee.api.v2.controllers

import io.tolgee.development.testDataBuilder.data.AdministrationTestData
import io.tolgee.fixtures.*
import io.tolgee.fixtures.andAssertThatJson
import io.tolgee.fixtures.andGetContentAsString
import io.tolgee.fixtures.andIsForbidden
import io.tolgee.fixtures.andIsOk
import io.tolgee.fixtures.andPrettyPrint
import io.tolgee.fixtures.node
import io.tolgee.model.UserAccount
import io.tolgee.testing.AuthorizedControllerTest
import io.tolgee.testing.assertions.Assertions.assertThat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import io.tolgee.development.testDataBuilder.data.ApiKeysTestData
import io.tolgee.development.testDataBuilder.data.LanguagePermissionsTestData
import io.tolgee.dtos.request.apiKey.CreateApiKeyDto
import io.tolgee.dtos.request.apiKey.V2EditApiKeyDto
import io.tolgee.fixtures.*
import io.tolgee.fixtures.andAssertThatJson
import io.tolgee.fixtures.andIsBadRequest
import io.tolgee.fixtures.andIsForbidden
import io.tolgee.fixtures.andIsOk
import io.tolgee.fixtures.andPrettyPrint
import io.tolgee.fixtures.isValidId
import io.tolgee.fixtures.node
import io.tolgee.model.enums.Scope
import io.tolgee.testing.AuthorizedControllerTest
import io.tolgee.testing.assert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import org.mockito.Mockito
import org.mockito.kotlin.*
import org.mockito.kotlin.any
import org.mockito.kotlin.doAnswer
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.mock.mockito.MockBean
import org.springframework.boot.test.mock.mockito.SpyBean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import com.fasterxml.jackson.annotation.JsonProperty
import io.tolgee.configuration.tolgee.machineTranslation.AzureCognitiveTranslationProperties
import org.springframework.beans.factory.config.ConfigurableBeanFactory
import org.springframework.context.annotation.Scope
import org.springframework.http.*
import org.springframework.http.HttpEntity
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
import org.springframework.stereotype.Component
import org.springframework.web.client.RestTemplate
import org.springframework.web.client.exchange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.beans.factory.config.BeanDefinition
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.context.ApplicationContext
import org.springframework.context.annotation.*
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Primary
import org.springframework.context.annotation.Scope
import org.springframework.context.annotation.ScopedProxyMode
import org.springframework.web.context.annotation.RequestScope

@Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ package io.tolgee.development.testDataBuilder.data

import io.tolgee.development.testDataBuilder.builders.ProjectBuilder
import io.tolgee.development.testDataBuilder.builders.TestDataBuilder
import io.tolgee.model.*
import io.tolgee.model.ApiKey
import io.tolgee.model.Language
import io.tolgee.model.Permission
import io.tolgee.model.Project
import io.tolgee.model.UserAccount
import io.tolgee.model.enums.ProjectPermissionType
import io.tolgee.model.enums.Scope
import io.tolgee.model.translation.Translation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import io.tolgee.constants.Caches
import io.tolgee.dtos.cacheable.automations.AutomationDto
import io.tolgee.exceptions.NotFoundException
import io.tolgee.model.Project
import io.tolgee.model.automations.*
import io.tolgee.model.automations.Automation
import io.tolgee.model.automations.AutomationAction
import io.tolgee.model.automations.AutomationActionType
import io.tolgee.model.automations.AutomationTrigger
import io.tolgee.model.automations.AutomationTriggerType
import io.tolgee.model.contentDelivery.ContentDeliveryConfig
import io.tolgee.model.webhook.WebhookConfig
import io.tolgee.repository.AutomationRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import io.tolgee.testing.assert
import net.javacrumbs.jsonunit.assertj.assertThatJson
import org.junit.jupiter.api.Test
import org.mockito.Mockito
import org.mockito.kotlin.*
import org.mockito.kotlin.any
import org.mockito.kotlin.doAnswer
import org.mockito.kotlin.eq
import org.mockito.kotlin.mock
import org.mockito.kotlin.whenever
import org.springframework.http.HttpEntity
import org.springframework.http.HttpMethod
import org.springframework.http.HttpStatusCode
Expand Down
13 changes: 11 additions & 2 deletions backend/testing/src/main/kotlin/io/tolgee/AbstractSpringTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ import io.tolgee.configuration.tolgee.machineTranslation.TolgeeMachineTranslatio
import io.tolgee.constants.MtServiceType
import io.tolgee.development.DbPopulatorReal
import io.tolgee.development.testDataBuilder.TestDataService
import io.tolgee.repository.*
import io.tolgee.repository.EmailVerificationRepository
import io.tolgee.repository.KeyRepository
import io.tolgee.repository.OrganizationRepository
import io.tolgee.repository.OrganizationRoleRepository
import io.tolgee.repository.ProjectRepository
import io.tolgee.security.InitialPasswordManager
import io.tolgee.service.EmailVerificationService
import io.tolgee.service.ImageUploadService
Expand All @@ -36,7 +40,12 @@ import io.tolgee.service.organization.OrganizationRoleService
import io.tolgee.service.organization.OrganizationService
import io.tolgee.service.project.LanguageStatsService
import io.tolgee.service.project.ProjectService
import io.tolgee.service.security.*
import io.tolgee.service.security.ApiKeyService
import io.tolgee.service.security.MfaService
import io.tolgee.service.security.PatService
import io.tolgee.service.security.PermissionService
import io.tolgee.service.security.UserAccountService
import io.tolgee.service.security.UserPreferencesService
import io.tolgee.service.translation.TranslationCommentService
import io.tolgee.service.translation.TranslationService
import io.tolgee.testing.AbstractTransactionalTest
Expand Down
19 changes: 13 additions & 6 deletions webapp/src/component/languages/LanguageAutocomplete.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import React, {FC, ReactNode, useState} from 'react';
import {Autocomplete, Box, IconButton, InputAdornment, MenuItem, TextField} from '@mui/material';
import {Add, Clear} from '@mui/icons-material';
import {suggest} from '@tginternal/language-util';
import {SuggestResult} from '@tginternal/language-util/lib/suggesting';
import {T} from '@tolgee/react';
import React, { FC, ReactNode, useState } from 'react';
import {
Autocomplete,
Box,
IconButton,
InputAdornment,
MenuItem,
TextField,
} from '@mui/material';
import { Add, Clear } from '@mui/icons-material';
import { suggest } from '@tginternal/language-util';
import { SuggestResult } from '@tginternal/language-util/lib/suggesting';
import { T } from '@tolgee/react';

export type AutocompleteOption = Omit<SuggestResult, 'languageId'> & {
isNew?: true;
Expand Down
8 changes: 4 additions & 4 deletions webapp/src/component/layout/BaseViewAddButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Button} from '@mui/material';
import {Link} from 'react-router-dom';
import {Add} from '@mui/icons-material';
import {T} from '@tolgee/react';
import { Button } from '@mui/material';
import { Link } from 'react-router-dom';
import { Add } from '@mui/icons-material';
import { T } from '@tolgee/react';

export const BaseViewAddButton = (props: {
addLinkTo?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {Box, Typography} from '@mui/material';
import {T, useTranslate} from '@tolgee/react';
import {useHistory} from 'react-router-dom';
import { Box, Typography } from '@mui/material';
import { T, useTranslate } from '@tolgee/react';
import { useHistory } from 'react-router-dom';

import {DashboardPage} from 'tg.component/layout/DashboardPage';
import {LINKS} from 'tg.constants/links';
import {useMessage} from 'tg.hooks/useSuccessMessage';
import {useBillingApiMutation} from 'tg.service/http/useQueryApi';
import {BaseAdministrationView} from './components/BaseAdministrationView';
import {CloudPlanForm} from './components/CloudPlanForm';
import { DashboardPage } from 'tg.component/layout/DashboardPage';
import { LINKS } from 'tg.constants/links';
import { useMessage } from 'tg.hooks/useSuccessMessage';
import { useBillingApiMutation } from 'tg.service/http/useQueryApi';
import { BaseAdministrationView } from './components/BaseAdministrationView';
import { CloudPlanForm } from './components/CloudPlanForm';

export const AdministrationCloudPlanCreateView = () => {
const messaging = useMessage();
Expand Down
23 changes: 13 additions & 10 deletions webapp/src/views/administration/AdministrationCloudPlanEditView.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import {Box, Typography} from '@mui/material';
import {T, useTranslate} from '@tolgee/react';
import {useHistory, useRouteMatch} from 'react-router-dom';
import {SpinnerProgress} from 'tg.component/SpinnerProgress';
import { Box, Typography } from '@mui/material';
import { T, useTranslate } from '@tolgee/react';
import { useHistory, useRouteMatch } from 'react-router-dom';
import { SpinnerProgress } from 'tg.component/SpinnerProgress';

import {DashboardPage} from 'tg.component/layout/DashboardPage';
import {LINKS, PARAMS} from 'tg.constants/links';
import {useMessage} from 'tg.hooks/useSuccessMessage';
import {useBillingApiMutation, useBillingApiQuery,} from 'tg.service/http/useQueryApi';
import {BaseAdministrationView} from './components/BaseAdministrationView';
import {CloudPlanForm} from './components/CloudPlanForm';
import { DashboardPage } from 'tg.component/layout/DashboardPage';
import { LINKS, PARAMS } from 'tg.constants/links';
import { useMessage } from 'tg.hooks/useSuccessMessage';
import {
useBillingApiMutation,
useBillingApiQuery,
} from 'tg.service/http/useQueryApi';
import { BaseAdministrationView } from './components/BaseAdministrationView';
import { CloudPlanForm } from './components/CloudPlanForm';

export const AdministrationCloudPlanEditView = () => {
const match = useRouteMatch();
Expand Down
33 changes: 22 additions & 11 deletions webapp/src/views/administration/AdministrationCloudPlansView.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
import {T, useTranslate} from '@tolgee/react';
import {Box, Button, Chip, IconButton, ListItem, ListItemText, Paper,} from '@mui/material';
import { T, useTranslate } from '@tolgee/react';
import {
Box,
Button,
Chip,
IconButton,
ListItem,
ListItemText,
Paper,
} from '@mui/material';

import {DashboardPage} from 'tg.component/layout/DashboardPage';
import {LINKS, PARAMS} from 'tg.constants/links';
import {useBillingApiMutation, useBillingApiQuery,} from 'tg.service/http/useQueryApi';
import {BaseAdministrationView} from './components/BaseAdministrationView';
import {Link} from 'react-router-dom';
import {Delete} from '@mui/icons-material';
import {useMessage} from 'tg.hooks/useSuccessMessage';
import {confirmation} from 'tg.hooks/confirmation';
import {components} from 'tg.service/billingApiSchema.generated';
import { DashboardPage } from 'tg.component/layout/DashboardPage';
import { LINKS, PARAMS } from 'tg.constants/links';
import {
useBillingApiMutation,
useBillingApiQuery,
} from 'tg.service/http/useQueryApi';
import { BaseAdministrationView } from './components/BaseAdministrationView';
import { Link } from 'react-router-dom';
import { Delete } from '@mui/icons-material';
import { useMessage } from 'tg.hooks/useSuccessMessage';
import { confirmation } from 'tg.hooks/confirmation';
import { components } from 'tg.service/billingApiSchema.generated';

type CloudPlanModel = components['schemas']['CloudPlanModel'];

Expand Down
18 changes: 9 additions & 9 deletions webapp/src/views/administration/AdministrationEeLicenseView.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {useTranslate} from '@tolgee/react';
import {Box, styled} from '@mui/material';
import { useTranslate } from '@tolgee/react';
import { Box, styled } from '@mui/material';

import {DashboardPage} from 'tg.component/layout/DashboardPage';
import {useApiQuery} from 'tg.service/http/useQueryApi';
import {SetupLicenceKey} from './eeLicense/SetupLicenceKey';
import {ActiveEeLicense} from './eeLicense/ActiveEeLicense';
import {BaseAdministrationView} from './components/BaseAdministrationView';
import {LINKS} from 'tg.constants/links';
import {EeLicenseHint} from './eeLicense/EeLicenseHint';
import { DashboardPage } from 'tg.component/layout/DashboardPage';
import { useApiQuery } from 'tg.service/http/useQueryApi';
import { SetupLicenceKey } from './eeLicense/SetupLicenceKey';
import { ActiveEeLicense } from './eeLicense/ActiveEeLicense';
import { BaseAdministrationView } from './components/BaseAdministrationView';
import { LINKS } from 'tg.constants/links';
import { EeLicenseHint } from './eeLicense/EeLicenseHint';

const StyledWrapper = styled('div')`
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {Box, Typography} from '@mui/material';
import {T, useTranslate} from '@tolgee/react';
import {useHistory} from 'react-router-dom';
import { Box, Typography } from '@mui/material';
import { T, useTranslate } from '@tolgee/react';
import { useHistory } from 'react-router-dom';

import {DashboardPage} from 'tg.component/layout/DashboardPage';
import {LINKS} from 'tg.constants/links';
import {useMessage} from 'tg.hooks/useSuccessMessage';
import {useBillingApiMutation} from 'tg.service/http/useQueryApi';
import {BaseAdministrationView} from './components/BaseAdministrationView';
import {EePlanForm} from './components/EePlanForm';
import { DashboardPage } from 'tg.component/layout/DashboardPage';
import { LINKS } from 'tg.constants/links';
import { useMessage } from 'tg.hooks/useSuccessMessage';
import { useBillingApiMutation } from 'tg.service/http/useQueryApi';
import { BaseAdministrationView } from './components/BaseAdministrationView';
import { EePlanForm } from './components/EePlanForm';

export const AdministrationEePlanCreateView = () => {
const messaging = useMessage();
Expand Down
23 changes: 13 additions & 10 deletions webapp/src/views/administration/AdministrationEePlanEditView.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import {Box, Typography} from '@mui/material';
import {T, useTranslate} from '@tolgee/react';
import {useHistory, useRouteMatch} from 'react-router-dom';
import { Box, Typography } from '@mui/material';
import { T, useTranslate } from '@tolgee/react';
import { useHistory, useRouteMatch } from 'react-router-dom';

import {SpinnerProgress} from 'tg.component/SpinnerProgress';
import {DashboardPage} from 'tg.component/layout/DashboardPage';
import {LINKS, PARAMS} from 'tg.constants/links';
import {useMessage} from 'tg.hooks/useSuccessMessage';
import {useBillingApiMutation, useBillingApiQuery,} from 'tg.service/http/useQueryApi';
import {BaseAdministrationView} from './components/BaseAdministrationView';
import {EePlanForm} from './components/EePlanForm';
import { SpinnerProgress } from 'tg.component/SpinnerProgress';
import { DashboardPage } from 'tg.component/layout/DashboardPage';
import { LINKS, PARAMS } from 'tg.constants/links';
import { useMessage } from 'tg.hooks/useSuccessMessage';
import {
useBillingApiMutation,
useBillingApiQuery,
} from 'tg.service/http/useQueryApi';
import { BaseAdministrationView } from './components/BaseAdministrationView';
import { EePlanForm } from './components/EePlanForm';

export const AdministrationEePlanEditView = () => {
const match = useRouteMatch();
Expand Down

0 comments on commit 2e51a02

Please sign in to comment.