Skip to content

Commit

Permalink
Merge pull request #120 from wri/feat/submit-for-qc-first-step
Browse files Browse the repository at this point in the history
Ability to submit for QC immediately instead of needing to create an observation
  • Loading branch information
tsubik authored Dec 20, 2023
2 parents f1151f9 + df11d6d commit 70fb4c6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app/pages/observations/observation-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1402,11 +1402,13 @@ export class ObservationDetailComponent implements OnDestroy {
}

canSubmitForReview(): boolean {
if (!this.observation) return false;
if (this.observation.hidden) return false;

const isCreating = !this.observation;
const isDuplicating = this.isCopied;

if (isCreating) return true;
if (isDuplicating) return true;
if (this.observation.hidden) return false;

const isAdmin = this.authService.isAdmin();
const isOwner = this.observation.user && this.observation.user.id === this.authService.userId;
const isUserLinkedObserver = !!this.observation.observers.find(o => o.id === this.authService.userObserverId);
Expand All @@ -1417,8 +1419,6 @@ export class ObservationDetailComponent implements OnDestroy {
const isPublishedWithCommentsAndNotModified = this.observation['validation-status'] === 'Published (not modified)';
const isPublishedWithoutComments = this.observation['validation-status'] === 'Published (no comments)';

if (isCreating) return true;
if (isDuplicating) return true;
if (isCreated && isAdmin && isUserLinkedObserver) return true;
if (isCreated && isOwner) return true;
if (isInNeedOfRevision && isAmending) return true
Expand Down

0 comments on commit 70fb4c6

Please sign in to comment.