Skip to content

Conversation

@Rohithgvmg
Copy link
Contributor

Fixes #172

if @type is an array, only the tm:ThingModel is removed
if string , it is deleted from JSON

Signed-off-by: Rohith <rgvmanikanta05@gmail.com>
@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for editdor ready!

Name Link
🔨 Latest commit 20f8403
🔍 Latest deploy log https://app.netlify.com/projects/editdor/deploys/694d65f50ddf470008f2e771
😎 Deploy Preview https://deploy-preview-173--editdor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@egekorkan egekorkan requested a review from TejInaco December 19, 2025 17:02
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @Rohithgvmg for this PR. You need to run the prettier --write src/services/operations.ts in order to the code being formatted according to the prettier rules.
Another thing is the unit tests also need to be changed in operations.test.ts file. You can see them failing when you run yarn test
The comment on line 144 is unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for detailed review, fixed the code , kindly review

@Rohithgvmg Rohithgvmg force-pushed the fix/conversion_tm_to_td branch from 3bdbd8d to 1954647 Compare December 22, 2025 17:34
@egekorkan
Copy link
Contributor

@Rohithgvmg the tests are failing again. Make sure to test locally :)

@egekorkan
Copy link
Contributor

@Rohithgvmg while the correction to the test is ok (that is the expected behavior), you are not checking for the case with the @type being an array. Could you add another test to cover the if condition in line 138 succeeding?

@Rohithgvmg
Copy link
Contributor Author

if @type exists, it must be an array
if @type is array, checks if "tm:ThingModel" is removed or not

@egekorkan
Copy link
Contributor

@Rohithgvmg the check you have added is correct however that will never happen since your test input does not contain an @type array. You need to add another test input where @type is an array.

Sorry for being thorough but this bug you are fixing has caused my demo to fail last time

@Rohithgvmg
Copy link
Contributor Author

Thanks for the feedback, I could have been more careful in writing tests
added both string type and array type test inputs and all test cases passed

Copy link
Contributor

@egekorkan egekorkan left a comment

Choose a reason for hiding this comment

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

Thank you @Rohithgvmg for taking the feedback into account and addressing an issue that's quite important! That's what open source is about 🙃

@egekorkan egekorkan merged commit 7adf418 into eclipse:master Dec 25, 2025
7 checks passed
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.

Fix process Conversion TM to TD

3 participants