dexterity42 / SharedProjectTimesheetsBundle

Shared Project Timesheets Bundle - Kimai 2 Plugin
MIT License
8 stars 14 forks source link

Option to copy link #17

Closed BeckeBauer closed 3 years ago

BeckeBauer commented 3 years ago

First of all, thanks for the great plugin.

I am missing an option to copy the link by simply clicking somewhere. When I click the link, the link is opened (which is good for checking). Also marking the link is tricky because at least my browser opens the entry so that I cannot copy the link address. The drop down menu has just one option namely to delete the link. The only way (I managed) to copy the link is to firstly click the link and then to copy the address from the bowser bar in the new tab.

Maybe, the link symbol could be used for a "click and copy action" and/or an option "copy link" could be offered in the drop down menu?

dexterity42 commented 3 years ago

Hi @BeckeBauer, thanks for your feedback! This is truly a fast and simple improvement that solves your pain. I think about implementing a readonly input field that selects the whole text/link when clicked on in addition to a button next to that input to copy the link directly. I will have a look into it and try to find out which is the best way to do it, because i want to support mobile devices as well.

dexterity42 commented 3 years ago

Hi @BeckeBauer, sorry you had to wait so long for the feature. I just opened a PR: https://github.com/dexterity42/SharedProjectTimesheetsBundle/pull/23

I would appreciate it if you try out the feature and give me a quick feedback if it is what you had in mind. If you don't know how to check out the PR's code (or the development branch) and update your plugin installation I will push the changes in a pre-release.

Thanks for your patience, hope to hear from you soon.

BeckeBauer commented 3 years ago

Hi @dexterity42, no worries, thanx for taking care of the issue nevertheless. I tried to check out the development branch but it seems that I run into some trouble after I exectuted bin/console kimai:bundle:shared-project-timesheets:install:

[notice] Migrating up to KimaiPlugin\SharedProjectTimesheetsBundle\Migrations\Version2020122010000
[warning] Migration KimaiPlugin\SharedProjectTimesheetsBundle\Migrations\Version2020120600000 was executed but did not result in any SQL statements.
[error] Migration KimaiPlugin\SharedProjectTimesheetsBundle\Migrations\Version2020120920000 failed during Execution. Error: "The column 'record_merge_mode' on table 'kimai2_shared_project_timesheets' already exists." 

When I now open the shared project timesheet tab, I get a 500 error. In the log, the following error is shown:

[2021-11-19 09:38:41] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: "An exception occurred while executing 'SELECT k0_.id AS id_0, k0_.share_key AS share_key_1, k0_.password AS password_2, k0_.entry_user_visible AS entry_user_visible_3, k0_.entry_rate_visible AS entry_rate_visible_4, k0_.record_merge_mode AS record_merge_mode_5, k0_.annual_chart_visible AS annual_chart_visible_6, k0_.monthly_chart_visible AS monthly_chart_visible_7, k0_.project_id AS project_id_8 FROM kimai2_shared_project_timesheets k0_ INNER JOIN kimai2_projects k1_ ON (k0_.project_id = k1_.id) ORDER BY k1_.name ASC, k0_.share_key ASC': SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k0_.annual_chart_visible' in 'field list'" at kimai/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 79 {"exception":"[object] (Doctrine\\DBAL\\Exception\\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT k0_.id AS id_0, k0_.share_key AS share_key_1, k0_.password AS password_2, k0_.entry_user_visible AS entry_user_visible_3, k0_.entry_rate_visible AS entry_rate_visible_4, k0_.record_merge_mode AS record_merge_mode_5, k0_.annual_chart_visible AS annual_chart_visible_6, k0_.monthly_chart_visible AS monthly_chart_visible_7, k0_.project_id AS project_id_8 FROM kimai2_shared_project_timesheets k0_ INNER JOIN kimai_projects k1_ ON (k0_.project_id = k1_.id) ORDER BY k1_.name ASC, k0_.share_key ASC':\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'k0_.annual_chart_visible' in 'field list' at kimai/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:79, Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k0_.annual_chart_visible' in 'field list' at kimai/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k0_.annual_chart_visible' in 'field list' at kimai/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:137)"} []

Any idea what I should do?

dexterity42 commented 3 years ago

Thank you for your quick response and sorry to hear that you get a 500 currently.

It looks like the existing migrations were not found and all migrations were executed again. I simply forgot to add the new property for the table name - which tracks the migration executions for the plugin - to the migration configuration. Thus v1.x.x installations were incompatible.

Please git pull the development branch and execute bin/console kimai:bundle:shared-project-timesheets:install again.

BeckeBauer commented 3 years ago

Works very well 👍 Thank you!

dexterity42 commented 3 years ago

Thanks for your feedback and glad to hear everything is working.

dexterity42 commented 3 years ago

Released with v2.1.0

@BeckeBauer FYI - maybe you want to checkout a stable branch (master or latest release tag tags/v2.1.0).

BeckeBauer commented 3 years ago

I checked it out but noticed one oddity: To open the link works fine with Firefox and MS Edge. To copy the link, however, works only with Firefox but not with MS Edge (I do not use Google Chrome but it might also behave like the MS browser). Sorry that I did not notice it earlier...