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

Update data-validation.md #16183

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

LHBL2003
Copy link

Issues to change the documentation
#16076

PROTECTION_RULES extended by an example of what works in the WEB UI.

Fixes: #1234

Issues to change the documentation
netbox-community#16076

PROTECTION_RULES extended by an example of what works in the WEB UI.
@@ -96,6 +96,7 @@ The following colors are supported:

This is a mapping of models to [custom validators](../customization/custom-validation.md) against which an object is evaluated immediately prior to its deletion. If validation fails, the object is not deleted. An example is provided below:

**Example prevents the deletion of a site entry:**
Copy link
Member

Choose a reason for hiding this comment

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

Please change this to regular text, extending the paragraph above. Text emphasis should be used sparingly.


### Configuration via Web UI

![image](https://github.com/netbox-community/netbox/assets/46369917/6fb69ab8-1f13-4b86-b84c-ce697af8f679)
Copy link
Member

Choose a reason for hiding this comment

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

All images presented in the documentation must be included in the code base.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@LHBL2003 you actually need to include the image in the codebase and git-add it to the code so that it appears in the PR.

Copy link
Author

Choose a reason for hiding this comment

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

OK feels strange. But this means that the image is displayed as a path. :)

Copy link
Author

@LHBL2003 LHBL2003 May 23, 2024

Choose a reason for hiding this comment

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

@arthanson I'm not sure if I understand you correctly. Do I have to insert the image paths "![ Image ] ( https://..." into the code block python... ![ Image ] ( https://.... Or do you think I have to upload the images as an attachment on the Git Hub page so that they get an image ID "![IMG_0047](https://".
Sorry for the stupid question, I have now done the latter. Because I don't have a code base for the 2nd image.

Comment on lines 117 to 119
**Path:**
- WebUI (v3.x.x) --> Admin --> Configuration Config Revisions --> Add (or Edit last Config)
- WebUI (v4.0.0) --> Admin --> Configuration History --> Add (or Edit last Config)
Copy link
Member

Choose a reason for hiding this comment

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

It is not necessary to specify the navigation path.

Suggested change
**Path:**
- WebUI (v3.x.x) --> Admin --> Configuration Config Revisions --> Add (or Edit last Config)
- WebUI (v4.0.0) --> Admin --> Configuration History --> Add (or Edit last Config)

- WebUI (v3.x.x) --> Admin --> Configuration Config Revisions --> Add (or Edit last Config)
- WebUI (v4.0.0) --> Admin --> Configuration History --> Add (or Edit last Config)

**Example prevents the deletion of a device entry:**
Copy link
Member

Choose a reason for hiding this comment

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

As above, please convert this to regular text in paragraph form.

Copy link
Author

@LHBL2003 LHBL2003 left a comment

Choose a reason for hiding this comment

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

Revised according to jeremystretch suggestion.

@LHBL2003
Copy link
Author

I hope I did it right. At first it was difficult to find out how to revise the file. I hope I have triggered everything so that the review can continue. My first revision :D

Image inserted in code area
Copy link
Author

@LHBL2003 LHBL2003 left a comment

Choose a reason for hiding this comment

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

Image inserted in code area

Image uploaded as an attachment so that it has an image ID.
Copy link
Author

@LHBL2003 LHBL2003 left a comment

Choose a reason for hiding this comment

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

Image uploaded as an attachment so that it has an image ID.

@arthanson
Copy link
Collaborator

arthanson commented May 23, 2024

@LHBL2003 see (https://raw.githubusercontent.com/netbox-community/netbox/develop/docs/index.md) for an example, specifically the line:

[![NetBox UI](./media/screenshots/home-light.png)](./media/screenshots/home-light.png)

It points to this location in the source-tree (https://github.com/netbox-community/netbox/tree/develop/docs/media) so you will want to put any images into the source-tree in the appropriate place in under docs/media and make the link point to that. We do this so the documentation will work for people who locally install it.

…ration-History-Protection-rules-Example.png

Rename
…rotection-rules-Example.png to Configuration-History-Protection-rules-Example.png

Rename
Images netbox UI path specification.
Copy link
Author

@LHBL2003 LHBL2003 left a comment

Choose a reason for hiding this comment

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

Images netbox UI path specification.

@LHBL2003
Copy link
Author

LHBL2003 commented May 23, 2024

For God's sake, I would never have thought of that. You need documentation to insert pictures into the documentation :D
Now I know why there are only a few pictures in the folder :D Pictures are worth a thousand words. But I wouldn't have thought that you need a thousand words to show a picture :D
Thanks for the help. I hope it fits now. At least the pictures are displayed under the Change text.
I now have a question mark icon where the image should be, but hopefully that will disappear when it is where the documentation is hosted.

@LHBL2003
Copy link
Author

LHBL2003 commented May 23, 2024

Your are more familiar with the whole subject? If I understand it correctly, then example 1 is something that is stored in configuration.py. If so, then we should add it to the configuration that this must be entered in Configuration.py.

PROTECTION_RULES = {
    "dcim.site": [
        {
            "status": {
                "eq": "decommissioning"
            }
        },
        "my_plugin.validators.Validator1",
    ]
}

Wouldn't it make sense to document that you have to leave out the code if you don't use a validator class?

,
        "my_plugin.validators.Validator1",

Because I didn't understand it as a Newbie. And from current experience, I would say that the Codeshnipsel is interesting, but sometimes there are misunderstandings. I don't think the last comma at the end of the code snippet belongs there at all. But I don't know enough about the subject for that.

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.

None yet

3 participants