-
Notifications
You must be signed in to change notification settings - Fork 5
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
Introduce Final Output and Auto Lock Tasks Fields to Improve Task Management #125
Merged
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
cd133d3
feat: Add automatic task lock option for project creators & drone ope…
Pradip-p 64aa17f
fix: remove unused import
Pradip-p ba72e24
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 5a68f4c
feat: change auto lock message and add TODO for function refactor
Pradip-p 37a7996
fix: slove merge conflict with task_routes
Pradip-p a412fbf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 170753e
feat: Update field to use type
Pradip-p 454ac30
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 94e3e3a
fix: update finalout type as FinalOutput
Pradip-p da1266f
fix: merge conflict with migrations file 488158d3d5a8
Pradip-p dd16dfb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] cc6585d
fix: changes auto_lock_task to requires_approval_from_manager_for_loc…
Pradip-p 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 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 |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
from sqlalchemy.dialects.postgresql import UUID | ||
from geoalchemy2 import Geometry, WKBElement | ||
from app.models.enums import ( | ||
FinalOutput, | ||
TaskStatus, | ||
TaskSplitType, | ||
ProjectStatus, | ||
|
@@ -129,7 +130,10 @@ class DbProject(Base): | |
), | ||
) | ||
author = relationship(DbUser, uselist=False, backref="user") | ||
|
||
final_output = cast( | ||
FinalOutput, Column(Enum(FinalOutput), default=FinalOutput.ORTHOPHOTO_2D) | ||
) | ||
auto_lock_tasks = cast(bool, Column(Boolean, default=False)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is better to rename this |
||
# PROJECT STATUS | ||
status = cast( | ||
ProjectStatus, | ||
|
This file contains 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,57 @@ | ||
""" | ||
|
||
Revision ID: b574d3a13e62 | ||
Revises: 87b6f9d734e8 | ||
Create Date: 2024-08-05 15:02:26.464109 | ||
|
||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "b574d3a13e62" | ||
down_revision: Union[str, None] = "87b6f9d734e8" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
final_output_enum = sa.Enum( | ||
"ORTHOPHOTO_2D", | ||
"ORTHOPHOTO_3D", | ||
"DIGITAL_TERRAIN_MODEL", | ||
"DIGITAL_SURFACE_MODEL", | ||
name="finaloutput", | ||
) | ||
|
||
|
||
def upgrade() -> None: | ||
final_output_enum.create(op.get_bind()) | ||
|
||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column( | ||
"projects", | ||
sa.Column( | ||
"final_output", | ||
sa.Enum( | ||
"ORTHOPHOTO_2D", | ||
"ORTHOPHOTO_3D", | ||
"DIGITAL_TERRAIN_MODEL", | ||
"DIGITAL_SURFACE_MODEL", | ||
name="finaloutput", | ||
), | ||
nullable=True, | ||
), | ||
) | ||
op.add_column("projects", sa.Column("auto_lock_tasks", sa.Boolean(), nullable=True)) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("projects", "auto_lock_tasks") | ||
op.drop_column("projects", "final_output") | ||
# ### end Alembic commands ### | ||
final_output_enum.drop(op.get_bind()) |
This file contains 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 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 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 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 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 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
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.
this is the multiselect option. We might need an array field ?
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 updated the schema & field to use an array field to better handle multiple selections.