Bug 43080 - show dialog to create room instead of empty room selection
show dialog to create room instead of empty room selection
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Computer room
UCS@school 4.1 R2
Other Linux
: P5 normal with 2 votes (vote)
: UCS@school 4.3 v4
Assigned To: Ole Schwiegert
Jürn Brodersen
:
Depends on:
Blocks: 46872
  Show dependency treegraph
 
Reported: 2016-11-30 17:30 CET by Florian Best
Modified: 2018-07-04 18:09 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 1: Cosmetic issue or missing function but workaround exists
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-11-30 17:30:18 CET
If there is no room yet and one opens the computeroom module one one need to select a room from an empty list. This is a first user experience. We should instead show a dialog which tells to create a room via the UMC module.
Comment 1 Ole Schwiegert univentionstaff 2018-03-20 14:01:12 CET
A solution has been proposed on the branch oschwieg/43080 of ucsschool.

Localization and proper messages as well as a check for privileges is still missing and needs further discussion before it would be ready for a merge.
Comment 3 Ole Schwiegert univentionstaff 2018-04-23 13:24:10 CEST
The check for privileges is now working.

Proposal for dialog texts:

Dialog Title:
There are no computer rooms available
Es sind keine Computerräume verfügbar

Dialog Text(authorized):
Do you want to create a computer room now or close the module?
Möchten Sie jetzt einen Computerraum anlegen oder das Modul schließen?

Dialog Text(not authorized):
Please contact your system administrator for the creation of computer rooms.
Bitte kontaktieren Sie ihren Administrator für die Erstellung von Computerräumen.

Buttons:
Close Module
Modul schließen

Administrate computer rooms
Computerräume administrieren
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2018-04-23 13:29:17 CEST
(In reply to Ole Schwiegert from comment #3)
> Proposal for dialog texts:
[…]
> Administrate computer rooms
> Computerräume administrieren

"Manage computer rooms"
"Computerräume verwalten"

The other suggestions are ok.
Comment 5 Ole Schwiegert univentionstaff 2018-04-23 14:06:25 CEST
Package: ucs-school-umc-computerroom
Version: 10.0.1-1A~4.3.0.201804231404
Comment 6 Daniel Tröder univentionstaff 2018-05-03 13:33:58 CEST
I have no rooms:

root@m65:~# python -c '
> import univention.admin.uldap
> from ucsschool.lib.models import ComputerRoom, School
> lo, po = univention.admin.uldap.getAdminConnection()
> for school in School.get_all(lo):
>     print school.name, ComputerRoom.get_all(lo, school.name)'

SchuleEins []

Nothing happens, when I open the "Room management" UMC module.

root@m65:~# dpkg -l ucs-school-umc-computerroom
ii  ucs-school-umc-computerr 10.0.2-1A~4.3.0.2 all
Comment 7 Ole Schwiegert univentionstaff 2018-05-08 08:17:50 CEST
This bug is concerned with the Education->computerroom module and not the school administration->room management module.
Comment 8 Daniel Tröder univentionstaff 2018-05-08 10:27:28 CEST
You are right. The computer room module does indeed now offer to redirect the user to the room management module, if no room exists.

But the room management module does not automatically start an "Add room" dialogue, when no room exists. That was the old, and desired, behavior. It can be observed for example, when opening the "Computers (schools)" module.
Comment 9 Sönke Schwardt-Krummrich univentionstaff 2018-05-14 09:26:53 CEST
(In reply to Daniel Tröder from comment #8)
> But the room management module does not automatically start an "Add room"
> dialogue, when no room exists. That was the old, and desired, behavior. It
> can be observed for example, when opening the "Computers (schools)" module.

I discussed this with Ole. He will add this feature to the room management module, too.
Comment 10 Ole Schwiegert univentionstaff 2018-05-16 08:35:03 CEST
Instead of reimplementing this feature in the context of this bug (it is already working in the schoolwizards module), maybe we should work on Bug#35621 since resolving that automatically adds the desired feature to the room management
Comment 11 Ole Schwiegert univentionstaff 2018-05-30 09:33:41 CEST
src: ucs-school-umc-rooms
fix: 15.0.1-1A~4.3.0.201805300927

src: ucs-school-umc-computerroom
fix: 10.0.2-3A~4.3.0.201805300926

The implemented behavior is now the following:

If the user opens the rooms module and the list of rooms for the chosen school is empty, a dialog asking for room creation is shown. Dialog also appears if user switches school and list is also empty

If a user opens the computerroom module and there are no computerrooms present there are two possibilities:
1.) The user is school admin and hence is asked if he wants to create a room or close the module
2.) The user is no school admin and is told to ask the admin for further instructions. Module is closed.

Deciding to create a room in (1) opens the rooms module and automatically opens the room creation wizard as well.

In the edge case that a user has access to multiple schools in the computerroom module the behavior is unchanged and he is shown the list of schools and rooms, even if there are no rooms available. (Decided in discussion with Sönke)
Comment 12 Jürn Brodersen univentionstaff 2018-06-05 17:20:40 CEST
Wrong translation:
267 msgid "Manage computer rooms"
268 msgstr "Computerraum auswählen" -> Computerräume bearbeiten

Could you add a check in the callback for the okButton if the form is valid? Currently an undefined error is thrown (only visible on the js console) in case no valid room is set.

form.isValid() or just checking if "room" is not undefined should do the trick.


Note: setting a non valid school opens an error dialog, see bug 47139.
Comment 13 Ole Schwiegert univentionstaff 2018-06-06 09:08:33 CEST
src: ucs-school-umc-computerroom
fix: 10.0.2-5A~4.3.0.201806060904

The forms submit button is now disabled as long as there is no valid room selected in the combobox.

Translation fixed.
Comment 14 Jürn Brodersen univentionstaff 2018-06-06 14:14:29 CEST
Sorry I missed these the last time, there are still some missing translations in the rooms (not computerrooms) module.

In the dialog that pops up if no rooms exist

'''
No rooms found
No rooms were found. Would you like to create a room now?
Create
'''

Otherwise it looks good :)
Comment 15 Ole Schwiegert univentionstaff 2018-06-07 08:34:10 CEST
No surprise since I completely forgot to add any translations to that module. Thanks! Changed Create to Add room to fit existing wording and added missing translations

src: ucs-school-umc-rooms
fix: 15.0.1-2A~4.3.0.201806070831
Comment 16 Jürn Brodersen univentionstaff 2018-06-08 17:17:34 CEST
OK
looks good now :)

-> Verified
Comment 17 Sönke Schwardt-Krummrich univentionstaff 2018-07-04 18:09:00 CEST
UCS@school 4.3 v4 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.3v4-de.html

If this error occurs again, please clone this bug.