-
Notifications
You must be signed in to change notification settings - Fork 106
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
Enhanced Project Creation Functionality: Dynamic Default ValuesNew feature #1741
Conversation
…thon virtual environment
Updated the Flask route '/get_default_values_for_backend' to dynamically provide default values for project creation/editing based on the selected backend. Added logic in the Python backend to determine and return default values such as name, homepage, version URL, version scheme, version pattern, version prefix, pre-release filter, and version filter. Integrated JavaScript code to handle AJAX requests and populate form fields with default values retrieved from the server based on the selected backend. Improved user experience by enabling users to effortlessly fill in project details with default values, enhancing efficiency and ease of use.
Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci ✔️ fi-tox-mypy SUCCESS in 5m 55s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't what I have in mind, but you can use it as base for future work.
news/1723.other
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't be here.
docs/contributing.rst
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't be here.
@@ -13,7 +13,7 @@ <h1>{{ context }} project</h1> | |||
<form method="POST" action="{{ url_for('anitya_ui.new_project') }}" > | |||
{%- elif context == 'Edit' -%} | |||
<form method="POST" action="{{ url_for('anitya_ui.edit_project', project_id=project.id) }}" > | |||
{%- endif %} | |||
{%- endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change indentation of existing files. It will report changes in lines that don't have any changes.
anitya/ui.py
Outdated
@@ -567,6 +566,44 @@ def new_project(): | |||
400, | |||
) | |||
|
|||
from flask import Flask, request, jsonify | |||
@ui_blueprint.route('/get_default_values_for_backend', methods=['GET']) | |||
def get_default_values_for_backend(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't what I wanted in this feature.
It should be a new API endpoint, which will scan the project on the server and fills in the values obtained from the backend.
Like for example, user adds URL https://pypi.org/project/<name>
and you fill the new_project page with all the data obtained by the API call.
To see what I have in mind, look at the https://www.protondb.com/contribute and how they can find the game based on the AppID, URL etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be a sample url
https://release-monitoring.org/project/250162/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've read through the docs and I was looking for the API endpoint that could query through the projects and return their data maybe as JSON, but happens not to be there.
Any idea please?
@Zlopez i am Querying now and getting some data from the API, but is multiple. |
@Zlopez this is the data I am retrieving now, the last object |
Now is such that, the homepage is entered by user as a url and then that is sent to the backend to get the project with that url then fields are autofilled with the data received
Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci ✔️ fi-tox-mypy SUCCESS in 5m 35s |
Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci ✔️ fi-tox-mypy SUCCESS in 7m 27s |
Looking at the PR, I think that you didn't understood what I want or how complex this feature is. Let me try to explain the workflow and the changes needed for that. WORKFLOW:
Changes needed:
As you can see there is no need for new |
Now I can see that what I described is actually different feature than the one that is in #1421. My bad in this case. But it's still not what you implemented. The new button on For example, if user provides The defaults need to be added to each backend. For inspiration how to handle it, you should look at |
Okay on it |
Closing due to inactivity. |
This PR enhances the project creation and editing functionality by introducing dynamic default values based on the selected backend. With this enhancement, users can now enjoy a more streamlined experience when creating or editing projects, as the form fields are automatically filled with relevant default values tailored to the chosen backend.
Key Changes:
Added a button to fill details in project creation page
Implemented a Flask route '/get_default_values_for_backend' to dynamically generate default values for project creation/editing.
Extended the Python backend logic to calculate and return default values such as project name, homepage URL, version URL, version scheme, version pattern, version prefix, pre-release filter, and version filter.
Integrated JavaScript functionality to handle AJAX requests and populate form fields with default values fetched from the server based on the selected backend.
This enhancement improves usability and efficiency, contributing to a more user-friendly experience for contributors and project maintainers alike.
This is to solve issue #1421