Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EDU-465: Angular live previewing data models #3915

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

uttej-vsk
Copy link
Contributor

Description

This is similar to a previous PR on React that focused on live previewing the data model.

@samijaber Whenever you are back on Tuesday, please review this.

Copy link

changeset-bot bot commented Feb 15, 2025

⚠️ No Changeset found

Latest commit: 2b68209

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

gitguardian bot commented Feb 15, 2025

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
11707119 Triggered Generic High Entropy Secret def49f6 packages/sdks/snippets/angular-16-ssr/src/app/live-preview/live-preview.component.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link

nx-cloud bot commented Feb 15, 2025

View your CI Pipeline Execution ↗ for commit 2b68209.

Command Status Duration Result
nx test @snippet/react ❌ Failed 2m 23s View ↗
nx test @snippet/angular-16 ✅ Succeeded 2m 47s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-21 21:52:09 UTC

})
export class LivePreviewComponent implements OnInit, OnDestroy {
content: BuilderContent | null = null;
loading = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

The initial loading should be false, and the template should have a condition: when !loading && !content it should display "No Data."

Copy link
Contributor

Choose a reason for hiding this comment

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

(I checked the React snippets, and this feedback also applies there)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@samijaber Initially, when the data is being fetched, the loading should be true right? Using finally, shouldn't we change to false once fetchOneEntry resolves to the content?

Since this is a live preview and we check live updates within the content entry of a data model, I believe that displaying either an error or a loading indicator is unnecessary. While this may be useful in a browser, based on what I've learned through Madison, customers are expected to use this feature exclusively within the content entry. Do you think we can remove the loading and error states altogether so that we can make the code more cleaner?

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.

2 participants