-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Improve spreadsheet import flow #839
Conversation
alex-Arc
commented
Mar 20, 2024
Important Auto Review SkippedReview was skipped due to path filters Files ignored due to path filters (33)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
remember to run fix the linter issues.
I am not sure about the structure here, I will take some time to look into it once we can merge
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.
there is a lot of code here
I made a few suggestions for cleanup, lets start with those and I will look into the details more carefully after
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.
🚀
# Conflicts: # apps/server/src/api-data/db/db.controller.ts
if you have a chance to skim it that would be great |
This comment was marked as resolved.
This comment was marked as resolved.
@@ -874,8 +874,8 @@ describe('parseExcel()', () => { | |||
// TODO: update tests once import is resolved |
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.
You can remove this todo now
@@ -192,10 +189,6 @@ export const parseExcel = (excelData: unknown[][], options?: Partial<ImportMap>) | |||
} | |||
} else if (j === titleIndex) { | |||
event.title = makeString(column, ''); | |||
// if this is a block, we have nothing else to import | |||
if (event.type === SupportedEvent.Block) { |
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.
Question, can you give some background to the decision to remove this?
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.
yeah
it tried testing out what this skips, and calling continue in an exhaustive else if stack doesn't change anything
and as the type might not be the first thing found all the timer event fields will be added to a block event
so i added the clean up after https://github.com/cpvalente/ontime/pull/839/files/9b459c1fe43fe7359291a83f0f15907d06330d82#r1536170551
@@ -35,22 +35,40 @@ const parse = (valueAsString: string): number => { | |||
return Math.abs(parsed); | |||
}; | |||
|
|||
const stripAMPM = (value: 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.
I think we have a function isAMPM that does some of this?
event.timerType = TimerType.CountDown; | ||
event.type = SupportedEvent.Event; | ||
// if it is a Block type drop all other filed | ||
if (event.type === SupportedEvent.Block) { |
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.
cleans up the block event