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

Closed
wants to merge 12 commits into from
Closed

Conversation

LHBL2003
Copy link

@LHBL2003 LHBL2003 commented May 17, 2024

Issues to change the documentation
#16076

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

Fixes: #16076

Issues to change the documentation
netbox-community#16076

PROTECTION_RULES extended by an example of what works in the WEB UI.
docs/configuration/data-validation.md Outdated Show resolved Hide resolved
docs/configuration/data-validation.md Outdated Show resolved Hide resolved
docs/configuration/data-validation.md Outdated Show resolved Hide resolved
docs/configuration/data-validation.md Outdated Show resolved Hide resolved
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.

LHBL2003 added 5 commits May 23, 2024 20:51
…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.

Copy link
Contributor

github-actions bot commented Jun 8, 2024

This PR has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further action is taken.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Jun 8, 2024
@arthanson arthanson requested a review from jeremystretch June 10, 2024 15:40
@arthanson
Copy link
Collaborator

@LHBL2003 I'm assuming this doesn't fix #1234 but is for #16076? If so, please edit the PR and change the "Fixes: #1234" line.

@LHBL2003
Copy link
Author

@LHBL2003 I'm assuming this doesn't fix #1234 but is for #16076? If so, please edit the PR and change the "Fixes: #1234" line.

Wherever the 1234 comes from. I must have overlooked it. Thank you

@@ -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.

This line is not needed. The above text references the example.

Comment on lines +114 to +125
Example prevents the deletion of a device entry:

```python
{
"dcim.device": [
{
"status": {
"eq": "decommissioning"
}
}
]
}
Copy link
Member

Choose a reason for hiding this comment

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

This is essentially a duplication of the example above, and is not needed.

]
}
```
[![NetBox UI](./media/screenshots/Configuration-History-Protection-rules-Example.png)](./media/screenshots/Configuration-History-Protection-rules-Example.png)
Copy link
Member

Choose a reason for hiding this comment

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

Both of your images are broken. Please be sure to render the documentation locally with mkdocs serve and verify your changes before submitting a PR.

```
[![NetBox UI](./media/screenshots/Configuration-History-Protection-rules-Example.png)](./media/screenshots/Configuration-History-Protection-rules-Example.png)

If you navigate to a device, rack or site, you will find the path in the top right-hand corner:
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't need to be a screenshot; it can just be an embedded tip.

@jeremystretch
Copy link
Member

Closing this for inactivity.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending closure Requires immediate attention to avoid being closed for inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants