Repository navigation
Closed
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
Description
Problem
We introduced the Change Workspace feature but there are inconsistencies in when we should show it.
Solution
Align the logic to display this option is not aligned with what we have in OldDot here and here
Note: the logic for submitsToExternalService, isBill and isPaycheck is not migrated since those are not supported in NewDot yet.
Report.prototype.isEditable = function () {
var reportPolicy = this.getPolicy();
var isPolicyAdmin = this.isAdmin(User.getEmail());
var isReportManager = this.isManager(User.getAccountID());
var isSubmitter = this.isOwner(User.getAccountID());
var isAuditor = this.isAuditor(User.getEmail());
// Invoice and paychecks are only editable when open.
if (this.isInvoice() || this.isPaycheck()) {
// Auditors should not be able to edit open invoices or paychecks,
// just like how they can't edit open expense reports.
if (isAuditor) {
return false;
}
return this.isOpen();
}
if (reportPolicy && reportPolicy.submitsToExternalService()) {
// For external submit, allow editing for POLICY ADMINS always, otherwise when it's open
if (isPolicyAdmin || (!this.isOpen() && isReportManager)) {
return true;
}
return this.isOpen();
}
if (this.isExpenseReport() || this.isBill()) {
// If it's open and I'm the submitter or an admin.
if (this.isOpen()) {
return isSubmitter || isPolicyAdmin;
}
if (this.isSubmitted()) {
return (isSubmitter && this.isAwaitingFirstLevelApproval()) || isReportManager || isPolicyAdmin;
}
// If it's neither open or submitter and I am a manager or an admin
return isReportManager || isPolicyAdmin;
}
return false;
};
hasAnotherPolicyForReport = policies.length > 1;
if (!hasAnotherPolicyForReport && policies.length === 1) {
hasAnotherPolicyForReport = !report.getPolicy() || report.getPolicy().getID() !== policies[0].getID();
}
canChangePolicy = report.isEditable() && hasAnotherPolicyForReport;
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021929530844102252751
- Upwork Job ID: 1929530844102252751
- Last Price Increase: 2025-06-09
Issue Owner
Current Issue Owner: @Metadata
Metadata
Assignees
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
Activity
[-]Align `Change workspace` condition with what we have in OldDot[/-][+][Due for payment 2025-06-02] Align `Change workspace` condition with what we have in OldDot[/+]melvin-bot commentedon May 26, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon May 26, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.51-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-06-02. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 2, 2025
Issue is ready for payment but no BZ is assigned. @muttmuure you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!
3 remaining items
melvin-bot commentedon Jun 2, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021929530844102252751
melvin-bot commentedon Jun 2, 2025
Current assignee @suneox is eligible for the External assigner, not assigning anyone new.
muttmuure commentedon Jun 2, 2025
Waiting for @suneox to apply for the Upwork job
muttmuure commentedon Jun 2, 2025
@suneox - $250 C+
suneox commentedon Jun 2, 2025
@muttmuure I've applied this job. Thank you!
melvin-bot commentedon Jun 6, 2025
@suneox, @luacmartins, @muttmuure Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Jun 9, 2025
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
muttmuure commentedon Jun 9, 2025
Offer sent
suneox commentedon Jun 10, 2025
@muttmuure Thank you! I've accepted the offer
muttmuure commentedon Jun 10, 2025
Paid
cretadn22 commentedon May 24, 2026
This behavior is now considered incorrect and was removed in #88530