-
Notifications
You must be signed in to change notification settings - Fork 128
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
Timebased blocks listing #779
Conversation
ed82945
to
846da88
Compare
"Time based blocks listing page cannot run in lite mode.", NotSupportedStatusType) | ||
} | ||
|
||
grouping := dbtypes.TimeGroupingFromStr(val) |
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.
Please pass a TimeBasedGrouping
instead of a string to timeBasedBlocksListing
. This should be simpler, and will eliminate the potential future bug where TimeGroupingFromStr and the strings in the functions like YearBlocksListing
may no longer agree.
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.
The string is needed on the front end since the four routes share a template. I could pass the string and the TimeBasedGrouping
object but that might result to duplication and also create bugs when there are inconsistencies between the two values set.
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.
The nice thing about objects with methods is that you can call the method from the template. :D I'm referring to func (g TimeBasedGrouping) String() string
. In fact, since this type implements the Stringer
interface, I'd be surprised if you even need to call String() manually, but you can.
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 can be revisited, but please note by above comment.
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 function func (g TimeBasedGrouping) String() string
is going to be very important in relation to the next PR that I am currently testing.
Comment noted though.
08fa6a4
to
2cb6aba
Compare
87831db
to
3209679
Compare
0655ce2
to
3bd14c4
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.
The docs you added for fetchRowLinkURL clarified it perfectly. Thanks.
3bd14c4
to
ea9eb1e
Compare
Adds /years, /months, /weeks and /days pages that are hierarchically linked to each other i.e /years -> /months -> /weeks -> /days -> blocks. This implies every row in "/years" page has a link to "/months" page, every row in "/months" page has a link to "/weeks" page, every row in "/weeks" page has a link to "/days" page and every row in "/days" page has a link to "/blocks" page. Reduces the font-size of the drop down menu and rearranges the navigation buttons so that the right most buttons returns the history data. ☝️ |
27d3297
to
7dfc563
Compare
067cbc4
to
1ffb635
Compare
3df1eb2
to
cbe719e
Compare
cbe719e
to
7bd4ee7
Compare
This is working very well in my testing now. At first I was seeing the blocks list pages automatically reload the homepage on some websocket event, but that seems to be sorted out after clearing cache. The only real style change is the font size of the menu going from 20 pt to 15 pt. It's quite easy to revert that and it is not too disruptive, so I say we merge this and see how people like it during the 3.2 dev cycle. |
This adds new block listing pages differing by time window grouping. Added pages are: /years, /months, /weeks, and /days. They hierarchically link to each other i.e /years -> /months -> /weeks -> /days -> /blocks. Every row in "/years" page has a link to "/months" page, every row in "/months" page has a link to "/weeks" page, etc. This also reduces the font-size of the drop down menu and rearranges the navigation buttons so that the right most buttons returns the history data.
PR introduce time-based blocks list view pages below. Grouping is done using the block time value.
"/years" - Groups blocks into years
"/months" - groups blocks into months
"/weeks' - Groups blocks into weeks
"/days' - Groups blocks into days
All the above pages follow this similar format.