Skip to content

Commit

Permalink
csr: split status to enum file
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlodAlejandro committed May 28, 2024
1 parent df8b53e commit e2bed58
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/DeputyCommunications.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'broadcastchannel-polyfill';
import { ContributionSurveyRowStatus } from './models/ContributionSurveyRow';
import generateId from './util/generateId';
import { WikiPageConfiguration } from './config/WikiConfiguration';
import log from './util/log';
import { ContributionSurveyRowStatus } from './models/ContributionSurveyRowStatus';

/**
* Generic message used to acknowledge an action. This is usually required by
Expand Down
2 changes: 1 addition & 1 deletion src/DeputyStorage.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { openDB, DBSchema, IDBPDatabase } from 'idb';
import { ExpandedRevisionData } from './api/ExpandedRevisionData';
import { ContributionSurveyRowStatus } from './models/ContributionSurveyRow';
import MwApi from './MwApi';
import log from './util/log';
import { ContributionSurveyRowStatus } from './models/ContributionSurveyRowStatus';

/**
* General key-value store. Used for storing single-variable data
Expand Down
16 changes: 1 addition & 15 deletions src/models/ContributionSurveyRow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,7 @@ import ContributionSurveyRowParser, {
} from './ContributionSurveyRowParser';
import { ContributionSurveyRowSort } from './ContributionSurveyRowSort';
import DispatchRevisions from '../api/DispatchRevisions';

export enum ContributionSurveyRowStatus {
// The row has not been processed yet.
Unfinished = 0,
// The row has a comment but cannot be parsed
Unknown = 1,
// The row has been processed and violations were found ({{y}})
WithViolations = 2,
// The row has been processed and violations were not found ({{n}})
WithoutViolations = 3,
// The row has been found but the added text is no longer in the existing revision
Missing = 4,
// The row has been processed and text was presumptively removed ({{x}}),
PresumptiveRemoval = 5
}
import { ContributionSurveyRowStatus } from './ContributionSurveyRowStatus';

/**
* Represents a contribution survey row. This is an abstraction of the row that can
Expand Down
14 changes: 14 additions & 0 deletions src/models/ContributionSurveyRowStatus.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export enum ContributionSurveyRowStatus {
// The row has not been processed yet.
Unfinished = 0,
// The row has a comment but cannot be parsed
Unknown = 1,
// The row has been processed and violations were found ({{y}})
WithViolations = 2,
// The row has been processed and violations were not found ({{n}})
WithoutViolations = 3,
// The row has been found but the added text is no longer in the existing revision
Missing = 4,
// The row has been processed and text was presumptively removed ({{x}}),
PresumptiveRemoval = 5
}
5 changes: 2 additions & 3 deletions src/ui/root/DeputyContributionSurveyRow.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { ComponentChild, h } from 'tsx-dom';
import DeputyContributionSurveySection from './DeputyContributionSurveySection';
import { DeputyUIElement } from '../DeputyUIElement';
import ContributionSurveyRow, {
ContributionSurveyRowStatus
} from '../../models/ContributionSurveyRow';
import ContributionSurveyRow from '../../models/ContributionSurveyRow';
import swapElements from '../../util/swapElements';
import unwrapWidget from '../../util/unwrapWidget';
import DeputyLoadingDots from './DeputyLoadingDots';
Expand All @@ -22,6 +20,7 @@ import { ContributionSurveyRowSort } from '../../models/ContributionSurveyRowSor
import last from '../../util/last';
import warn from '../../util/warn';
import error from '../../util/error';
import { ContributionSurveyRowStatus } from '../../models/ContributionSurveyRowStatus';
import dangerModeConfirm from '../../util/dangerModeConfirm';

export enum DeputyContributionSurveyRowState {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/shared/DeputyCCIStatusDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import '../../types';
import { ContributionSurveyRowStatus } from '../../models/ContributionSurveyRow';
import unwrapWidget from '../../util/unwrapWidget';
import { DeputyMessageEvent, DeputyPageStatusUpdateMessage } from '../../DeputyCommunications';
import DeputyCase from '../../wiki/DeputyCase';
import { ContributionSurveyRowStatus } from '../../models/ContributionSurveyRowStatus';

export interface DeputyCCIStatusDropdownProps {
/**
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/browser/ContributionSurveyRowUnitTests.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '../../../src/types';
import 'types-mediawiki';
import { ContributionSurveyRowStatus } from '../../../src/models/ContributionSurveyRow';
import BrowserHelper from '../../util/BrowserHelper';
import { ContributionSurveyRowStatus } from '../../../src/models/ContributionSurveyRowStatus';

describe( 'ContributionSurveyRow static unit tests', () => {

Expand Down

0 comments on commit e2bed58

Please sign in to comment.