Skip to content

feat: add pin resource type, view and table - #1505

Merged
boris-w merged 3 commits into
developfrom
feat/pin-table-and-view
May 9, 2025
Merged

feat: add pin resource type, view and table#1505
boris-w merged 3 commits into
developfrom
feat/pin-table-and-view

Conversation

@boris-w

@boris-w boris-w commented May 6, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@boris-w
boris-w requested review from Copilot and tea-artist May 6, 2025 08:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds new pin resource types (Table and View) along with associated frontend components, API schema updates, and backend service enhancements to support listing, pinning, and unpinning these new resource types.

  • Updated the PinType enum and OpenAPI schemas to include Table and View.
  • Added UI components (PinViewItem, StarButton, etc.) to handle pin interactions for Table and View.
  • Enhanced backend logic in the PinService and added e2e tests to ensure proper pin list retrieval and order updates.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/openapi/src/pin/types.ts Added new enum values for Table and View.
packages/openapi/src/pin/get-list.ts Updated the schema to include additional properties (name, icon, parentBaseId, viewMeta).
apps/nextjs-app/src/features/app/blocks/view/list/ViewListItem.tsx Added pin status display and incorporated a PinViewItem component for views.
apps/nextjs-app/src/features/app/blocks/view/list/PinViewItem.tsx New component to toggle view pin state with loading states and query invalidation.
apps/nextjs-app/src/features/app/blocks/table-list/TableOperation.tsx Integrated StarButton for table pins.
apps/nextjs-app/src/features/app/blocks/space/space-side-bar/PinList.tsx Removed unused maps to streamline pin list rendering.
apps/nextjs-app/src/features/app/blocks/space/space-side-bar/PinItem.tsx Adjusted rendering logic for new pin types (Table and View) and refactored navigation links.
apps/nestjs-backend/test/pin.e2e-spec.ts Introduced comprehensive tests covering all pin types and order updates.
apps/nestjs-backend/src/features/pin/pin.service.ts Extended resource lookup logic to aggregate metadata for Table and View pins and added event listeners for resource deletion.
Comments suppressed due to low confidence (1)

apps/nextjs-app/src/features/app/blocks/space/space-side-bar/PinItem.tsx:115

  • [nitpick] Consider handling unknown pin types more gracefully rather than rendering the text 'unknown'. Returning null or a dedicated fallback component might improve the user experience.
default:
        return <div>unknown</div>;

parentBaseId: view.baseId,
viewMeta: {
type: view.type,
pluginLogo: view.options ? JSON.parse(view.options)?.pluginLogo : undefined,

Copilot AI May 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parsing JSON from view.options without a try-catch may lead to runtime errors if the options string is not valid JSON. Consider wrapping the JSON.parse call in a try-catch block to safely handle malformed input.

Suggested change
pluginLogo: view.options ? JSON.parse(view.options)?.pluginLogo : undefined,
pluginLogo: (() => {
if (!view.options) return undefined;
try {
return JSON.parse(view.options)?.pluginLogo;
} catch (error) {
return undefined;
}
})(),

Copilot uses AI. Check for mistakes.
@boris-w boris-w added the preview This issue is already ready for preview label May 8, 2025
@github-actions

github-actions Bot commented May 9, 2025

Copy link
Copy Markdown
Contributor

Deployment Status: ✅ Success
🔗 Preview URL: https://pr-1505.sealoshzh.site

@github-actions

github-actions Bot commented May 9, 2025

Copy link
Copy Markdown
Contributor

Deployment Status: ✅ Success
🔗 Preview URL: https://pr-1505.sealoshzh.site

@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 14923417214

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 133 of 146 (91.1%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall first build on feat/pin-table-and-view at 80.787%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/nestjs-backend/src/features/pin/pin.service.ts 133 146 91.1%
Totals Coverage Status
Change from base Build 14850922885: 80.8%
Covered Lines: 37078
Relevant Lines: 45896

💛 - Coveralls

@github-actions

github-actions Bot commented May 9, 2025

Copy link
Copy Markdown
Contributor

Deployment Status: ✅ Success
🔗 Preview URL: https://pr-1505.sealoshzh.site

@boris-w
boris-w merged commit dcaeee1 into develop May 9, 2025
@boris-w
boris-w deleted the feat/pin-table-and-view branch May 9, 2025 09:03
@github-actions

github-actions Bot commented May 9, 2025

Copy link
Copy Markdown
Contributor

🧹 Preview Environment Cleanup

tea-artist added a commit that referenced this pull request Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview This issue is already ready for preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants