akiko-pusu / redmine_issue_templates

Maintenance Repository - https://github.com/agileware-jp/redmine_issue_templates
https://www.redmine.org/plugins/redmine_issue_templates
GNU General Public License v2.0
199 stars 121 forks source link

Remove feature: Integrate with Checklist plugin. #363

Open akiko-pusu opened 4 years ago

akiko-pusu commented 4 years ago

Announcement

See: https://redmine.org/boards/3/topics/29878?r=55319#message-55319

As I posted above, I'm going to remove the feature to integrate Checklists plugin (free version). I'll remove this feature at the next release, including maintenance release for 0.3-stable and 1.x.

Why remove this feature?

This limited feature was released since v0.1.3.

But now I don't have much time to use Redmine and it's difficult for me to keep following version-up activities not only of Redmine but also Checklist plugin. Redmine version 4.x (or next major version) may change the jQuery's version.

With this upcoming change, it can be difficult to maintain the basic functionality of the Issue template.

Related Issue: https://github.com/akiko-pusu/redmine_issue_templates/issues/364

If you want to use the functionality of the checklist template, I think users should use the paid version. It's fair use and a good position to respect each other and the developers.

What happens if this feature removed?

Workaround?

1. Use the paid version of the Checklist plugin

2. Write down the JavaScript code by yourself

Here is the code that the Issue Templates plugin creates checklists dynamically. It's not so complicated code. Maybe all you have to do is porting the function named addChecklist into your JavaScript code. (ℹ️ View Customize plugin is quite helpful for these requirements!)

https://github.com/akiko-pusu/redmine_issue_templates/blob/67c142e752dcc66f720ab3ce73769ce2b8ae8b7d/assets/javascripts/issue_templates.js#L297-L317

The argument (named "obj") is a JavaScript object. The obj has a key named "checklist" and its value is an array.


// Just porting the above function in your JavaScript.
function addCheckList (obj) {
  let list = obj.checklist
  if (list == null) return false
    let checklistForm = document.getElementById('checklist_form')
  if (!checklistForm) return

  // NOTE: If Checklist does not work fine, please confirm its version and the DOM element of
  // checklist input field exists.
  try {
    for (let i = 0; i < list.length; i++) {
      let node = document.querySelector('span.checklist-item.new > span.checklist-edit-box > input.edit-box')
      if (node) {
        node.value = list[i]
        document.querySelector('span.checklist-item.new > span.icon.icon-add.checklist-new-only.save-new-by-button').click()
      }
    }
  } catch (e) {
    console.log(`NOTE: Checklist could not be applied due to this error. ${e.message} : ${e.message}`)
  }
}

// Define the object which has checklists (as Array).
const obj = {
  checklist: [
    "ToDo Item: 1",
    "ToDo Item: 2",
    "ToDo Item: 3"
  ]
};

// Pass the value.
// May the force be with you!
addChecklist(obj);

Please note: console.log(`NOTE: Checklist could not be applied due to this error. ${e.message} : ${e.message}`) may not work correctly if you use IE11 or legacy browser.

You can replace to:

// Not work on IE11
// console.log(`NOTE: Checklist could not be applied due to this error. ${e.message} : ${e.message}`) 

// Please change not to use template literal
console.log('NOTE: Checklist could not be applied due to this error. ' + ${e.message} + ' : ' +  ${e.message}) 
akiko-pusu commented 4 years ago

英語はかなり怪しいので、日本語でも添えておきます。

Checklistプラグイン連携を廃止します

今後リリース予定のIssue Template 1.0.5, (または0.3-stableブランチ)では、Checklistプラグイン連携を廃止します。

廃止理由

今後Redmine本体のバージョンアップに伴い、JavaScript周りでの書き換えが発生する可能性があります。

Checklistプラグインとの連携は、要望としてわたしも対応をしていました。

ただし、Checklistプラグインのソースの最新版を都度入手しないといけないこと、ユーザのバージョンに沿った組み合わせで確認しないといけないことなど、本来のIssue Templateの機能以外のところでの工数が非常に発生しています。

また、Checklistプラグインは有償版でテンプレートの機能を持っているので、本来は必要であればプラグイン開発側への妥当な対価として、有償版を入手して利用いただくべきとも考えています。

代替案 / 回避策

上記のWorkaroundをご参照ください。

※現在 Issue Template 1.0xのバージョンで採用している、カスタムフィールドや標準フィールドへのテンプレート対応も、上記のようにAPI的にサーバ側からJSONを渡し、フロントエンドでJavaScriptを利用して各フィールドに値を適用させています。

tiurlumbangaol commented 4 years ago

hi, before removing "checklist" feature, can you please fix this bug 1st : https://github.com/akiko-pusu/redmine_issue_templates/issues/364

that issue is because of this commit : https://github.com/akiko-pusu/redmine_issue_templates/commit/2f25230664bcce39cf1a8829583d1acc0d10ecec

on previous commit, still working well : https://github.com/akiko-pusu/redmine_issue_templates/commit/7808d41b7b5fc5f11e758f8be36d2f83aa07e710

and i tested it using redmine checklist plugin, paid/pro version...

akiko-pusu commented 4 years ago

@tiurlumbangaol

This defect is caused by the script related to Checklists.

hi, before removing "checklist" feature, can you please fix this bug 1st :

Please confirm: Next bug fix is the same to remove this Checklist integration feature.

akiko-pusu commented 4 years ago

Pull request to remove this feature was merged into develop. https://github.com/akiko-pusu/redmine_issue_templates/pull/369

akiko-pusu commented 4 years ago

The final version to support Checklist integration was released as v1.0.5.

I'm going to release v1.1.0 which drops off the feature, as soon as possible.

akiko-pusu commented 4 years ago

Redmine Issue Template v1.1.0 was released.

From this version, the checklist integration feature was dropped.

I will no longer maintain v1.0.x because I don't have much time to use Redmine and it's difficult for me to keep following version-up activities not only of Redmine but also Checklist plugin.

If you hope to use this obsolete feature, please use v1.0.5 or falk and customize this version.

It's fair use and a good position to respect each other and the developers. And I'd like to say my great thanks to Checklist plugin developers.


Redmine Issue Template 1.1.0をリリースしました。 このバージョンからはチェックリスト連携を外しています。もし必要な場合は、v1.0.5 を利用してください。

今後v1.0.5を含む 1.0.xはサポートしません。Redmine本体のバージョンが上がったり、JavaScriptやHTML要素の変更が入り動かなくなった場合もサポートはしません。

1.1.x 以降、もしくはmasterブランチのみで、Redmine本体に追従したサポートを行います。

これは、上記に記載の通り、Checklistプラグインのソースの最新版を都度入手しないといけないこと、ユーザのバージョンに沿った組み合わせで確認しないといけないことなど、本来のIssue Templateの機能以外のところでの工数が非常に発生しているためです。 また、Checklistプラグインは有償版でテンプレートの機能を持っているので、本来は必要であればプラグイン開発側への妥当な対価として、有償版を入手して利用いただくべきとも考えています。

なお、引き続き IE11をお使いの方は 1.0.x および 1.1.x 系の動作は保証しません。 安定版の 0.3-stable ブランチをご利用ください。