Skip to content

Stage v3.2.2#433

Merged
hiteshshetty-dev merged 29 commits intostage_v3from
develop_v3
May 14, 2025
Merged

Stage v3.2.2#433
hiteshshetty-dev merged 29 commits intostage_v3from
develop_v3

Conversation

@hiteshshetty-dev
Copy link
Copy Markdown
Contributor

This pull request introduces several changes, including the addition of a secrets scanning workflow, updates to the CHANGELOG.md and package.json files, and modifications to the FieldToolbar and FieldRevertComponent components. These changes aim to enhance security, improve documentation, and add functionality to the codebase.

Security Enhancements:

  • Added a new GitHub Actions workflow, secrets-scan.yml, to perform secrets scanning using Talisman. This includes downloading, verifying, and running the Talisman tool in a pre-commit hook. (.github/workflows/secrets-scan.yml)
  • Updated the .talismanrc configuration file to include file-specific ignore rules for the secrets scan. (.talismanrc)

Documentation Updates:

  • Updated CHANGELOG.md to reflect the release of version 3.2.2, including new features, bug fixes, and housekeeping changes. (CHANGELOG.md) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Updated the README.md file to reflect the new version (3.2.2) of the @contentstack/live-preview-utils package and its integrity hash. (README.md)

Versioning:

  • Incremented the version in package.json from 3.2.1 to 3.2.2 to signify the release of new features and fixes. (package.json)

Component Enhancements:

  • Enhanced the FieldRevertComponent by adding a disabled prop to buttons, improving usability when actions are restricted. (src/visualBuilder/components/FieldRevert/FieldRevertComponent.tsx) [1] [2] [3]
  • Updated the FieldToolbar component to include entryPermissions as a prop and adjusted logic to disable field actions based on permissions. (src/visualBuilder/components/FieldToolbar.tsx) [1] [2] [3] [4] [5]

faraazb-contentstack and others added 25 commits March 28, 2025 18:10
…n inline editable fields

A global state is used to track whether an input event was handled in the focussed field.
If no input was received on the contenteditable, but the value updated
through preview data, as noTrigger was false, we would revert the field
value to the previous one through the else clause.
Clear field schema map on variant change as it contains
a field - isUnlinkedVariant which depends on the current
selected variant for its value
…d-variant-switch

fix(VE-6191): clear field schema map on variant change
New tests for appendFieldToolbar, add tests to check if
getEntryPermissionsCached and isFieldDisabled are used correctly in
various functions
…n-disable-fields

feat(VE-5851): disable fields of update restricted entries
fix(VE-5361): update field event is not sent when input event does not occur in inline editable fields
@hiteshshetty-dev hiteshshetty-dev requested a review from a team as a code owner May 13, 2025 09:15
@hiteshshetty-dev hiteshshetty-dev requested review from Copilot and faraazb and removed request for a team May 13, 2025 09:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 bumps the version to 3.2.2 while enhancing security with a new secrets scan workflow, updating documentation and tests, and refining component logic by incorporating entry permissions for improved functionality. Key changes include:

  • Introducing async handling with getEntryPermissionsCached across multiple modules.
  • Adding new tests and updating existing ones for improved coverage and reliability.
  • Updating versioning, changelog, and configuration files for enhanced security and maintainability.

Reviewed Changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/visualBuilder/utils/test/fieldSchemaMap.test.ts Added test for clearing the field schema promise map.
src/visualBuilder/listeners/mouseHover.ts Integrated entry permission checks using getEntryPermissionsCached.
src/visualBuilder/listeners/mouseClick.ts Updated field schema and entry permission handling with async/await.
src/visualBuilder/index.ts Added a new state flag (focusFieldReceivedInput).
src/visualBuilder/generators/generateToolbar.tsx Changed appendFieldToolbar to be async and pass entryPermissions.
src/visualBuilder/generators/generateOverlay.tsx Updated state resets and field schema cache clearing on variant change.
Various test files Updated tests to support async execution and proper prop passing.
package.json, README.md, CHANGELOG.md Version bump and integrity updates.
.talismanrc & secrets-scan.yml Added new secrets scanning configuration and workflow.

Comment thread src/visualBuilder/listeners/mouseHover.ts
Comment thread src/visualBuilder/listeners/mouseClick.ts Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 13, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 70.83% 8394 / 11850
🔵 Statements 70.83% 8394 / 11850
🔵 Functions 69.21% 290 / 419
🔵 Branches 84.91% 1036 / 1220
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/visualBuilder/index.ts 56.86% 66.66% 42.85% 56.86% 94-101, 104-108, 111-123, 126-199, 205-237, 245-267, 318-321, 324-325
src/visualBuilder/visualBuilder.style.ts 100% 100% 100% 100%
src/visualBuilder/components/FieldToolbar.tsx 80.48% 79.54% 35.71% 80.48% 58-106, 159, 207-210, 233-242, 271-279, 287-288, 291-292, 343-349, 414, 451
src/visualBuilder/components/fieldLabelWrapper.tsx 94.22% 83.33% 75% 94.22% 84-88, 143-148, 152, 205-207
src/visualBuilder/components/FieldRevert/FieldRevertComponent.tsx 98.91% 94.44% 100% 98.91% 59-60
src/visualBuilder/eventManager/useVariantsPostMessageEvent.ts 100% 95.23% 100% 100%
src/visualBuilder/generators/generateOverlay.tsx 89.94% 79.16% 100% 89.94% 131-140, 177, 195-198, 222-225
src/visualBuilder/generators/generateToolbar.tsx 93.96% 90.47% 80% 93.96% 116-120, 149-150
src/visualBuilder/listeners/mouseClick.ts 74.53% 80% 90.9% 74.53% 103-104, 107-112, 125-153, 179-180, 225, 283-289, 313-318, 327-333, 351-361
src/visualBuilder/listeners/mouseHover.ts 61.83% 48.64% 58.33% 61.83% 37-44, 77-87, 93-94, 101-104, 107-109, 115, 121-129, 137-139, 141-165, 173-175, 177-179, 187-195, 198-202, 204, 206-208, 223-227, 249-252, 294-297
src/visualBuilder/utils/createCachedFetch.ts 100% 100% 100% 100%
src/visualBuilder/utils/fieldSchemaMap.ts 100% 90.9% 100% 100%
src/visualBuilder/utils/getEntryPermissions.ts 0% 0% 0% 0% 1-46
src/visualBuilder/utils/getEntryPermissionsCached.ts 0% 0% 0% 0% 1-8
src/visualBuilder/utils/handleFieldMouseDown.ts 100% 92.85% 100% 100%
src/visualBuilder/utils/handleIndividualFields.ts 96.92% 80% 100% 96.92% 93-94, 172-173
src/visualBuilder/utils/isFieldDisabled.ts 100% 96.42% 100% 100%
src/visualBuilder/utils/updateFocussedState.ts 56.14% 60.71% 100% 56.14% 45, 57-59, 61-63, 65, 200-203, 205-236, 323-327, 330-347, 350-360, 363-380, 387-432, 439-461, 467-469
Generated in workflow #409 for commit 166ddc5 by the Vitest Coverage Report Action

faraazb-contentstack and others added 3 commits May 13, 2025 16:32
Tests failed after adding finally and catch blocks in mouse hover
function
…n-disable-fields

fix(VE-5851): error handling for getEntryPermissionsCached
Copy link
Copy Markdown
Contributor

@faraazb faraazb left a comment

Choose a reason for hiding this comment

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

LGTM!

@hiteshshetty-dev hiteshshetty-dev merged commit 72548d9 into stage_v3 May 14, 2025
10 checks passed
@hiteshshetty-dev hiteshshetty-dev deleted the develop_v3 branch May 14, 2025 06:21
@hiteshshetty-dev hiteshshetty-dev restored the develop_v3 branch May 14, 2025 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants