Conversation
zlavergne
left a comment
There was a problem hiding this comment.
I've got a number of things that need to be addressed in the inline comments. Additionally, there's a couple other things:
- Let's also implement this for validation. If someone locks something for validation, we want to prevent the surrounding tasks from being locked. This shouldn't be much of a change, just using the
adjacent_task_lock/unlockfunctions when we lock for validation too - Make sure to remove any unnecessary comments or console logs.
| required=False, default=False, serialized_name="enforceRandomTaskSelection" | ||
| ) | ||
|
|
||
| adjacent_task_lock = BooleanType(required=True, default=False, serialized_name='adjacentTaskLock') |
There was a problem hiding this comment.
| adjacent_task_lock = BooleanType(required=True, default=False, serialized_name='adjacentTaskLock') | |
| prevent_adjacent_task_lock = BooleanType(required=True, default=False, serialized_name='preventAdjacentTaskLock') |
Similarly to how the name "Adjacent Task Lock" is confusing, let's call it "Prevent Adjacent Task Lock" throughout the project.
| enforce_random_task_selection = db.Column( | ||
| db.Boolean, default=False | ||
| ) # Force users to edit at random to avoid mapping "easy" tasks | ||
| adjacent_task_lock = db.Column(db.Boolean, default=False) # Turn on adjacent lock |
There was a problem hiding this comment.
| adjacent_task_lock = db.Column(db.Boolean, default=False) # Turn on adjacent lock | |
| prevent_adjacent_task_lock = db.Column(db.Boolean, default=False) # Turn on adjacent lock |
Same
| self.priority = ProjectPriority[project_dto.project_priority].value | ||
| self.default_locale = project_dto.default_locale | ||
| self.enforce_random_task_selection = project_dto.enforce_random_task_selection | ||
| self.adjacent_task_lock = project_dto.adjacent_task_lock |
There was a problem hiding this comment.
| self.adjacent_task_lock = project_dto.adjacent_task_lock | |
| self.prevent_adjacent_task_lock = project_dto.prevent_adjacent_task_lock |
Same
| self.validation_permission | ||
| ).name | ||
| base_dto.enforce_random_task_selection = self.enforce_random_task_selection | ||
| base_dto.adjacent_task_lock = self.adjacent_task_lock |
There was a problem hiding this comment.
| base_dto.adjacent_task_lock = self.adjacent_task_lock | |
| base_dto.prevent_adjacent_task_lock = self.prevent_adjacent_task_lock |
|
|
||
| def get_project_adj_toggle(project_id: int): | ||
| """ get the value of adjacent task lock true/false for project""" | ||
| query = db.session.query(Project.adjacent_task_lock).filter(Project.id==project_id).all() |
There was a problem hiding this comment.
| query = db.session.query(Project.adjacent_task_lock).filter(Project.id==project_id).all() | |
| query = db.session.query(Project.prevent_adjacent_task_lock).filter(Project.id==project_id).all() |
Same
| { | ||
| label: getLabel('ADJACENT_LOCK'), | ||
| field: 'adjacentLock', | ||
| backgroundColor: TASK_COLOURS.ADJACENT_LOCK, | ||
| borderColor: '#929db3', | ||
| }, | ||
| { | ||
| label: getLabel('ADJACENTLOCK'), | ||
| field: 'adjacentLock', | ||
| backgroundColor: TASK_COLOURS.ADJACENTLOCK, | ||
| borderColor: '#929db3', | ||
| }, |
There was a problem hiding this comment.
Why are there two here? It looks like we only use both in different parts of the code. Let's try to remove one of them and unify the rest of the code usage.
| if (map.getSource('tasks') === undefined) { | ||
| map.addImage('lock', lockIcon, { width: 17, height: 20, data: lockIcon }); | ||
| map.addImage('redlock', redlockIcon, { width: 30, height: 30, data: redlockIcon }); | ||
| // map.addImage('adjacentLock', adjLockIcon, { width: 130, height: 130, data: adjLockIcon }); |
There was a problem hiding this comment.
please remove if not necessary
| console.log('adjacent lock is', adjacentlocked); | ||
| console.log(' lock is', locked); |
There was a problem hiding this comment.
please remove if not necessary
| console.log('adjacent lock is', adjacentlocked); | ||
| console.log(' lock is', locked); | ||
| let taskStatusCondition = ['case']; | ||
| console.log('task status ', taskStatusCondition); |
| export const OSM_SERVER_URL = | ||
| process.env.REACT_APP_OSM_SERVER_URL || 'https://www.openstreetmap.org'; | ||
| export const ID_EDITOR_URL = | ||
| process.env.REACT_APP_ID_EDITOR_URL || 'https://www.openstreetmap.org/edit?editor=id&'; | ||
| export const POTLATCH2_EDITOR_URL = | ||
| process.env.REACT_APP_POTLATCH2_EDITOR_URL || | ||
| 'https://www.openstreetmap.org/edit?editor=potlatch2'; |
There was a problem hiding this comment.
If these are just formatting changes, let's remove them so we avoid conflicts
Adjacent lock