Closed sammcj closed 9 years ago
This is a nice suggestion. Having had experience in other context with chosen.js, selectize.js and select2 (and their side problems), I think I would go the selectize way. I need to find the time for this...
Sam - out of this scope - once @greyman888 offered to explain the process which you use the plugin into. It would be great to publish the use case into the project wiki. What do you think? Can you share that info?
Hi Max, We're having an issue internally as since @greyman888 finished his contract with us no one has been given the resources to own the application so it's essentially been left to rot. I don't have the time to look after it but did log this ticket because of how much time of mine it's costing to enter this each day.
@greyman888 - Do you happen to have a presentation or something like that which you could provide to max?
I'm running a userscript which adds select2 to all the select
elements on the timesheet page. It works well.
If anyone is interested:
if ($(document.body).hasClass('controller-timesheets')) {
$('head').append('<link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css" rel="stylesheet" \/>');
$.getScript('//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js', function () {
$('#order, .list select').select2();
});
}
@kane-c thank you for the tip! I didn't even know about userscripts... I learned something https://github.com/OpenUserJs/OpenUserJS.org/wiki/Userscript-Beginners-HOWTO
(an official implementation is due, though)
Max, I have a few deadlines to meet in the next few weeks but after that I would be happy to contribute to the project wiki. I will not refer to any organisations by name.
Back on the topic of this thread, there are two forms where people select target version:
To be totally effective the autocomplete function would need to work in both forms.
Thank you Adam. Yes, both forms would need to be refactored.
I am struggling with adding selectize (or select2), initially on timesheet page. I'm sure I'm doing something silly... @kane-c , maybe you can advice?
What I'm doing: added class "selectize" to the #order select added selectize with bundled sifter and miniplugin into the plugin assets in app/views/timesheets/index.html.erb: on the top <% content_for :header_tags do %> <%= javascript_include_tag '/plugin_assets/redmine_app_timesheets/javascripts/selectize' %> <%= stylesheet_link_tag '/plugin_assets/redmine_app_timesheets/stylesheets/selectize.css' %> <% end %>
then, either in the same :header_tags or at the end of the file:
<script type="text/javascript"> $(document).ready(function() { $('.selectize').selectize({ create: false, sortField: 'text' }) }); </script>
The firefox debugger console says: TypeError: $(...).selectize is not a function
which, afaiu, means there is a duplicate jQuery or no jQuery at all. Adding jQuery in the :header_tags does not help, though.
Anybody can provide some hint, please?
Ok, found it. As expected, a silly thing...
Done. The approach I chose is to Selectize some core selectors in redmine_app__space, which also configures the css .selectize class as candidates. redmine_app_timesheets then adds the css class to its selectors.
Updated 1.5-dev and master branches.
Please let me know if everything works as expected. Cheers.
wow that was fast! Thank you so much Max that's really great!
We'll update our plugin and let you know :)
If you're ever in Melbourne we certainly owe you a beer or two.
:-) remember to update both plugins, or it won't work
Almost works @maxrossello , not sure why but when you view the timesheets application you get a 500, note that we have upgraded to Redmine 3.1.1 as well:
: SELECT DISTINCT "ts_permissions"."id" AS t0_r0, "ts_permissions"."order_id" AS t0_r1, "ts_permissions"."access" AS t0_r2, "ts_permissions"."principal_id" AS t0_r3, "ts_permissions"."is_primary" AS t0_r4, "versions"."id" AS t1_r0, "versions"."project_id" AS t1_r1, "versions"."name" AS t1_r2, "versions"."description" AS t1_r3, "versions"."effective_date" AS t1_r4, "versions"."created_on" AS t1_r5, "versions"."updated_on" AS t1_r6, "versions"."wiki_page_title" AS t1_r7, "versions"."status" AS t1_r8, "versions"."sharing" AS t1_r9, "versions"."in_timesheet" AS t1_r10, "versions"."is_order" AS t1_r11 FROM "ts_permissions" INNER JOIN "versions" ON "versions"."id" = "ts_permissions"."order_id" AND "versions"."is_order" = $1 WHERE "ts_permissions"."is_primary" = $2 AND "ts_permissions"."principal_id" IN (303, 290, 414, 422) ORDER BY access DESC
Completed 500 Internal Server Error in 877ms (ActiveRecord: 47.6ms)
ActiveRecord::StatementInvalid (PG::InvalidColumnReference: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ...."principal_id" IN (303, 290, 414, 422) ORDER BY access DES...
^
: SELECT DISTINCT "ts_permissions"."id" AS t0_r0, "ts_permissions"."order_id" AS t0_r1, "ts_permissions"."access" AS t0_r2, "ts_permissions"."principal_id" AS t0_r3, "ts_permissions"."is_primary" AS t0_r4, "versions"."id" AS t1_r0, "versions"."project_id" AS t1_r1, "versions"."name" AS t1_r2, "versions"."description" AS t1_r3, "versions"."effective_date" AS t1_r4, "versions"."created_on" AS t1_r5, "versions"."updated_on" AS t1_r6, "versions"."wiki_page_title" AS t1_r7, "versions"."status" AS t1_r8, "versions"."sharing" AS t1_r9, "versions"."in_timesheet" AS t1_r10, "versions"."is_order" AS t1_r11 FROM "ts_permissions" INNER JOIN "versions" ON "versions"."id" = "ts_permissions"."order_id" AND "versions"."is_order" = $1 WHERE "ts_permissions"."is_primary" = $2 AND "ts_permissions"."principal_id" IN (303, 290, 414, 422) ORDER BY access DESC):
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
This is a duplicate of #56. It occurs with Postgresql but not Mysql. I will spend some time this week to see if I can either fix it or provide more information to help solve it.
This is probably due to a change to ActiveRecord in Rails version used by Redmine 3.1. As we identify the culprit queries we can add an explicit select. This is not trivial from just the log because it is not so explicit.
The second log I think it is hardly a responsibility of the timesheet plugin:
Setting.plugin_redmine_spent_time_in_issue_description['display_columns'].include?
I can't see how the settings of another plugin (which seem to be nil) can be compromised by this plugin.
Whoops good spotting Max - I've logged a ticket for that separate plugin ;)
Hi,
As you add more cost codes / billing centers to the timesheets plugin we've noticed that it's taking everyone a very long time to find and select the correct target version.
I'm wondering if you could change the dropdown box to an input field where you can type and it autocompletes from the available the target versions - for example like: http://designshack.net/articles/javascript/create-a-simple-autocomplete-with-html5-jquery/