Bug 27321

Summary: Make excluded database columns in system preferences more clearly disabled
Product: Koha Reporter: Lucas Gass <lucas>
Component: Staff interfaceAssignee: Lucas Gass <lucas>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: andrewfh, caroline.cyr-la-rose, david, fridolin.somers, gmcharlt
Version: MainKeywords: Manual
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement styles non-selectable database columns in system preferences in a light grey (#cccccc), making them easier to identify. Currently the checkbox and label are the same color as selectable columns.
Version(s) released in:
21.05.00,20.11.03
Bug Depends on: 27261    
Bug Blocks:    
Attachments: Bug 27321: make disabled labels #cccccc
Bug 27321: make disabled labels #cccccc
Bug 27321: (follow-up) Use class instead of style attribute.
Bug 27321: Make disabled DB columns clearly disabled visually
Bug 27321: Make disabled DB columns clearly disabled visually
Bug 27321: Make disabled DB columns clearly disabled visually

Description Lucas Gass 2020-12-31 15:35:34 UTC
Bug 17364 added the ability to exclude database columns in system preferences. When something is disabled the checkbox is disabled but it is still hard to tell its disabled because the corresponding label remains the same color as all the others.
Comment 1 Lucas Gass 2020-12-31 15:41:52 UTC
Created attachment 114761 [details] [review]
Bug 27321: make disabled labels #cccccc

To test:
1. Apply patch and its dependency (bug 17364)
2. Go the system pref BorroweUnwantedFields
3. branchcode should cleary stand out as disabled (#cccccc)
Comment 2 Andrew Fuerste-Henry 2020-12-31 18:35:56 UTC
Created attachment 114763 [details] [review]
Bug 27321: make disabled labels #cccccc

To test:
1. Apply patch and its dependency (bug 17364)
2. Go the system pref BorroweUnwantedFields
3. branchcode should cleary stand out as disabled (#cccccc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 3 Fridolin Somers 2021-01-04 08:22:45 UTC
Oh style inside HTML :/

In my opinion it whould be better into CSS file.
With selector : .dbcolumn_selection:disabled
Comment 4 Lucas Gass 2021-01-04 22:36:54 UTC
(In reply to Fridolin Somers from comment #3)
> Oh style inside HTML :/
> 
> In my opinion it whould be better into CSS file.
> With selector : .dbcolumn_selection:disabled

.dbcolumn_selection:disabled will style the disabled input but not it's parent, the label. In my opinion we want to be able to make the label have a gray color (#cccccc) 

Since CSS cannot target an element's parent I chose to style inline.
Comment 5 Fridolin Somers 2021-01-05 08:01:55 UTC
(In reply to Lucas Gass from comment #4)
> (In reply to Fridolin Somers from comment #3)
> > Oh style inside HTML :/
> > 
> > In my opinion it whould be better into CSS file.
> > With selector : .dbcolumn_selection:disabled
> 
> .dbcolumn_selection:disabled will style the disabled input but not it's
> parent, the label. In my opinion we want to be able to make the label have a
> gray color (#cccccc) 
> 
> Since CSS cannot target an element's parent I chose to style inline.

Oooo indeed my mistake :O
Thanks a lot for the explanation.
Comment 6 Owen Leonard 2021-01-11 19:39:53 UTC
Created attachment 115045 [details] [review]
Bug 27321: (follow-up) Use class instead of style attribute.

This patch relplaces the inline style and uses a class name instead.
SCSS is modified, so rebuild the staff client CSS before testing
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).
Comment 7 Katrin Fischer 2021-01-12 22:45:22 UTC
Can we please get a quick sign-off here so I can move on with the dependent bug? :)
Comment 8 Lucas Gass 2021-01-12 23:30:43 UTC
(In reply to Owen Leonard from comment #6)
> Created attachment 115045 [details] [review] [review]
> Bug 27321: (follow-up) Use class instead of style attribute.
> 
> This patch relplaces the inline style and uses a class name instead.
> SCSS is modified, so rebuild the staff client CSS before testing
> (https://wiki.koha-community.org/wiki/
> Working_with_SCSS_in_the_OPAC_and_staff_client).

Owen, this is a much smarter way to do it than with the inline style I was using. However there is one problem. If I apply this and look at borrowerUnwantedField the disabled class is applied to 'branchcode' but it is also applied to every subsequent db column. 

I think in the else block we need tell it which class to have.
Comment 9 Lucas Gass 2021-01-12 23:45:56 UTC
Created attachment 115103 [details] [review]
Bug 27321: Make disabled DB columns clearly disabled visually

To test:
1. Apply patch and its dependency (bug 17364)
2. Rebuild the CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)
3. Go the system pref BorroweUnwantedFields
4. branchcode should cleary stand out as disabled (#cccccc)
Comment 10 David Nind 2021-01-30 02:16:28 UTC
Created attachment 116088 [details] [review]
Bug 27321: Make disabled DB columns clearly disabled visually

To test:
1. Apply patch and its dependency (bug 17364)
2. Rebuild the CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)
3. Go the system pref BorroweUnwantedFields
4. branchcode should cleary stand out as disabled (#cccccc)

Signed-off-by: David Nind <david@davidnind.com>
Comment 11 David Nind 2021-01-30 02:18:03 UTC
I had trouble getting this patch to apply with the dependencies, but managed to git there in the end:
- git bz apply 17364
- git bz apply 27321 (git bz apply 27321 - Bug 27321 Depends on bug 27261 Follow? [(y)es, (n)o] y)

If I just went git bz apply 27321 and said yes to dependent bugs (only 27261) then it wouldn't apply.

In the test plan I'm assuming BorroweUnwantedFields should be PatronSelfRegistrationBorrowerUnwantedField
Comment 12 Katrin Fischer 2021-01-31 14:31:23 UTC
Created attachment 116118 [details] [review]
Bug 27321: Make disabled DB columns clearly disabled visually

To test:
1. Apply patch and its dependency (bug 17364)
2. Rebuild the CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)
3. Go the system pref BorroweUnwantedFields
4. branchcode should cleary stand out as disabled (#cccccc)

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Katrin Fischer 2021-01-31 14:31:50 UTC
Updating this to a bug fix as I think we should not push the dependent bugs without this final style fix.
Comment 14 Jonathan Druart 2021-02-01 16:26:41 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 15 Fridolin Somers 2021-02-05 16:03:11 UTC
Pushed to 20.11.x for 20.11.03
Comment 16 Andrew Fuerste-Henry 2021-02-09 21:11:38 UTC
Missing dependency, not backporting to 20.05