Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5ada359
chore: set feature branch version for dependencies
b41ex Sep 8, 2025
a752aee
refactor: remove operation.dataHash usages & add operation.documentId
CountRedClaw Sep 8, 2025
562041c
fix: add missing builder resolvers
CountRedClaw Sep 9, 2025
d0a1d68
refactor: use getDocuments and types from shared
CountRedClaw Sep 9, 2025
49daf42
Merge remote-tracking branch 'refs/remotes/origin/develop' into featu…
CountRedClaw Sep 11, 2025
ddaea5a
fix: build
CountRedClaw Sep 11, 2025
a9e3886
fix: build
CountRedClaw Sep 11, 2025
6d7e951
fix: add missing resolvers
CountRedClaw Sep 18, 2025
88b4b89
chore: merge branch 'develop' into feature/performance-optimization
b41ex Sep 20, 2025
bbe0d31
fix: merge problems
b41ex Sep 20, 2025
1e30478
fix: remove hashList according to api change
CountRedClaw Sep 25, 2025
66b7475
chore: set feature branch version for dependencies
b41ex Oct 2, 2025
cc4fec6
chore: merge branch 'develop' into feature/performance-optimization
b41ex Oct 2, 2025
e78a810
chore: fix linting errors
b41ex Oct 3, 2025
60f458f
fix: paths predicate for rest operation changes matches operation int…
b41ex Oct 11, 2025
771887e
refactor: rename methods to emphasize they are valid for REST operati…
b41ex Oct 11, 2025
96a11cd
fix: simplify properties population for prefix groups operation table…
b41ex Oct 11, 2025
118b92a
fix: simplify properties population based on new api-processor contra…
b41ex Oct 11, 2025
96b7f05
fix: process operation in the same way as in api-processor for prefix…
b41ex Oct 12, 2025
81f362c
Merge branch 'develop' into feature/performance-optimization
b41ex Oct 12, 2025
f36c6bb
chore: merge branch 'develop' into feature/performance-optimization
b41ex Oct 13, 2025
42eab76
fix: Operation View not shown for added/removed operations when compa…
b41ex Oct 13, 2025
e5a6bc7
refactor: simplify condition to load data based on new contract for p…
b41ex Oct 13, 2025
016c810
chore: merge remote-tracking branch 'refs/remotes/origin/feature/perf…
b41ex Oct 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "3.1.1"
}
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"@mui/lab": "5.0.0-alpha.120",
"@mui/material": "5.11.10",
"@mui/private-theming": "5.11.9",
"@netcracker/qubership-apihub-api-diff": "dev",
"@netcracker/qubership-apihub-api-doc-viewer": "dev",
"@netcracker/qubership-apihub-api-processor": "dev",
"@netcracker/qubership-apihub-api-unifier": "dev",
"@netcracker/qubership-apihub-api-visitor": "dev",
"@netcracker/qubership-apihub-apispec-view": "dev",
"@netcracker/qubership-apihub-api-diff": "feature-move-prefix-from-server-to-path",
"@netcracker/qubership-apihub-api-doc-viewer": "feature-performance-optimization",
"@netcracker/qubership-apihub-api-processor": "feature-performance-optimization",
"@netcracker/qubership-apihub-api-unifier": "feature-performance-optimization",
"@netcracker/qubership-apihub-api-visitor": "feature-performance-optimization",
"@netcracker/qubership-apihub-apispec-view": "feature-performance-optimization",
"@netcracker/qubership-apihub-class-view": "1.0.3",
"@netcracker/qubership-apihub-rest-playground": "1.2.0",
"@otjs/plaintext": "0.2.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import { COMPLETE_PUBLISH_STATUS, ERROR_PUBLISH_STATUS } from '@apihub/entities/
import { BUILD_TYPE, PackageVersionBuilder } from '@netcracker/qubership-apihub-api-processor'
import {
packageVersionResolver,
rawDocumentResolver,
versionDeprecatedResolver,
versionDocumentsResolver,
versionOperationsResolver,
versionReferencesResolver,
} from '@netcracker/qubership-apihub-ui-shared/utils/builder-resolvers'
Expand Down Expand Up @@ -77,6 +79,8 @@ const worker: PackageVersionBuilderWorker = {
versionReferencesResolver: await versionReferencesResolver(),
versionOperationsResolver: await versionOperationsResolver(),
versionDeprecatedResolver: await versionDeprecatedResolver(),
versionDocumentsResolver: await versionDocumentsResolver(),
rawDocumentResolver: await rawDocumentResolver(),
},
})

Expand Down
4 changes: 0 additions & 4 deletions packages/portal/server/mocks/packages/document-contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const OPENAPI_SPEC: DocumentDto = {
deprecated: true,
apiKind: 'bwc',
apiType: 'rest',
dataHash: 'sdfsdfsf242',
metadata: {
tags: ['RestControllerV1'],
path: '/v1/pets',
Expand All @@ -48,7 +47,6 @@ export const OPENAPI_SPEC: DocumentDto = {
deprecated: false,
apiKind: 'no-bwc',
apiType: 'rest',
dataHash: 'sdfsdfsf243',
metadata: {
tags: ['RestControllerV3'],
path: '/v3/fruit',
Expand All @@ -60,7 +58,6 @@ export const OPENAPI_SPEC: DocumentDto = {
title: 'Array Cars',
apiKind: 'bwc',
apiType: 'rest',
dataHash: 'sdfsdfsf244',
metadata: {
tags: ['RestControllerV5'],
path: '/v5/cars/array',
Expand All @@ -72,7 +69,6 @@ export const OPENAPI_SPEC: DocumentDto = {
title: 'Get Cars 2',
apiKind: 'bwc',
apiType: 'rest',
dataHash: 'sdfsdfsf245',
metadata: {
tags: ['A', 'B'],
path: '/v5/cars/array',
Expand Down
10 changes: 1 addition & 9 deletions packages/portal/server/mocks/packages/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export const OPERATIONS: Writeable<OperationsDto> = {
deprecated: true,
apiKind: 'bwc',
apiType: 'rest',
dataHash: 'sdfsdfsf242',
path: '/quoteManagement/v5/quote',
tags: ['RestControllerV5'],
method: 'get',
Expand All @@ -157,7 +156,6 @@ export const OPERATIONS: Writeable<OperationsDto> = {
deprecated: true,
apiKind: 'bwc',
apiType: 'rest',
dataHash: 'sdfsdfsf242',
path: '/quoteManagement/v5/quote',
tags: ['RestControllerV5'],
method: 'patch',
Expand All @@ -170,7 +168,6 @@ export const OPERATIONS: Writeable<OperationsDto> = {
deprecated: false,
apiKind: 'no-bwc',
apiType: 'rest',
dataHash: 'sdfsdfsf243',
tags: ['TMF'],
path: '/quoteManagement/v3/pets',
method: 'get',
Expand All @@ -182,7 +179,6 @@ export const OPERATIONS: Writeable<OperationsDto> = {
title: 'Array Quote',
apiKind: 'bwc',
apiType: 'rest',
dataHash: 'sdfsdfsf244',
tags: ['RestControllerV5', 'TMF'],
path: '/quoteManagement/v5/array',
method: 'get',
Expand All @@ -194,7 +190,6 @@ export const OPERATIONS: Writeable<OperationsDto> = {
title: 'Get Pets2',
apiKind: 'bwc',
apiType: 'rest',
dataHash: 'sdfsdfsf245',
tags: ['TMF', 'RestControllerV5'],
path: '/quoteManagement/v5/array',
method: 'post',
Expand All @@ -206,7 +201,6 @@ export const OPERATIONS: Writeable<OperationsDto> = {
data: graphQlOperationData,
operationId: 'query-fulltextquotesearch',
title: 'fullTextQuoteSearch',
dataHash: '3a2a746b578324e016ddbcdc4c3b462288fabc55',
apiKind: 'bwc',
apiType: 'graphql',
type: 'query',
Expand All @@ -218,7 +212,6 @@ export const OPERATIONS: Writeable<OperationsDto> = {
data: graphQlOperationData,
operationId: 'mutation-createorupdatesessioncontext',
title: 'createOrUpdateSessionContext',
dataHash: '045efe99015262f164d740e00e0b110e8a110fbb',
apiKind: 'bwc',
apiType: 'graphql',
type: 'mutation',
Expand All @@ -230,7 +223,6 @@ export const OPERATIONS: Writeable<OperationsDto> = {
data: graphQlOperationData,
operationId: 'subscription-postwaspublished',
title: 'postWasPublished',
dataHash: 'f202090d17c30e85b4170e23994746132c711891',
apiKind: 'bwc',
apiType: 'graphql',
type: 'subscription',
Expand Down Expand Up @@ -282,7 +274,7 @@ export const OPERATIONS: Writeable<OperationsDto> = {
export const DEPRECATED_OPERATIONS: Writeable<OperationsWithDeprecatedDto> = {
operations: OPERATIONS.operations.map((operation) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { data, dataHash, ...operationBaseProps } = operation
const { data, ...operationBaseProps } = operation
return {
deprecatedCount: operationBaseProps.deprecated ? '1' : '5',
deprecatedInPreviousVersions: operationBaseProps.deprecated ? ['2022.1', '2021.4'] : undefined,
Expand Down
5 changes: 1 addition & 4 deletions packages/portal/server/mocks/packages/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ type OperationMetadata = Readonly<{
apiType: ApiType
data?: object
packageRef?: string
dataHash?: string
deprecated?: boolean
tags?: string[]
}>
Expand Down Expand Up @@ -228,7 +227,7 @@ export type DeprecatedItemDto = Readonly<{
}>
export type DeprecatedItemsDto = ReadonlyArray<DeprecatedItemDto>

export type OperationWithDeprecatedDto = Omit<OperationDto, 'dataHash' | 'data'> & Readonly<{
export type OperationWithDeprecatedDto = Omit<OperationDto, 'data'> & Readonly<{
deprecatedCount?: string
deprecatedInfo?: object
deprecatedItems?: DeprecatedItemsDto
Expand Down Expand Up @@ -347,8 +346,6 @@ export type OperationChangesMetadata = Readonly<{
packageRef?: string
previousVersionPackageRef?: string
apiKind?: ApiKind
dataHash?: string
previousDataHash?: string
tags?: readonly string[]
}>

Expand Down
14 changes: 7 additions & 7 deletions packages/portal/src/entities/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/

import type { FileKey, Key } from './keys'
import type { FileFormat } from './file-formats'
import { UNKNOWN_FILE_FORMAT } from './file-formats'
import type {
OperationData,
OperationDto,
Expand All @@ -28,20 +26,19 @@ import type {
import { toPackageRef } from '@netcracker/qubership-apihub-ui-shared/entities/operations'
import type { SpecType } from '@netcracker/qubership-apihub-ui-shared/utils/specs'
import { UNKNOWN_SPEC_TYPE } from '@netcracker/qubership-apihub-ui-shared/utils/specs'
import type { FileFormat } from '@netcracker/qubership-apihub-ui-shared/utils/files'
import { getFileFormat } from '@netcracker/qubership-apihub-ui-shared/utils/files'
import type { MethodType } from '@netcracker/qubership-apihub-ui-shared/entities/method-types'
import type { GraphQlOperationType } from '@netcracker/qubership-apihub-ui-shared/entities/graphql-operation-types'

export type DocumentsDto = Readonly<{
documents: ReadonlyArray<DocumentDto>
packages: PackagesRefs
}>
import { type DocumentsDto } from '@netcracker/qubership-apihub-ui-shared/entities/documents'
import { UNKNOWN_FILE_FORMAT } from '@netcracker/qubership-apihub-ui-shared/entities/file-formats'

export type Documents = ReadonlyArray<Document>

export type Document = Readonly<{
key: Key
slug: Key
filename: string
title: string
type: SpecType
format: FileFormat
Expand All @@ -57,6 +54,7 @@ export type Document = Readonly<{
export type DocumentDto = Readonly<{
fileId: FileKey
slug: Key
filename: string
title: string
type: SpecType
format: FileFormat
Expand All @@ -74,6 +72,7 @@ export function toDocument(value: DocumentDto, packagesRefs?: PackagesRefs): Doc
return {
key: value.fileId,
slug: value.slug,
filename: value.filename,
title: value.title,
type: value.type,
format: value.format ?? getFileFormat(value.fileId),
Expand All @@ -100,6 +99,7 @@ export const EMPTY_DOC: Document = {
key: '',
title: '',
slug: '',
filename: '',
}

export type RestMetaData = {
Expand Down
2 changes: 1 addition & 1 deletion packages/portal/src/entities/project-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

import type { FileKey, Key } from './keys'
import type { FileFormat } from './file-formats'
import type { SpecType } from '@netcracker/qubership-apihub-ui-shared/utils/specs'
import type { ChangeStatus } from '@netcracker/qubership-apihub-ui-shared/entities/change-statuses'
import type { FileFormat } from '@netcracker/qubership-apihub-ui-shared/entities/file-formats'

export type FileData = {
content: FileContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { memo } from 'react'
import { useParams } from 'react-router-dom'
import { Box } from '@mui/material'
import { DocumentPreviewContentBody } from './DocumentPreviewContentBody'
import { usePublishedDocumentRaw } from '../usePublishedDocumentRaw'
import { usePackageParamsWithRef } from '../../usePackageParamsWithRef'
import { usePublishedDocumentRaw } from '@netcracker/qubership-apihub-ui-shared/hooks/documents/usePublishedDocumentRaw'

export const DocumentPreviewCard: FC = memo(() => {
const { documentId } = useParams()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ import {
import { isEmpty, isNotEmpty } from '@netcracker/qubership-apihub-ui-shared/utils/arrays'
import { LoadingIndicator } from '@netcracker/qubership-apihub-ui-shared/components/LoadingIndicator'
import { CONTENT_PLACEHOLDER_AREA, Placeholder } from '@netcracker/qubership-apihub-ui-shared/components/Placeholder'
import { getActionForOperation } from '@apihub/utils/operations'
import { getActionForRestOperation } from '@apihub/utils/operations'
import type { ChangeSeverity } from '@netcracker/qubership-apihub-ui-shared/entities/change-severities'
import {
ACTION_TYPE_COLOR_MAP,
ADD_ACTION_TYPE,
CHANGE_SEVERITIES,
REMOVE_ACTION_TYPE,
REPLACE_ACTION_TYPE,
} from '@netcracker/qubership-apihub-ui-shared/entities/change-severities'
import { format } from '@netcracker/qubership-apihub-ui-shared/utils/strings'
Expand Down Expand Up @@ -178,18 +176,19 @@ export const GroupCompareContent: FC<GroupCompareContentProps> = memo(({ groupCh
changeSummary,
metadata: metadataObject,
previousMetadata: previousMetadataObject,
diffs,
} = change

const metadata = metadataObject as OperationChangesMetadata & Partial<RestChangesMetadata> & Partial<GraphQLChangesMetadata>
const previousMetadata = previousMetadataObject as OperationChangesMetadata & Partial<RestChangesMetadata> & Partial<GraphQLChangesMetadata>

const { action } = diffs?.[0] ?? {}
const operationAction = getActionForOperation(change, REPLACE_ACTION_TYPE)
const operationAction = getActionForRestOperation(change, REPLACE_ACTION_TYPE)
const severity = getMajorSeverity(changeSummary!)

const isMetaDataPresent = !!(
metadata?.title && metadata?.path && metadata?.method ||
metadata?.title && metadata?.path && metadata?.method
)

const isPreviousMetaDataPresent = !!(
previousMetadata?.title && previousMetadata?.path && previousMetadata?.method
)

Expand Down Expand Up @@ -257,13 +256,12 @@ export const GroupCompareContent: FC<GroupCompareContentProps> = memo(({ groupCh
}}
/>
<Spec
key={operationId}
value={isMetaDataPresent && action !== ADD_ACTION_TYPE && previousMetadata ||
!previousMetadata && action === REMOVE_ACTION_TYPE ? {
title: previousMetadata?.title ?? metadata.title,
operationId: operationId,
method: previousMetadata?.method ?? metadata.method,
path: (previousMetadata as typeof metadata)?.path ?? metadata.path,
key={previousOperationId}
value={isPreviousMetaDataPresent ? {
title: previousMetadata.title,
operationId: previousOperationId,
method: previousMetadata.method,
path: previousMetadata.path as string,
} : undefined}
/>
</Box>
Expand All @@ -277,8 +275,7 @@ export const GroupCompareContent: FC<GroupCompareContentProps> = memo(({ groupCh
>
<Spec
key={`changed-${operationId}`}
value={isMetaDataPresent && action !== REMOVE_ACTION_TYPE && previousMetadata ||
!previousMetadata && action === ADD_ACTION_TYPE ? {
value={isMetaDataPresent ? {
title: metadata.title,
operationId: operationId,
method: metadata.method,
Expand Down
Loading
Loading