kintone-samples/plugin-samples

[ganttchart] Dates in the Gantt chart fail to be shown if the first record's date field is not set

tkmry opened this issue · 21 comments

tkmry commented

一覧表示した際に先頭のレコードの日付欄が空値だと、
jquery.gantt がカレンダーの生成に失敗し日付欄のヘッダが NaN や undefined となる。

・問題ない例(Test1には日付が設定されている)
image

・問題ある例(Test2には日付が設定されていない)
image

原因等の調査結果はこちらに記載しております。
https://developer.cybozu.io/hc/ja/articles/203716110/comments/900001456206

tkmry commented

この問題は jquery.gantt 側の問題により発生しています。

PullRequest を送っていない理由としては、
修正版 jquery.gantt ファイルを cybozu CDN 上にアップロードするか、
プラグインに同梱するか判断がつかないためです。

なお、下記フォーク版はこのissueに対処済みです。
https://github.com/tkmry/plugin-samples/tree/master/examples/ganttchart

tkmry commented

共有となりますが、jQuery.gantt プラグインリポジトリに本事象の解消を提案していますが、プラグインの設計通りであるとの返信をいただいておりますので、開発者側との折り合いがつくまでは実装の方針を決めるのは待った方がよいかも知れません。
taitems/jQuery.Gantt#239

Excuse me for translating the title into English

Translation:

tkmry commented

jquery.gantt側の修正ですが、現在はコードレビューに入っており、最終的に私の修正の提案を取り入れていただけるようです。

A fix on the jquery.gantt side is currently under code review.
It looks like I'll be able to incorporate my suggested fixes eventually.

tkmry commented

jqurey.Gantt プラグインのリポジトリで、提案が採択されました。 taitems/jQuery.Gantt#239
この件の解消については、jquery.ganttのjsファイル及びcssファイルをCDNに再アップロードするのが良いかと思います。

The proposal has been adopted by the repository of jqurey.Gantt plugins. taitems/jQuery.Gantt#239
To resolve this issue, I think it would be a good idea to re-upload the jQuery.gantt js and css files to CDN.

@tkmry
Hmm ok, we were actually working on this issue with PR #174 , where we made some workarounds to skip displaying records on the Gantt Chart if either Start or End date is not available.

Let me recheck this and see how we should proceed

tkmry commented

Hi, @will-yama .
Thank you for your sharing.

I'll check it.

tkmry commented

@phongnm-dev さん、別解案の提示とコーディングありがとうございます。

  • phongnm-dev さんの解法は一つの答えとして良いと考えています。理由としては、検証済みのデータによって処理は進めていくべきだと考えているからです。
  • ただし、私はこの方法よりも空のタスクとして行が表示される事を望みます。
    その理由として、ガントチャートを利用する目的の一つとして、タスクの全体像や残りの作業量、またその順番をパッと見て理解したいからです。
    私は時期の未定なタスクを追加しています。
    空日付の行が見えなくなる事でタスク漏れの発生を懸念しています。

Thank you @phongnm-dev for presenting and coding another solution.

  • I think phongnm-dev's solution is good as one answer. The reason is that I believe that the process should proceed according to the verified data.
  • However, I would prefer to see the rows as empty tasks rather than this method.
    The reason for this is that one of the purposes of using a Gantt chart is to quickly understand the overall picture of the tasks, the amount of work remaining, and the order of the tasks.
    I sometimes set tasks(plan) for which the date is undecided.
    I am concerned about task omissions due to not being able to see the empty date lines.

Translated with www.DeepL.com/Translator (free version)

@tkmry
Thanks for the feedback about empty dated tasks. We'll look into this.

The tricky thing at the moment about this plug-in is the policy that we use. We read in libraries that are hosted on the Cybozu CDN. If a new jQuery Gantt library version is uploaded onto the Cybozu CDN, then we are more than welcome to fix this plug-in to point towards that new library. The Cybozu CDN library though will only update if the library in question releases a new tag. The problem that lies here is that jQuery Gantt has not released a new tag in 9 years https://github.com/taitems/jQuery.Gantt/tags
Hence that basically means that it's very unlikely that a new jQuery Gantt will be hosted on the Cybozu CDN in the near future.

tkmry commented

@will-yama
Thank you for sharing your concerns and other information.
I will have a conversation with them to see if we can create a release point in that repository.

(* '_`)oO(I wonder It is strange that the release tag is 9 years old (2011), but libraries of 2014 version is uploaded to the Cybozu CDN)

@tkmry
(* '_`)oO(Actually that's a really good point, I didn't notice the 20140623 version...let me check this internally)

@tkmry
It looks like the 20140623 release on the Cybozu CDN was an exception that we made in the past because we did not see jQuery.Gantt releasing any new tags. The 20140623 version was taken from the master on the date of 20140623.
I'm going to see if we can make that exception again with the latest master.

tkmry commented

@will-yama
Thanks a lots. I look forward to hearing good news.

tkmry commented

I am checking to see if I can contribute to this issue so that I can create a release (tag) point.
taitems/jQuery.Gantt#248

@tkmry
Closing into the end of the year, so here is how we will proceed

  1. We probably will be able to get the new CDN ready, which will be released at the begenning of next year
  2. If we can't seem to do that, we will work on solving the issue through #174 instead (thanks for the comments!)

Happy new year. Working on this one - we'll see how the CDN goes.

@tkmry
We have the new CDN running with the 2021 Jan 6th version of jQuery.Gantt.
Upon applying the library to the plug-in, we found that it caused some other bugs, so we took care of those.
The PR for this issue can be found in #178

This will

  • use the latest library so that the NaN and undefined display bug will be fixed
  • display task cells on the End date, if no Start date is present
  • display task cells on the Start date, if no End date is present
  • display no task cells where both Start date and End date are not present (the task will still be displayed on the left hand side)

We will be merging this if there are no problems :)

Merged #178
The bug has been fixed, so this issue will be closed.

Sorry for taking a long time on this task 😳

tkmry commented

Thank you for your support as well! <3