Skip to content
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

[CMS-307] #295

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

[CMS-307] #295

wants to merge 6 commits into from

Conversation

hdphuong
Copy link
Contributor

  • test for UploadDocument - lots of "inspiration" from test for UploadImage
  • move EditType into Operations

@hdphuong hdphuong requested a review from Varun-Sethu as a code owner October 18, 2022 19:46
Copy link
Member

@Varun-Sethu Varun-Sethu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Go part of it looks good but theres also some TS code that needs to be updated too: https://github.com/csesoc/website/blob/main/backend/editor/OT/OTClient/operation.ts

backend/endpoints/tests/volume_test.go Show resolved Hide resolved
@hdphuong hdphuong requested a review from Varun-Sethu February 26, 2023 23:25
Copy link
Member

@Varun-Sethu Varun-Sethu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to comments + also I feel like this PR introduces a discontinuity between how TS will parse incoming operation payloads and how Go will.

Your types for TS seem to suggest that opType is of type "insert" | "delete" while for Go it is simply an integer, its been a while since I've looked at this so I may be wrong

transformAgainst = (op: AtomicOperation): AtomicOperation[] => [this, op];
}

export class BooleanOperation implements AtomicOperation {
type = "booleanOperation";
newValue: boolean;
constructor(newValue: boolean) {
opType: "insert" | "delete";
constructor(newValue: boolean, opType: "insert" | "delete") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of unneeded duplication here, abstract this out into its own type:

type OperationType = "insert" | "delete";

export class BooleanOperation implements AtomicOperation {
  type = "booleanOperation";
  newValue: boolean;
  constructor(newValue: boolean) {
  opType: OperationType;
  constructor(newValue: boolean, opType: OperationType) {
       // ....
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait i thought that's what i'm supposed to do according to this jira ticket?

backend/editor/OT/OTClient/package-lock.json Outdated Show resolved Hide resolved
@hdphuong hdphuong requested a review from Varun-Sethu February 27, 2023 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants