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

Refactor function or property names #31

Open
22 of 31 tasks
rubycho opened this issue Dec 8, 2020 · 3 comments
Open
22 of 31 tasks

Refactor function or property names #31

rubycho opened this issue Dec 8, 2020 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@rubycho
Copy link
Collaborator

rubycho commented Dec 8, 2020

common

  • acc will be named as {type}Acc
  • item will be named as {type}

utils.js

  • getFormattedDate(date, format) to formatDate(date, format)
  • getCurrentMonth(date) will be removed by lint
  • genDayOfWeek(DayOfWeekString) to genDateBlock(dayOW), which dayOW means dayOfWeek
  • str2numberString in genDayOfWeek to dayOWMap
  • genTimeBlock(dayOfWeek, hours, minutes) to genTimeBlock(dayOW, hours, minutes)
  • addColor(events) to assignColor(events)
  • hashString(s) will be removed by lint
  • colorGenerator(num) to pickColor(idx), color_list to colorList

TimeTableView.js

  • props numberOfDays to nDays
  • props formatDateHeader to dateHeaderFormat
  • props selectedDate and pivotDate should be fixed and linted
  • state currentMoment to currentDate
  • generateTimes(pivotTime, endPivotTime) to genTimes(pivotTime, endPivotTime) or better syntax

Header.js

  • getFontSizeHeader(numberOfDays) to headerFontSize(nDays)
  • getDayTextStyles(numberOfDays) to dayTextStyle(nDays)
  • getColumns(numberOfDays, selectedDate) to datesFrom...(nDays, ...)
  • Columns({ columns, numberOfDays, format}) to DaysHeader({ dates, nDays, format }) and remove Column Component.
  • Title role seems to be speicifed. It is empty.
  • WeekViewHeader props numberOfDays to nDays
  • WeekViewHeader props selectedDate to ...
  • WeekViewHeader props formatDate to dateFormat

Events.js

  • Events to EventTable
  • getEventsByNumberOfDays(numberOfDays, events, selectedDate) to catEventsByDays(nDays, events, ...)
  • getStyleForEvent(item) to calcEventStyle(event)
  • getEventsWithPosition(totalEvents) to adjustEventStyle(allEvents)
  • getEventItemWidth; change as const (if hooks)
  • sortEventByDates(events) to sortEventsByDate(events)
  • Events props numberOfDays to nDays
  • Events props selectedDate to ...

Event.js

  • currently no item available

selectedDate

  • TimeTableView is saving props pivotDate to state currentMoment. And in UNSAFE_componentWillReceiveProps, it updates currentMoment as undocumented props selectedDate. And currentMoment is injected to child components. Will there be scenarios using selectedDate? In my current view, we could just remove that state and just use pivotDate, renaming all selectedDate items to pivotDate.

Extra alert

  • Variable names on function could also change, based on new function name.
  • Using old function names which is revealed to user, will be allowed until future v.1.0.6; with aliasing + deprecation notice in documentation. After that we may remove the alias codes.

Please feel free to comment for discussion, related to above items.

@rubycho rubycho pinned this issue Dec 11, 2020
@rubycho rubycho added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Dec 11, 2020
@sancodes
Copy link
Contributor

Is this still open ? I am willing to help fix this.

@rubycho
Copy link
Collaborator Author

rubycho commented Jun 22, 2021

Hello @sancodes
Yes, this issue is still open. Since the issue is huge, if you're interested and willing to fix it, you can create a pull request by category (e.g. common, utils.js).

Thank you.

@sancodes
Copy link
Contributor

@rubycho I will like to help with that.

gomjellie added a commit that referenced this issue Jul 3, 2021
…_util.js

Refactor function or property names #31 - util.js
gomjellie added a commit that referenced this issue Jul 3, 2021
…_timeTableView.js

Refactor function or property names #31 - TimeTableView.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants