-
Notifications
You must be signed in to change notification settings - Fork 39
Set project start date to now and add field in create project form to set the end date #4495
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d7a897f
Set project start date to now and add field in create project form to…
frjo e353bb8
Add migration.
frjo 348df29
Make it possible to edit the project dates.
frjo 00d7267
Use end_date in project table.
frjo e8be5f8
Update tests.
frjo 877feb9
Update tests, part 2.
frjo 7ea47ab
Fix test failing.
frjo c3e07e1
Add edit icon on start date as well. Make all date fields the same ma…
frjo 8b82da1
Removed `start_date` in favor of using `proposed_start`, fixed reports
wes-otf 424039e
Added date call to project factory
wes-otf a10bffd
Lint fixes.
frjo a4a009e
Small bug fix, added form validation, made start date info field more…
wes-otf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
hypha/apply/projects/migrations/0100_alter_project_proposed_end_and_more.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Generated by Django 4.2.20 on 2025-04-10 17:27 | ||
|
|
||
| import datetime | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| def migration_set_project_start_date(apps, schema_editor): | ||
| Project = apps.get_model("application_projects", "Project") | ||
| for project in Project.objects.all(): | ||
| if not project.proposed_start: | ||
| project.proposed_start = project.created_at | ||
| project.save(update_fields=["proposed_start"]) | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("application_projects", "0099_remove_reportconfig_project_and_more"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RunPython(migration_set_project_start_date), | ||
| migrations.AlterField( | ||
| model_name="project", | ||
| name="proposed_end", | ||
| field=models.DateField(null=True, verbose_name="Proposed end date"), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="project", | ||
| name="proposed_start", | ||
| field=models.DateField( | ||
| default=datetime.date.today, | ||
| null=True, | ||
| verbose_name="Proposed start date", | ||
| ), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
hypha/apply/projects/templates/application_projects/modals/project_dates_update.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| {% load i18n %} | ||
| {% modal_title %}{% trans "Update project dates" %}{% endmodal_title %} | ||
|
|
||
| <div class="p-4"> | ||
| {% include 'includes/dialog_form_base.html' with form=form value=value %} | ||
| </div> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not an important detail at all but the date pickers are different widths - not sure if this can be fixed here because of the include template though
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 custom css to change the width of the last date field, been there for years.
Removed it and we will see if it mess something up, likely not.