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

project: Operational learning 2.0 #1629

Merged
merged 13 commits into from
Jan 29, 2025

Conversation

samshara
Copy link
Member

Summary

  • Implement UAT changes for Operational Learning
  • Display key statistics for Operational Learning

Addresses

Depends On

This PR Ensures:

  • No typos or grammatical errors
  • No conflict markers left in the code
  • No unwanted comments, temporary files, or auto-generated files
  • No inclusion of secret keys or sensitive data
  • No console.log statements meant for debugging
  • All CI checks have passed

Copy link

changeset-bot bot commented Jan 17, 2025

🦋 Changeset detected

Latest commit: 4843cb0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@ifrc-go/ui Patch
go-web-app Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@samshara samshara marked this pull request as ready for review January 29, 2025 06:08
@samshara samshara requested a review from frozenhelium January 29, 2025 06:29
Comment on lines 56 to 57
const LEARNING_COUNT_LOW_COLOR = '#AEB7C2';
const LEARNING_COUNT_HIGH_COLOR = '#011E41';
Copy link
Member

Choose a reason for hiding this comment

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

Do we have these colors on the design? Can we use var(--go-ui-color-<some-color>) here?

Comment on lines 195 to 197
<NumberOutput
value={0}
/>
Copy link
Member

Choose a reason for hiding this comment

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

Any reason this is set as zero?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's the value for the lowest learning count. Defined a constant and used instead.

Comment on lines 81 to 84
const groupedData: Record<string, Record<SourceType, number>> = {};

data.forEach((entry) => {
const year = getFormattedDateKey(entry.date);
Copy link
Member

Choose a reason for hiding this comment

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

Use reduce instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.


const strings = useTranslation(i18n);
const alert = useAlert();
const [activePointKey, setActivePointKey] = useState<string>();
Copy link
Member

Choose a reason for hiding this comment

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

Is this type correct? The state is not defined here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes the type here is correct.

Comment on lines +142 to +143
const oldestDate = new Date(Math.min(...dates.map((date) => date.getTime())));
const latestDate = new Date(Math.max(...dates.map((date) => date.getTime())));
Copy link
Member

Choose a reason for hiding this comment

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

We should also check for length of dates

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Comment on lines 150 to 153
if (isDefined(value) && value > 0) {
return value;
}
return undefined;
Copy link
Member

Choose a reason for hiding this comment

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

We can use ternary operator here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

strings.sourceOthers,
]);

const activePointData = activePointKey ? sourcesOverTimeData?.[activePointKey] : undefined;
Copy link
Member

Choose a reason for hiding this comment

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

We should use isDefined here

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

- Added translation migrations
- Created changesets
@frozenhelium frozenhelium dismissed tnagorra’s stale review January 29, 2025 09:00

Requested changes implemented!

@frozenhelium frozenhelium merged commit 89e6ace into develop Jan 29, 2025
20 checks passed
@frozenhelium frozenhelium deleted the project/operational-learning-2.0 branch January 29, 2025 09:03
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.

4 participants