WEB-713: Hide tenant dropdown when Fineract Platform Tenants is not defined#3138
Conversation
…ER is not defined Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Login Component src/app/login/login.component.html, src/app/login/login.component.ts |
Refactored tenant selector visibility logic by replacing method calls with a boolean property. Introduced enhanced visibility calculation that checks OAuth status, environment configuration, and parses tenant IDs with filtering. Method moved from public to private and renamed to calculateTenantSelectorVisibility(), with initialization added to ngOnInit(). |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~12 minutes
Suggested reviewers
- IOhacker
- gkbishnoi07
🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Merge Conflict Detection | ❌ Merge conflicts detected (36 files): ⚔️ src/app/clients/clients-view/client-actions/client-screen-reports/client-screen-reports.component.scss (content)⚔️ src/app/clients/clients-view/clients-view.component.ts (content)⚔️ src/app/clients/create-client/create-client.component.ts (content)⚔️ src/app/core/utils/datatables.ts (content)⚔️ src/app/login/login-form/login-form.component.scss (content)⚔️ src/app/login/login.component.html (content)⚔️ src/app/login/login.component.ts (content)⚔️ src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.ts (content)⚔️ src/app/organization/fund-mapping/fund-mapping.component.html (content)⚔️ src/app/organization/fund-mapping/fund-mapping.component.ts (content)⚔️ src/app/organization/loan-originators/edit-loan-originator/edit-loan-originator.component.ts (content)⚔️ src/app/organization/loan-originators/view-loan-originator/view-loan-originator.component.html (content)⚔️ src/app/organization/loan-provisioning-criteria/create-loan-provisioning-criteria/create-loan-provisioning-criteria.component.ts (content)⚔️ src/app/organization/loan-provisioning-criteria/edit-loan-provisioning-criteria/edit-loan-provisioning-criteria.component.ts (content)⚔️ src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/advanced-accounting-mapping-rule/advanced-accounting-mapping-rule.component.ts (content)⚔️ src/app/products/manage-delinquency-buckets/delinquency-range/create-range/create-range.component.ts (content)⚔️ src/app/profile/profile.component.scss (content)⚔️ src/app/shared/form-dialog/form-group.service.ts (content)⚔️ src/app/shared/form-dialog/formfield/formfield.component.html (content)⚔️ src/app/system/codes/view-code/view-code.component.html (content)⚔️ src/app/system/codes/view-code/view-code.component.ts (content)⚔️ src/app/system/manage-jobs/workflow-jobs/workflow-jobs.component.html (content)⚔️ src/app/tasks/checker-inbox-and-tasks-tabs/loan-disbursal/loan-disbursal.component.ts (content)⚔️ src/assets/translations/cs-CS.json (content)⚔️ src/assets/translations/de-DE.json (content)⚔️ src/assets/translations/en-US.json (content)⚔️ src/assets/translations/es-CL.json (content)⚔️ src/assets/translations/es-MX.json (content)⚔️ src/assets/translations/fr-FR.json (content)⚔️ src/assets/translations/it-IT.json (content)⚔️ src/assets/translations/ko-KO.json (content)⚔️ src/assets/translations/lt-LT.json (content)⚔️ src/assets/translations/lv-LV.json (content)⚔️ src/assets/translations/ne-NE.json (content)⚔️ src/assets/translations/pt-PT.json (content)⚔️ src/assets/translations/sw-SW.json (content)These conflicts must be resolved before merging into dev. |
Resolve conflicts locally and push changes to this branch. |
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title clearly and specifically describes the main change: hiding the tenant dropdown when environment tenant variables are not defined, which matches the core modifications in both the HTML template and TypeScript component. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- 📝 Generate docstrings
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
- Auto-commit resolved conflicts to branch
WEB-713/hide-tenant-dropdown-when-variable-undefined - Post resolved changes as copyable diffs in a comment
No actionable comments were generated in the recent review. 🎉
🧹 Recent nitpick comments
src/app/login/login.component.ts (1)
76-77: Consider initializingshowTenantSelectortofalseinstead oftrue.If for any reason
ngOnInitthrows before reaching line 120 (e.g., an earlier statement fails), the defaulttruewould show the selector even when it shouldn't. Defaulting tofalseis the safer fallback — hiding the selector is preferable to showing it incorrectly.Proposed fix
/** Whether to show the tenant selector dropdown */ - showTenantSelector = true; + showTenantSelector = false;
Tip
Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Description
Hide the tenant dropdown on the login page when
FINERACT_PLATFORM_TENANTS_IDENTIFIERis not defined. When the variable contains at least 1 explicit tenant, the dropdown is shown with those values.Changes:
displayTenantSelector()method call with ashowTenantSelectorboolean property computed once in [ngOnInit()]— avoids recalculation on every Angular change detection cycle'default'fallback'default'fallback in environment files is preserved, so login always works even without the env varScreenshots
Checklist
web-app/.github/CONTRIBUTING.md.Summary by CodeRabbit