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

Feature: Add edit view #353

Merged
merged 4 commits into from
Nov 9, 2024
Merged

Feature: Add edit view #353

merged 4 commits into from
Nov 9, 2024

Conversation

SchoolGuy
Copy link
Member

@SchoolGuy SchoolGuy commented Nov 4, 2024

Fixes #66

This PR adds the ability to edit Cobbler items (with the exception of network interfaces). Furthermore the PR switches from the custom XML-RPC API Client types to native Map and Array types. Lastly, this PR updates the eslint configuration to include prettier.

For the purpose of editing Cobbler items, I have introduced a second form on the same page that is read-only which contains the fields that are not editable. The edit view is able to set non string fields to inherit via a checkbox that can be found underneath. Dictionary/Map type fields are having the same issues as the CLI with ordering (see cobbler/cobbler#3797).

Developing with the Web UI seems to be a bit annoying at the moment because we don't save the credentials and token in memory and with every hot-reload this token ist lost. As such one needs to manually log out and in to have a valid token. This was already the case before but wasn't as evident since many read-only methods don't actually validate the token.

Since Templates and Snippets are not items from a backend perspective they cannot be edited, copied or renamed at the moment.

Screenshots:

Read view with read-only fields:

grafik

Edit view:

grafik

Cancel confirmation:

grafik

Save button:

grafik

@SchoolGuy SchoolGuy added this to the V0.0.1 milestone Nov 4, 2024
@github-actions github-actions bot added the Frontend Project cobbler-frontend label Nov 4, 2024
@SchoolGuy SchoolGuy force-pushed the feature/edit-view branch 2 times, most recently from 166a71f to c58e89b Compare November 5, 2024 16:34
@SchoolGuy
Copy link
Member Author

SchoolGuy commented Nov 5, 2024

Adding and removing Map keys works now. The issue is submitting them because the datatype is not Map but instead it is a general object, this however needs to be fixed everywhere in the stack.

Edit: Editing lists is already working.

@github-actions github-actions bot added TS-XMLRPC Project typescript-xmlrpc API-Client Project cobbler-client labels Nov 6, 2024
@SchoolGuy
Copy link
Member Author

Editing Dictionaries and Lists works for Distro but there are quite some bugs that need to be smoothed out. Changing from inherit to non inherit and vice-versa doesn't work yet.

@SchoolGuy
Copy link
Member Author

Now disabling the input for fields that are marked as inherited is working for Distros.

@SchoolGuy
Copy link
Member Author

Switching between inherited and non-inherited values is working now. Editing lists and maps is working now. As such there is now some bugfixing and code-deduplication to do. Other then that the approach has to be put into place with non-distro items.

@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Nov 8, 2024
@SchoolGuy SchoolGuy force-pushed the feature/edit-view branch 2 times, most recently from eda8568 to 26824c6 Compare November 9, 2024 11:28
@SchoolGuy
Copy link
Member Author

Before merging this PR I will need to do some manual testing. Automatic testing is not feasible since the changes are still too rapid to work reliably without eating too much time.

@SchoolGuy
Copy link
Member Author

SchoolGuy commented Nov 9, 2024

I found a few small things but overall it seems that editing items via the UI seems to work quite okay. I haven't encountered any major issues so far.

This means I will merge this PR and implement other missing features in follow-up PRs. I don't believe though that after merging this a first alpha can be tagged. For this too much functionality is missing at the moment.

@SchoolGuy SchoolGuy merged commit 7643714 into main Nov 9, 2024
14 of 16 checks passed
@SchoolGuy SchoolGuy deleted the feature/edit-view branch November 9, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API-Client Project cobbler-client dependencies Pull requests that update a dependency file Frontend Project cobbler-frontend TS-XMLRPC Project typescript-xmlrpc
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Edit view for specific items
1 participant