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

OHRM5X-2484: Develop I18NLanguage delete API #1812

Merged
merged 7 commits into from
Feb 29, 2024

Conversation

TharakaAthukorala
Copy link

Develop I18NLanguage delete API without unit testing & db migrations for the admin user role, and data group permissions.

@TharakaAthukorala TharakaAthukorala marked this pull request as ready for review February 16, 2024 10:08
Copy link
Contributor

@devishke-orange devishke-orange left a comment

Choose a reason for hiding this comment

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

Great job! 🤩 Now you need to add the tests and make changes to the data groups.

Testing References:

Data group update needs to be done in ohrm_data_group and ohrm_user_role_data_group

src/plugins/orangehrmI18NPlugin/entity/I18NLanguage.php Outdated Show resolved Hide resolved
src/plugins/orangehrmAdminPlugin/Api/I18NLanguageAPI.php Outdated Show resolved Hide resolved
@devishke-orange
Copy link
Contributor

devishke-orange commented Feb 16, 2024

Also note that we put the ticket ID in the PR title. You can edit the title and add it

Example: #1144

@Super-Chama
Copy link
Member

Congrats on the first PR 🎊

@TharakaAthukorala
Copy link
Author

TharakaAthukorala commented Feb 16, 2024 via email

Copy link
Contributor

@devishke-orange devishke-orange left a comment

Choose a reason for hiding this comment

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

Nice job on the getOne endpoint. Make sure to run php-cs-fix before pushing.

php devTools/core/console php-cs-fix

Also we need to change the product version to 5.7.

installer/Migration/V5_7_0/Migration.php Outdated Show resolved Hide resolved
installer/Migration/V5_7_0/permission/api.yaml Outdated Show resolved Hide resolved
installer/Migration/V5_7_0/permission/data_group.yaml Outdated Show resolved Hide resolved
src/plugins/orangehrmAdminPlugin/Api/I18NLanguageAPI.php Outdated Show resolved Hide resolved
src/plugins/orangehrmAdminPlugin/Api/I18NLanguageAPI.php Outdated Show resolved Hide resolved
Comment on lines 52 to 60
'with deleted language id':
userId: 1
services:
admin.localization_service: OrangeHRM\Admin\Service\LocalizationService
attributes:
id: 7
exception:
class: \OrangeHRM\Core\Api\V2\Exception\RecordNotFoundException
message: 'Record Not Found'
Copy link
Contributor

Choose a reason for hiding this comment

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

this test is the same as the previous since only 5 language records are loaded into test DB from the fixtures

we need to add a new parameter to getOne endpoint like getAll's activeOnly
https://github.com/orangehrm/orangehrm/blob/main/src/plugins/orangehrmAdminPlugin/Api/I18NLanguageAPI.php#L52-L57

Comment on lines +33 to +34
public const REMOVED = 0;
public const ADDED = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

nice. can we refactor any other places that uses these values

@@ -0,0 +1,44 @@
<?php
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong header

Copy link
Member

Choose a reason for hiding this comment

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

@devishke-orange any possibility to check the copyright header in lint workflow. I think there should be a way. https://cs.symfony.com/doc/rules/comment/header_comment.html

@TharakaAthukorala TharakaAthukorala changed the title Develop I18NLanguage delete API OHRM5X-2484: Develop I18NLanguage delete API Feb 19, 2024
Copy link
Contributor

@devishke-orange devishke-orange left a comment

Choose a reason for hiding this comment

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

You need to implement the activeOnly parameter.

Also since you updated the PRODUCT_VERSION you will have to change the AboutOrganizationTestCase.yaml

Copy link
Contributor

@devishke-orange devishke-orange left a comment

Choose a reason for hiding this comment

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

forgot to put the = sign in the where clause. this should fix the buzz test failure.

installer/Migration/V5_7_0/Migration.php Outdated Show resolved Hide resolved
installer/Migration/V5_7_0/Migration.php Outdated Show resolved Hide resolved
Copy link
Contributor

@devishke-orange devishke-orange left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@RajithaKumara please review if you have time

@TharakaAthukorala before merging let's rebase

installer/Migration/V5_7_0/permission/api.yaml Outdated Show resolved Hide resolved
installer/Migration/V5_7_0/permission/api.yaml Outdated Show resolved Hide resolved
@@ -0,0 +1,44 @@
<?php
/**
Copy link
Member

Choose a reason for hiding this comment

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

@devishke-orange any possibility to check the copyright header in lint workflow. I think there should be a way. https://cs.symfony.com/doc/rules/comment/header_comment.html

@devishke-orange devishke-orange merged commit bb71405 into orangehrm:5.7 Feb 29, 2024
6 checks passed
devishke-orange pushed a commit to devishke-orange/orangehrm that referenced this pull request Mar 6, 2024
devishke-orange pushed a commit to devishke-orange/orangehrm that referenced this pull request Mar 28, 2024
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

4 participants