tobybatch / ChromeKimaiBridge

Allows time to logged from ChromePlugin tickets into a Kimai instance
MIT License
12 stars 2 forks source link

ChromeKimaiBridge for Nextcloud Deck #9

Open krestyanikov opened 3 years ago

krestyanikov commented 3 years ago

Hello @tobybatch

I think it would be a great idea to expand your plugin for Nextcloud Deck as well. Now Nextcloud Deck is finally released and very popular. We started to use it successfully in our work and are very happy with it.

This can be added as follows

https://mydomain.com/index.php/apps/deck/#/board/1/card/140

where

index.php/apps/deck - nextcloud deck indicator (analogy hostname == "trello.com") board/1 - project ID card/140 - card ID

It would also be an interesting feature to add a meta field with a link to a card.

What do you think of that?

Thanks!

tobybatch commented 3 years ago

This is quite a big change. We'll need to add an setting to the options page that records your domain name so we can detect that page. We'll need to add a new code block that will be triggered and figure out the correct board/card names to pass to the plugin.

If you want to contribute then I can help you find the correct locations to alter the code but I don't have a Next cloud deck to test/dev against, so I'd not really be able to work on this ATM.

I'll keep this open as adding more clients does seem like a good idea.

krestyanikov commented 3 years ago

Great. I'll try to add my contribution soon. I wanted to make sure you were interested in developing the plugin. You're right to add domain information to the settings. Thank you.

p.s. Sorry if my English isn't so good.

tobybatch commented 3 years ago

No worries about the English.

I'll create a branch and stub up some pseudo code, give me a little time.

tobybatch commented 3 years ago

Can you supply me with a sample URL from a Nextcloud deck 'card' please?

I'm thinking about adding support for domain/reg ex to get the card id's

krestyanikov commented 3 years ago

Please see your email

krestyanikov commented 3 years ago

Hello @tobybatch

Did you have time to see the nextcloud deck?

Have a nice day.

tobybatch commented 3 years ago

Yes, thanks. I'll think about how I patch the plugin.

tobybatch commented 3 years ago

@krestyanikov Can you take alook at the branch 9-add-support-for-extra-services

You'll need to pull the repo and checkout the new branch and replace the chrome extension but I've added a settings page on /chrome/settings that lest you add host names and regex's to enable any host.

krestyanikov commented 3 years ago

Hello @tobybatch , your regex idea is amazing!

I have experienced some difficulties, but it works! I will not create a commit, but I will describe it right here with your permission.

image

At first I tried it, but I got a mistake

[2020-08-07 12:25:14] php.CRITICAL: Uncaught Error: Argument 1 passed to KimaiPlugin\ChromePluginBundle\Entity\SettingEntity::setRegex2() must be of the type string, null given, called in /home/krestya5/public_html/kimai2/var/plugins/ChromePluginBundle/Controller/ChromeController.php on line 467 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to KimaiPlugin\ChromePluginBundle\Entity\SettingEntity::setRegex2() must be of the type string, null given, called in /home/krestya5/public_html/kimai2/var/plugins/ChromePluginBundle/Controller/ChromeController.php on line 467 at /home/krestya5/public_html/kimai2/var/plugins/ChromePluginBundle/Entity/SettingEntity.php:60)"} []

I easily fixed it

image

Next, when I tried to transfer a link from the plugin, I found that it was interrupted on the Score symbol

had to encode the URL in the plugin

image

image

The link was received correctly, but only the board code was transmitted

/index.php/apps/deck/#/board/14/card/133 Returning board id=14, card id= [] []

for some reason $matches[1] was not obtained through regex.

I used the following settings and it worked!

image

Returning board id=14, card id=133 [] []

Thank you very much for your work! There are some other problems that I've discovered. I'll describe them in other Issues

tobybatch commented 3 years ago

Can you try pulling the latest version, on branch 9-add-support-for-extra-services

There is now a test button next to the config entry that should allow you to run a test URI through the service that parses the URL

krestyanikov commented 3 years ago

Hello @tobybatch

I checked for changes. I noticed a couple of problems

  1. The return of two variables does not work. I changed it.

image

image

  1. When testing, there is no way to leave the field blank.

image

if I insert an empty value into Regex2, I get an error.

image

Have a nice day.

tobybatch commented 3 years ago

@krestyanikov Sorry for the delay, I've been away for a bit. Back now, I'll take a look this week.

tobybatch commented 3 years ago

@krestyanikov I'm back with another (better) iteration that seems to work for me. Again you'll need to pull the 9-add-support-for-extra-services branch in the var/plugin/ChromePluginBundle and reload the crx that's in that branch.

I think this should work with nextcloud deck.

krestyanikov commented 3 years ago

Hello @tobybatch

It works fine! You will get more stars and feedback when we start using the plugin in production. I noticed a slight inaccuracy, but I'm not sure if it's an error. In the list of time entries, the description is activity, but the description entries are not displayed

image

image

I also have other suggestions that I will publish separately.

p.s. do You have a donation channel?

Thanks!

krestyanikov commented 3 years ago

Hello @tobybatch

Can you install a new version of the plugin in the chrome store?

Have a nice day.

tobybatch commented 3 years ago

Hi @krestyanikov I'll get on this asap. I need to be careful that I keep backward compatibility though. I'll put some time in to this soon.