-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
🦋 Changeset detectedLatest commit: 4843cb0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
92f7f35
to
b9a1d6a
Compare
- include the `endDate` if it matches the exact start of a year
const LEARNING_COUNT_LOW_COLOR = '#AEB7C2'; | ||
const LEARNING_COUNT_HIGH_COLOR = '#011E41'; |
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.
Do we have these colors on the design? Can we use var(--go-ui-color-<some-color>)
here?
app/src/views/OperationalLearning/Stats/OperationalLearningMap/index.tsx
Outdated
Show resolved
Hide resolved
<NumberOutput | ||
value={0} | ||
/> |
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.
Any reason this is set as zero?
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.
it's the value for the lowest learning count. Defined a constant and used instead.
const groupedData: Record<string, Record<SourceType, number>> = {}; | ||
|
||
data.forEach((entry) => { | ||
const year = getFormattedDateKey(entry.date); |
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.
Use reduce instead?
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.
Done.
|
||
const strings = useTranslation(i18n); | ||
const alert = useAlert(); | ||
const [activePointKey, setActivePointKey] = useState<string>(); |
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.
Is this type correct? The state is not defined here.
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.
Yes the type here is correct.
const oldestDate = new Date(Math.min(...dates.map((date) => date.getTime()))); | ||
const latestDate = new Date(Math.max(...dates.map((date) => date.getTime()))); |
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.
We should also check for length of dates
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.
Done.
if (isDefined(value) && value > 0) { | ||
return value; | ||
} | ||
return undefined; |
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.
We can use ternary operator here.
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.
Done.
strings.sourceOthers, | ||
]); | ||
|
||
const activePointData = activePointKey ? sourcesOverTimeData?.[activePointKey] : undefined; |
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.
We should use isDefined here
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.
Done.
- Added translation migrations - Created changesets
Requested changes implemented!
Summary
Addresses
Depends On
This PR Ensures:
console.log
statements meant for debugging