-
Notifications
You must be signed in to change notification settings - Fork 27
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
1073 enable date/time pattern selection through ColumnSettings #1087
1073 enable date/time pattern selection through ColumnSettings #1087
Conversation
✅ Deploy Preview for papaya-valkyrie-395400 canceled.
|
0364347
to
fec2dd7
Compare
fec2dd7
to
7e954b5
Compare
87555cb
to
4c412dc
Compare
vuu-ui/packages/vuu-table-extras/src/column-formatting-settings/ColumnFormattingPanel.tsx
Show resolved
Hide resolved
function formattingSettingsByColType(props: FormattingSettingsProps) { | ||
const { column } = props; | ||
|
||
if (isDateTimeColumn(column)) { |
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.
somewhere we ought to warn the user if they do something invalid, like assigning a date/time type to a column with a serverDatatype that is not long
. This is part of the weird dissonance arising out of the fact that we're mixing server assigned data types and client side config.
Maybe we ignore for now and assume we'll fix all this when we overhaul the metadata sent by server.
const { column } = props; | ||
|
||
if (isDateTimeColumn(column)) { | ||
return <DateTimeFormattingSettings {...props} column={column} />; |
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.
This is good but there's still a gap in functionality. We're showing the data/time config settings if the column has already been configured as a
date/time type. But the config settings panel should be where we can actually assign date/time as the type to a column of type long
I see two possibilities
-
we populate the renderer dropdown with an alternative to the 'default long renderer', we add a 'default date/time' renderer. This would assign the date/time type to a
long
column.
technically we're not actually implementing a renderer, just a formatter. -
We add an additional UI item, to allow toggle on a long column, so user can pick between
number
ordate/time
When thet switch to date/time, we render the new settings
wdyt ?
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 that's true. To me the second option sounds better (though the first one seems easier to implement, second might need passing down a separate action handler for handling type change).
Mixing up renderers with formatters could end up confusing devs, and it could also be harder for the users to navigate in case we have many renderers.
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.
all looks good. Need to add the ability to switch a long to data/time in the settings panel.
I'd suggest adding a few date and time columns to instruments-extended
in the test data package) Thats where we added stuff to test the boolean columns - I extracted these to instruments-extended rather than leave them in instruments when I realized later that the extra columns broke some existing stuff. Now that instruments-extended isd a separate table, we can add anything we want.
If you view it in Tables/SIMUL/InstrumentsExtended in showcase, you can bring up the ColumnSettings -
284482d
to
ca4370e
Compare
This is how the table/settings look:
|
e5d1e19
to
d72d8c6
Compare
d59cca9
to
7e0a79c
Compare
1f671ff
to
9ff9b1f
Compare
- converges date and time column types to one unified date/time type, consistent with how some major programming languages handles datetime. - date/time pattern selection is only available for columns with "date/time" type. - changes DateTimePattern to be an object instead of strings to enable simultaneous selection of both date and time patterns. - also moves DateTimeColumnDescriptor to vuu-table-types package for consistency.
9ff9b1f
to
70344a7
Compare
- users can now declare the type of long columns as plain number or date/time. - removed isSimpleColumnType as its no longer needed. - added a timestamps (long) column in showcase's instruments-extended table.
70344a7
to
f227c9f
Compare
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.
looks good, plus tested it locally
with how some major programming languages handles datetime.
simultaneous selection of both date and time patterns.