You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2021/03/17 19:44:57 UTC

[GitHub] [fineract-cn-mobile] EGOR-IND opened a new pull request #156: add dialog for group member and leader updation

EGOR-IND opened a new pull request #156:
URL: https://github.com/apache/fineract-cn-mobile/pull/156


   Fixes [FINCN-283](https://issues.apache.org/jira/browse/FINCN-283)
   
   https://user-images.githubusercontent.com/56648862/111528309-00e0cf80-8787-11eb-9432-6b5333ff888e.mp4
   
   Added dialog box for updation of member and leader of group.
   
   Please make sure these boxes are checked before submitting your pull request - thanks!
   
   - [x] Apply the `AndroidStyle.xml` style template to your code in Android Studio.
   
   - [x] Run the unit tests with `./gradlew check` to make sure you didn't break anything.
   
   - [x] If you have multiple commits please combine them into one commit by squashing them.
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract-cn-mobile] PatelVatsalB21 commented on a change in pull request #156: add dialog for group member and leader updation

Posted by GitBox <gi...@apache.org>.
PatelVatsalB21 commented on a change in pull request #156:
URL: https://github.com/apache/fineract-cn-mobile/pull/156#discussion_r596552161



##########
File path: app/src/main/java/org/apache/fineract/ui/online/groups/creategroup/AddGroupMemberStepFragment.kt
##########
@@ -108,17 +108,36 @@ class AddGroupMemberStepFragment : FineractBaseFragment(), Step, NameListAdapter
                         .addErrorCallback { etNewMember.error = it }.check()) {
             if (currentAction == GroupAction.CREATE) {
                 members.add(etNewMember.text.toString())
+                hideAddMemberView()
             } else {
-                members[editItemPosition] = etNewMember.text.toString()
+                if (members[editItemPosition] != etNewMember.text.toString()) {
+                    MaterialDialog.Builder().init(context).apply {
+                        setTitle(getString(R.string.dialog_title_confirm_updation))
+                        setMessage(getString(R.string.dialog_message_confirm_name_updation, members[editItemPosition]))
+                        setPositiveButton(getString(R.string.update)
+                        ) { dialog: DialogInterface?, _ ->
+                            members[editItemPosition] = etNewMember.text.toString()
+                            hideAddMemberView()
+                            dialog?.dismiss()
+                        }
+                        setNegativeButton(getString(R.string.dialog_action_cancel))
+                        createMaterialDialog()
+                    }.run { show() }

Review comment:
       @EGOR-IND it would be better if a function is made for dialog as it is used 2 times and **passing it necessary parameters to either hide or work with Member or Leader**. It would shorten the code and reduces the redundancy.
   ```suggestion
   
                    showUpdateConfirmDialog(Int type , other parameters if required)
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract-cn-mobile] PatelVatsalB21 commented on a change in pull request #156: add dialog for group member and leader updation

Posted by GitBox <gi...@apache.org>.
PatelVatsalB21 commented on a change in pull request #156:
URL: https://github.com/apache/fineract-cn-mobile/pull/156#discussion_r596970063



##########
File path: app/src/main/java/org/apache/fineract/ui/online/groups/creategroup/AddGroupMemberStepFragment.kt
##########
@@ -108,17 +108,36 @@ class AddGroupMemberStepFragment : FineractBaseFragment(), Step, NameListAdapter
                         .addErrorCallback { etNewMember.error = it }.check()) {
             if (currentAction == GroupAction.CREATE) {
                 members.add(etNewMember.text.toString())
+                hideAddMemberView()
             } else {
-                members[editItemPosition] = etNewMember.text.toString()
+                if (members[editItemPosition] != etNewMember.text.toString()) {
+                    MaterialDialog.Builder().init(context).apply {
+                        setTitle(getString(R.string.dialog_title_confirm_updation))
+                        setMessage(getString(R.string.dialog_message_confirm_name_updation, members[editItemPosition]))
+                        setPositiveButton(getString(R.string.update)
+                        ) { dialog: DialogInterface?, _ ->
+                            members[editItemPosition] = etNewMember.text.toString()
+                            hideAddMemberView()
+                            dialog?.dismiss()
+                        }
+                        setNegativeButton(getString(R.string.dialog_action_cancel))
+                        createMaterialDialog()
+                    }.run { show() }

Review comment:
       I wasn't there till now but yes i meant that. Looks perfect now. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract-cn-mobile] EGOR-IND commented on a change in pull request #156: add dialog for group member and leader updation

Posted by GitBox <gi...@apache.org>.
EGOR-IND commented on a change in pull request #156:
URL: https://github.com/apache/fineract-cn-mobile/pull/156#discussion_r596591389



##########
File path: app/src/main/java/org/apache/fineract/ui/online/groups/creategroup/AddGroupMemberStepFragment.kt
##########
@@ -108,17 +108,36 @@ class AddGroupMemberStepFragment : FineractBaseFragment(), Step, NameListAdapter
                         .addErrorCallback { etNewMember.error = it }.check()) {
             if (currentAction == GroupAction.CREATE) {
                 members.add(etNewMember.text.toString())
+                hideAddMemberView()
             } else {
-                members[editItemPosition] = etNewMember.text.toString()
+                if (members[editItemPosition] != etNewMember.text.toString()) {
+                    MaterialDialog.Builder().init(context).apply {
+                        setTitle(getString(R.string.dialog_title_confirm_updation))
+                        setMessage(getString(R.string.dialog_message_confirm_name_updation, members[editItemPosition]))
+                        setPositiveButton(getString(R.string.update)
+                        ) { dialog: DialogInterface?, _ ->
+                            members[editItemPosition] = etNewMember.text.toString()
+                            hideAddMemberView()
+                            dialog?.dismiss()
+                        }
+                        setNegativeButton(getString(R.string.dialog_action_cancel))
+                        createMaterialDialog()
+                    }.run { show() }

Review comment:
       Ooh okay i got what you saying, you mean to make a method accessible for both update and delete of group in a fragment. I'll push the changes soon. Thanks for the suggestion.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract-cn-mobile] EGOR-IND commented on a change in pull request #156: add dialog for group member and leader updation

Posted by GitBox <gi...@apache.org>.
EGOR-IND commented on a change in pull request #156:
URL: https://github.com/apache/fineract-cn-mobile/pull/156#discussion_r596591389



##########
File path: app/src/main/java/org/apache/fineract/ui/online/groups/creategroup/AddGroupMemberStepFragment.kt
##########
@@ -108,17 +108,36 @@ class AddGroupMemberStepFragment : FineractBaseFragment(), Step, NameListAdapter
                         .addErrorCallback { etNewMember.error = it }.check()) {
             if (currentAction == GroupAction.CREATE) {
                 members.add(etNewMember.text.toString())
+                hideAddMemberView()
             } else {
-                members[editItemPosition] = etNewMember.text.toString()
+                if (members[editItemPosition] != etNewMember.text.toString()) {
+                    MaterialDialog.Builder().init(context).apply {
+                        setTitle(getString(R.string.dialog_title_confirm_updation))
+                        setMessage(getString(R.string.dialog_message_confirm_name_updation, members[editItemPosition]))
+                        setPositiveButton(getString(R.string.update)
+                        ) { dialog: DialogInterface?, _ ->
+                            members[editItemPosition] = etNewMember.text.toString()
+                            hideAddMemberView()
+                            dialog?.dismiss()
+                        }
+                        setNegativeButton(getString(R.string.dialog_action_cancel))
+                        createMaterialDialog()
+                    }.run { show() }

Review comment:
       Ooh okay i got what you saying, you mean to make a method accessible for both update and delete in a fragment. I'll push the changes soon. Thanks for the suggestion.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract-cn-mobile] EGOR-IND commented on a change in pull request #156: add dialog for group member and leader updation

Posted by GitBox <gi...@apache.org>.
EGOR-IND commented on a change in pull request #156:
URL: https://github.com/apache/fineract-cn-mobile/pull/156#discussion_r596581265



##########
File path: app/src/main/java/org/apache/fineract/ui/online/groups/creategroup/AddGroupMemberStepFragment.kt
##########
@@ -108,17 +108,36 @@ class AddGroupMemberStepFragment : FineractBaseFragment(), Step, NameListAdapter
                         .addErrorCallback { etNewMember.error = it }.check()) {
             if (currentAction == GroupAction.CREATE) {
                 members.add(etNewMember.text.toString())
+                hideAddMemberView()
             } else {
-                members[editItemPosition] = etNewMember.text.toString()
+                if (members[editItemPosition] != etNewMember.text.toString()) {
+                    MaterialDialog.Builder().init(context).apply {
+                        setTitle(getString(R.string.dialog_title_confirm_updation))
+                        setMessage(getString(R.string.dialog_message_confirm_name_updation, members[editItemPosition]))
+                        setPositiveButton(getString(R.string.update)
+                        ) { dialog: DialogInterface?, _ ->
+                            members[editItemPosition] = etNewMember.text.toString()
+                            hideAddMemberView()
+                            dialog?.dismiss()
+                        }
+                        setNegativeButton(getString(R.string.dialog_action_cancel))
+                        createMaterialDialog()
+                    }.run { show() }

Review comment:
       Yeah it is getting used two times but in different fragments so for that I have to add this method in fineractbasefragment. Would it be a good idea to do that? 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org