-
Notifications
You must be signed in to change notification settings - Fork 2
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
Surface missingCommissionedLengthReason field #476
base: main
Are you sure you want to change the base?
Changes from 5 commits
f0bc65d
ee86bd6
06ada24
2283080
4dacd6a
cde31f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -332,20 +332,31 @@ export function wfContentListDrawer($rootScope, config, $timeout, $window, conte | |
}; | ||
|
||
$scope.updateCommissionedLength = function (newValue) { | ||
// Don't allow commissioned length to be unset | ||
if(newValue === "") return; | ||
if ($scope.contentItem.missingCommissionedLengthReason !== null && $scope.contentItem.missingCommissionedLengthReason !== undefined) { | ||
updateField("missingCommissionedLengthReason", null); | ||
wfComposerService.deleteField( | ||
$scope.contentItem.composerId, | ||
"missingCommissionedLengthReason" | ||
); | ||
} | ||
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. Unset the missingCommissionedLengthReason when a commissioned length is set. |
||
updateField("commissionedLength", newValue); | ||
if (newValue === "") { | ||
return wfComposerService.deleteField( | ||
wfComposerService.updateField( | ||
$scope.contentItem.composerId, | ||
"commissionedLength" | ||
); | ||
} | ||
return wfComposerService.updateField( | ||
$scope.contentItem.composerId, | ||
"commissionedLength", | ||
newValue | ||
"commissionedLength", | ||
newValue | ||
); | ||
}; | ||
|
||
$scope.formatReason = (missingCommissionedLengthReason) => { | ||
const reasons = { | ||
"BreakingNews": "Breaking News", | ||
} | ||
|
||
return reasons[missingCommissionedLengthReason] || missingCommissionedLengthReason; | ||
} | ||
|
||
/** | ||
* Revert deadline to previous state | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -311,6 +311,17 @@ const columnDefaults = [{ | |
isNew: true, | ||
isSortable: true, | ||
sortField: ['statusInPrint'] | ||
},{ | ||
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. Re-ordered so the commissionedLength can be next to the webWordCount (and so more easily comparable). But keeping webWordCount and printWordCount next to each other. This is the inverse order of the Ophan screen (wordCount / commissionedLength), but hard to balance all the needs. |
||
name: 'commissionedLength', | ||
prettyName: 'Commissioned Length', | ||
labelHTML: 'Commissioned Length', | ||
colspan: 1, | ||
title: '', | ||
templateUrl: templateRoot + 'commissionedLength.html', | ||
template: commissionedLengthTemplate, | ||
active: true, | ||
isSortable: true, | ||
sortField: ['missingCommissionedLengthReason', 'commissionedLength'] | ||
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. If you now order the Commissioned Length field by ascending, you should see missingCommissionedLengthReason first. And then very low Commissioned Length values. So will be easier to see mis-use of Commissioned Length. Would be nice if we could order by descending to see very high Commissioned Length values, but this just shows empty values as highest. Perhaps some refactoring of the sort would help? (Should blank values be included or not in sort is the bigger question). |
||
},{ | ||
name: 'wordcount', | ||
prettyName: 'Web wordcount', | ||
|
@@ -347,16 +358,6 @@ const columnDefaults = [{ | |
isSortable: true, | ||
defaultSortOrder: ['asc', 'desc', 'asc'], | ||
sortField: ['printLocationBookSection', 'printLocationPublicationDate', 'printLocationPageNumber'] | ||
},{ | ||
name: 'commissionedLength', | ||
prettyName: 'Commissioned Length', | ||
labelHTML: 'Commission', | ||
colspan: 1, | ||
title: '', | ||
templateUrl: templateRoot + 'commissionedLength.html', | ||
template: commissionedLengthTemplate, | ||
active: true, | ||
isSortable: true | ||
},{ | ||
name: 'links', | ||
prettyName: 'Open in...', | ||
|
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.
Happy for others to disagree with this choice. But there doesn't seem to be much benefit in allowing people to remove a commissioned length from a piece that has one set.
Theoretically it would allow users to correct a mistake, but in practice since we expect all (or almost all) pieces to have a commissioned length, it seems more likely that someone might mis-use this feature, i.e. by setting an arbitrary commissioned length on the Workflow form and then removing it to get round the mandate.