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

Feature/sc 124023/disable enable refactor #708

Merged

Conversation

hugomontero
Copy link
Contributor

@hugomontero hugomontero commented Jan 4, 2024

Description

This PR will change updateStatus command in order to use LogicFunction Class

How to Test

  1. Pull down the branch: git pull && git checkout feature/sc-124023/disable-enable-refactor
  2. Install dependencies: npm i
  3. Run tests: npm run test:ci && npm run test:e2e -- --grep "Logic Function Commands"
  4. Attempt to enable/disable a logic function:
    • Enable by name: `npm start -- lf enable --name ""
    • Enable by id: `npm start -- lf enable --id ""
    • Enable by using path: `npm start -- lf enable --name " /local/path/for/my/logic/function"
    • Enable by wrong name: `npm start -- lf enable --name ""
    • Disable by name: `npm start -- lf disable --name ""
    • Disable by id: `npm start -- lf disable --id ""
    • Disable by using path: `npm start -- lf disable --name " /local/path/for/my/logic/function"
    • Disable by wrong name: `npm start -- lf disable --name ""

Outcome

  • Test should pass
  • Enabling logic function will update the cloud logic function
  • Enabling logic function having an existent local logic function it will prompt to update
  • Enabling logic function with wrong name/id it will throw an error indicating Logic function not found
  • Disabling logic function will update the cloud logic function
  • Disabling logic function having an existent local logic function it will prompt to update
  • Disabling logic function with wrong name/id it will throw an error indicating Logic function not found

Related Issues / Discussions

Story details: https://app.shortcut.com/particle/story/124023

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA
  • Problem and solution clearly stated
  • Tests have been provided
  • Docs have been updated
  • CI is passing

@hugomontero hugomontero changed the base branch from master to feature/logic-function January 4, 2024 15:39
@hugomontero hugomontero force-pushed the feature/sc-124023/disable-enable-refactor branch from 20b4e26 to dd370a7 Compare January 4, 2024 16:02
@hugomontero hugomontero force-pushed the feature/sc-124023/disable-enable-refactor branch from dd370a7 to 88a6b4c Compare January 4, 2024 16:42
@hugomontero hugomontero marked this pull request as ready for review January 4, 2024 17:31
Copy link
Contributor

@keeramis keeramis left a comment

Choose a reason for hiding this comment

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

LGTM

this.files.sourceCode.content = logicFunction.files.sourceCode.content;
this.files.configuration.content = logicFunction.files.configuration.content;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

what is the copyFromOtherLogicFunction for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is used to "sync" a logicFunction from another one. Specifically is used to copy values from "cloud" to "local" but is more generic than that.

@hugomontero hugomontero merged commit b4e5190 into feature/logic-function Jan 5, 2024
6 checks passed
@hugomontero hugomontero deleted the feature/sc-124023/disable-enable-refactor branch January 5, 2024 14:26
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.

None yet

2 participants