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

fix: add guards for doc editor #1148

Merged
merged 5 commits into from
May 28, 2024
Merged

fix: add guards for doc editor #1148

merged 5 commits into from
May 28, 2024

Conversation

saravmajestic
Copy link
Collaborator

@saravmajestic saravmajestic commented May 21, 2024

Overview

Problem

  • We cannot display documentation editor if there is any error in project or active open file is not a model. So it is confusing for the user to know what is the reason for not showing documentation of model

Solution

  • Show warning message if the open file is not valid model
  • show error message if there is any error in project and a button to view problems tab

Screenshot/Demo

https://www.loom.com/share/b8f5ca6ac24a460690af485830c50723?sid=03fb89e1-9b7a-4601-8f3e-e075fb19c746

How to test

  • open a schema.yml file
  • should see warning message
  • delete the profile for the project, delete the target directory
  • on refresh should see the error message with button

Checklist

  • I have run this code and it appears to resolve the stated issue
  • README.md updated and added information about my change

@saravmajestic saravmajestic self-assigned this May 21, 2024
@saravmajestic saravmajestic requested a review from mdesmet May 21, 2024 12:05
Copy link
Contributor

@mdesmet mdesmet left a comment

Choose a reason for hiding this comment

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

LGTM except the text. @anandgupta42: any views?

): Promise<DBTDocumentation | undefined> {
private getMissingDocumentationMessage(filePath?: string) {
const message =
"Documentation could be viewed for valid models only. Please open a valid model.";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Documentation could be viewed for valid models only. Please open a valid model.";
"Open a dbt model to edit the documentation";

@mdesmet mdesmet merged commit 8d19138 into master May 28, 2024
7 checks passed
@mdesmet mdesmet deleted the chore/gaurd-rails-doc-editor branch May 28, 2024 06:12
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.

3 participants