Repository navigation
fix: inventory QA i18n (dialogs, monthly report, calendar), empty states, batch dedup #187
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
Changes from all commits
2c9234a
f364d0b
cb5d4a7
35d6bea
b054f82
fb9b878
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| +10 −4 | v2/ui/button/button.component.ts | |
| +4 −2 | v2/ui/calendar/calendar-grid.component.ts | |
| +4 −2 | v2/ui/calendar/calendar-navigation.component.ts | |
| +58 −0 | v2/ui/calendar/calendar.utils.ts |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ import { cardImports } from 'Common-UI/v2/ui/card'; | |
| import { ZardFormImports } from 'Common-UI/v2/ui/form'; | ||
| import { ZardSelectImports } from 'Common-UI/v2/ui/select'; | ||
| import { ZardButtonComponent } from 'Common-UI/v2/ui/button'; | ||
| import { getCalendarMonths } from 'Common-UI/v2/ui/calendar'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-monthly-report', | ||
|
|
@@ -84,25 +85,18 @@ export class MonthlyReportComponent implements OnInit, DoCheck { | |
| ).facilityName; | ||
| facilities = [this.selectedFacilityName, 'All']; | ||
| //BU40088124 27/7/2022 Added Facility Name dropdown in reports | ||
| months = [ | ||
| { val: '0', name: 'Jan' }, | ||
| { val: '1', name: 'Feb' }, | ||
| { val: '2', name: 'Mar' }, | ||
| { val: '3', name: 'Apr' }, | ||
| { val: '4', name: 'May' }, | ||
| { val: '5', name: 'Jun' }, | ||
| { val: '6', name: 'Jul' }, | ||
| { val: '7', name: 'Aug' }, | ||
| { val: '8', name: 'Sep' }, | ||
| { val: '9', name: 'Oct' }, | ||
| { val: '10', name: 'Nov' }, | ||
| { val: '11', name: 'Dec' }, | ||
| ]; | ||
| // Month names are localized from the selected app language (falls back to the | ||
| // English Jan..Dec short names). Built in ngOnInit once the language is known. | ||
| months: { val: string; name: string }[] = []; | ||
| ngOnInit() { | ||
| this.createMonthlyForm(); | ||
| this.getMonth(); | ||
| this.getYear(); | ||
| this.fetchLanguageResponse(); | ||
| this.months = getCalendarMonths().map((name, index) => ({ | ||
| val: String(index), | ||
| name, | ||
| })); | ||
|
Comment on lines
+96
to
+99
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
# Inspect the calendar helper and the app's language-change entrypoints.
rg -n -C 5 'getCalendarMonths|setLanguage\(|currentLanguageObject' \
src Common-UIRepository: PSMRI/Inventory-UI Length of output: 41310 🏁 Script executed: set -eu
printf '%s\n' '--- monthly report component ---'
nl -ba src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.ts | sed -n '1,180p'
printf '%s\n' '--- monthly report template ---'
nl -ba src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.html | sed -n '1,180p'
printf '%s\n' '--- calendar helper definitions/imports ---'
rg -n -F --glob '*.ts' -- 'getCalendarMonths' src/app
printf '%s\n' '--- language service and language-change references ---'
rg -n -F --glob '*.ts' -- 'currentLangugae$' src/app
rg -n -F --glob '*.ts' -- 'setLanguage(' src/app | head -80
rg -n -F --glob '*.ts' -- 'language' src/app/app-modules/core | head -120Repository: PSMRI/Inventory-UI Length of output: 37144 🏁 Script executed: set -eu
printf '%s\n' '--- monthly report language refresh ---'
nl -ba src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.ts | sed -n '300,345p'
printf '%s\n' '--- language service ---'
nl -ba src/app/app-modules/core/services/language.service.ts | sed -n '1,90p'
printf '%s\n' '--- set-language component ---'
nl -ba src/app/app-modules/core/components/set-language.component.ts | sed -n '1,75p'
printf '%s\n' '--- app-header language change ---'
nl -ba src/app/app-modules/core/components/app-header/app-header.component.ts | sed -n '175,235p'
printf '%s\n' '--- Common-UI calendar/package locations ---'
find . -path '*/node_modules/*' -prune -o -iname '*calendar*' -print
rg -n -F --hidden --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' -- 'getCalendarMonths' .
printf '%s\n' '--- Common-UI dependency declarations ---'
rg -n -F --glob 'package*.json' --glob '*.json' -- 'Common-UI' .Repository: PSMRI/Inventory-UI Length of output: 7762 🏁 Script executed: set -eu
printf '%s\n' '--- package and path resolution ---'
find . -maxdepth 3 -type f \( -name 'package.json' -o -name 'tsconfig*.json' -o -name 'angular.json' -o -name 'package-lock.json' \) -print
rg -n -F --hidden --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' -- 'Common-UI' . || true
printf '%s\n' '--- repository tree entries ---'
git ls-tree -r --name-only HEAD | rg -n '(^|/)(Common-UI|common-ui|package.json|tsconfig[^/]*\\.json)$' || true
printf '%s\n' '--- relevant PR diff ---'
git diff --no-ext-diff --unified=20 b86f6838c8ea5ee065d50d12f608042a18a5ecfb b054f829881c010aeb20442706be32b37ff835aa -- package.json package-lock.json tsconfig.json src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.tsRepository: PSMRI/Inventory-UI Length of output: 41329 🏁 Script executed: set -eu
rg -n -F -- 'roleNavigation' src/app/app-modules/core/components/app-header/app-header.component.ts
nl -ba src/app/app-modules/core/components/app-header/app-header.component.ts | sed -n '230,430p'Repository: PSMRI/Inventory-UI Length of output: 7059 🌐 Web query:
💡 Result: 🏁 Script executed: set -eu
sha="$(git ls-tree HEAD Common-UI | awk '{print $3}')"
printf 'Common-UI gitlink: %s\n' "$sha"
url="https://api.github.com/repos/PSMRI/Common-UI/git/trees/${sha}?recursive=1"
curl -fsSL "$url" | python3 -c '
import json, sys
data=json.load(sys.stdin)
for item in data.get("tree", []):
path=item.get("path","")
if "calendar" in path.lower() or path.endswith((".ts",".tsx")) and "ui/" in path:
if "calendar" in path.lower():
print(path)
'
printf '%s\n' '--- calendar source candidates ---'
curl -fsSL "$url" | python3 -c '
import json, sys
data=json.load(sys.stdin)
for item in data.get("tree", []):
path=item.get("path","")
if path.lower().endswith(("calendar.ts","calendar.tsx")) or "/calendar/" in path.lower():
print(item.get("type"), path, item.get("url",""))
'Repository: PSMRI/Inventory-UI Length of output: 1479 🏁 Script executed: set -eu
base='https://raw.githubusercontent.com/PSMRI/Common-UI/c99b56866ce4068bfe3298a07fc11f386d7c11d0'
printf '%s\n' '--- calendar index ---'
curl -fsSL "$base/v2/ui/calendar/index.ts" | nl -ba
printf '%s\n' '--- calendar utils ---'
curl -fsSL "$base/v2/ui/calendar/calendar.utils.ts" | nl -ba
printf '%s\n' '--- locale references in calendar ---'
for file in calendar-grid.component.ts calendar-navigation.component.ts calendar.component.ts calendar.types.ts; do
printf '%s\n' "--- $file ---"
curl -fsSL "$base/v2/ui/calendar/$file" | rg -n -C 3 'locale|month|Intl|navigator|language|lang' || true
doneRepository: PSMRI/Inventory-UI Length of output: 21543 Rebuild month options when the app language changes.
Suggested fix+ private calendarLanguage: string | null = null;
+
+ private refreshMonths() {
+ const language =
+ this.sessionstorage.getItem('currentLanguage') || 'English';
+ if (language === this.calendarLanguage) return;
+
+ this.months = getCalendarMonths().map((name, index) => ({
+ val: String(index),
+ name,
+ }));
+ this.calendarLanguage = language;
+
+ const selectedMonth = this.monthlyForm?.value.month;
+ if (selectedMonth) {
+ this.monthlyForm.patchValue({
+ month: this.months[Number(selectedMonth.val)],
+ });
+ }
+ }
+
ngOnInit() {
this.createMonthlyForm();
this.getMonth();
this.getYear();
this.fetchLanguageResponse();
- this.months = getCalendarMonths().map((name, index) => ({
- val: String(index),
- name,
- }));
+ this.refreshMonths();
this.setSelectedFacility();
} ngDoCheck() {
this.fetchLanguageResponse();
+ this.refreshMonths();
}🤖 Prompt for AI Agents |
||
| this.setSelectedFacility(); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: PSMRI/Inventory-UI
Length of output: 26025
🏁 Script executed:
Repository: PSMRI/Inventory-UI
Length of output: 8071
🏁 Script executed:
Repository: PSMRI/Inventory-UI
Length of output: 3703
🏁 Script executed:
Repository: PSMRI/Inventory-UI
Length of output: 5291
Gate the item-list empty states on request completion.
The main-store and sub-store arrays start empty and are populated only after their HTTP requests return. Their rows can therefore display “No records found” while the request is pending. Add a loaded flag to both components and include it in each
*ngIf.Suggested fix
📍 Affects 3 files
src/app/app-modules/inventory/indent/indent-order-worklist/main-store-indent-order-worklist/main-store-item-model/main-store-item-model.component.html#L69-L69(this comment)src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/sub-store-item-model/sub-store-item-model.component.html#L77-L77src/app/app-modules/inventory/store-stock-adjustment/view-stock-adjustment-details/view-stock-adjustment-details.component.html#L105-L105🤖 Prompt for AI Agents