Skip to content

Commit

Permalink
Merge pull request #8093 from 4teamwork/amo/TI-1476/Groups-membership…
Browse files Browse the repository at this point in the history
…-export-followup

Modify excel export data
  • Loading branch information
Abdu-moustafa authored Nov 26, 2024
2 parents 9158581 + aa80d5b commit b30c334
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 66 deletions.
16 changes: 8 additions & 8 deletions opengever/globalindex/browser/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ def check_permissions(self):
@property
def _columns(self):
return [
{'id': 'username', 'title': _('label_username')},
{'id': 'userid', 'title': _('label_userid')},
{'id': 'group_title', 'title': _('label_groupname')},
{'id': 'group_id', 'title': _('label_groupid')},
{'id': 'user_name', 'title': _('label_username')},
{'id': 'user_fullname', 'title': _('label_fullname')},
{'id': 'group_title', 'title': _('label_group_title')},
{'id': 'group_name', 'title': _('label_groupname')},

]

Expand All @@ -192,10 +192,10 @@ def __call__(self):
for group in query.all():
for user in group.users:
group_info = {
'group_id': group.groupid,
'group_title': group.groupname,
'userid': user.userid,
"username": user.username
'group_name': group.groupname,
'group_title': group.title,
"user_name": user.username,
"user_fullname": user.fullname()
}
groups_with_users.append(group_info)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-11-12 10:32+0000\n"
"POT-Creation-Date: 2024-11-25 15:08+0000\n"
"PO-Revision-Date: 2016-07-22 15:25+0000\n"
"Last-Translator: Philippe Gross <[email protected]>\n"
"Language-Team: German <https://translations.onegovgever.ch/projects/onegov-gever/opengever-globalindex/de/>\n"
Expand Down Expand Up @@ -99,8 +99,12 @@ msgid "label_firstname"
msgstr "Vorname"

#: ./opengever/globalindex/browser/report.py
msgid "label_groupid"
msgstr "Gruppen-ID"
msgid "label_fullname"
msgstr "Name"

#: ./opengever/globalindex/browser/report.py
msgid "label_group_title"
msgstr "Gruppenbezeichnung"

#: ./opengever/globalindex/browser/report.py
msgid "label_groupname"
Expand Down Expand Up @@ -177,10 +181,6 @@ msgstr "Titel"
msgid "label_url"
msgstr "URL"

#: ./opengever/globalindex/browser/report.py
msgid "label_userid"
msgstr "Benutzer-ID"

#: ./opengever/globalindex/browser/report.py
msgid "label_username"
msgstr "Benutzername"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-11-12 10:32+0000\n"
"POT-Creation-Date: 2024-11-25 15:08+0000\n"
"PO-Revision-Date: 2016-07-22 15:25+0000\n"
"Last-Translator: Philippe Gross <[email protected]>\n"
"Language-Team: German <https://translations.onegovgever.ch/projects/onegov-gever/opengever-globalindex/de/>\n"
Expand Down Expand Up @@ -105,8 +105,12 @@ msgid "label_firstname"
msgstr "First name"

#: ./opengever/globalindex/browser/report.py
msgid "label_groupid"
msgstr "Group-ID"
msgid "label_fullname"
msgstr "Name"

#: ./opengever/globalindex/browser/report.py
msgid "label_group_title"
msgstr "Group title"

#: ./opengever/globalindex/browser/report.py
msgid "label_groupname"
Expand Down Expand Up @@ -191,10 +195,6 @@ msgstr "Title"
msgid "label_url"
msgstr "URL"

#: ./opengever/globalindex/browser/report.py
msgid "label_userid"
msgstr "User-ID"

#: ./opengever/globalindex/browser/report.py
msgid "label_username"
msgstr "Username"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-11-12 10:32+0000\n"
"POT-Creation-Date: 2024-11-25 15:08+0000\n"
"PO-Revision-Date: 2017-12-03 09:48+0000\n"
"Last-Translator: Jacqueline Sposato <[email protected]>\n"
"Language-Team: French <https://translations.onegovgever.ch/projects/onegov-gever/opengever-globalindex/fr/>\n"
Expand Down Expand Up @@ -99,8 +99,12 @@ msgid "label_firstname"
msgstr "Prénom"

#: ./opengever/globalindex/browser/report.py
msgid "label_groupid"
msgstr "ID de groupe"
msgid "label_fullname"
msgstr "Nom"

#: ./opengever/globalindex/browser/report.py
msgid "label_group_title"
msgstr "Titre du groupe"

#: ./opengever/globalindex/browser/report.py
msgid "label_groupname"
Expand Down Expand Up @@ -177,10 +181,6 @@ msgstr "Titre"
msgid "label_url"
msgstr "URL"

#: ./opengever/globalindex/browser/report.py
msgid "label_userid"
msgstr "ID utilisateur"

#: ./opengever/globalindex/browser/report.py
msgid "label_username"
msgstr "Nom d'utilisateur"
Expand Down
12 changes: 6 additions & 6 deletions opengever/globalindex/locales/opengever.globalindex.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-11-12 10:32+0000\n"
"POT-Creation-Date: 2024-11-25 15:08+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -100,7 +100,11 @@ msgid "label_firstname"
msgstr ""

#: ./opengever/globalindex/browser/report.py
msgid "label_groupid"
msgid "label_fullname"
msgstr ""

#: ./opengever/globalindex/browser/report.py
msgid "label_group_title"
msgstr ""

#: ./opengever/globalindex/browser/report.py
Expand Down Expand Up @@ -178,10 +182,6 @@ msgstr ""
msgid "label_url"
msgstr ""

#: ./opengever/globalindex/browser/report.py
msgid "label_userid"
msgstr ""

#: ./opengever/globalindex/browser/report.py
msgid "label_username"
msgstr ""
Expand Down
61 changes: 30 additions & 31 deletions opengever/globalindex/tests/test_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,44 +321,43 @@ def test_groups_membership_report(self, browser):

# Check the headers/columns in the Excel sheet
self.assertSequenceEqual(
['Username', 'User-ID', 'Group name', 'Group-ID'],
[u'Username', u'Name', u'Group title', u'Group name'],
[cell.value for cell in list(workbook.active.rows)[0]]
)

# Get the rows (skip the first row which contains headers)
rows = list(workbook.active.rows)[1:]
expected_values = [
[u'kathi.barfuss', u'regular_user', u'fa_users', u'fa_users'],
[u'jurgen.fischer', u'archivist', u'fa_users', u'fa_users'],
[u'ramon.flucht', u'records_manager', u'fa_users', u'fa_users'],
[u'gunther.frohlich', u'gunther.frohlich', u'fa_users', u'fa_users'],
[u'faivel.fruhling', u'dossier_manager', u'fa_users', u'fa_users'],
[u'fridolin.hugentobler', u'fridolin.hugentobler', u'fa_users', u'fa_users'],
[u'maja.harzig', u'limited_admin', u'fa_users', u'fa_users'],
[u'herbert.jager', u'meeting_user', u'fa_users', u'fa_users'],
[u'nicole.kohler', u'nicole.kohler', u'fa_users', u'fa_users'],
[u'jurgen.konig', u'jurgen.konig', u'fa_users', u'fa_users'],
[u'propertysheets.manager', u'propertysheets_manager', u'fa_users', u'fa_users'],
[u'webaction.manager', u'webaction_manager', u'fa_users', u'fa_users'],
[u'david.meier', u'member_admin', u'fa_users', u'fa_users'],
[u'franzi.muller', u'committee_responsible', u'fa_users', u'fa_users'],
[u'hans.peter', u'hans.peter', u'fa_users', u'fa_users'],
[u'beatrice.schrodinger', u'beatrice.schrodinger', u'fa_users', u'fa_users'],
[u'committee.secretary', u'committee.secretary', u'fa_users', u'fa_users'],
[u'service.user', u'service_user', u'fa_users', u'fa_users'],
[u'robert.ziegler', u'robert.ziegler', u'fa_users', u'fa_users'],
[u'kathi.barfuss', u'regular_user', u'projekt_a', u'projekt_a'],
[u'robert.ziegler', u'robert.ziegler', u'projekt_a', u'projekt_a'],
[u'james.bond', u'james.bond', u'rk_users', u'rk_users'],
[u'herbert.jager', u'meeting_user', u'projekt_b', u'projekt_b'],
[u'franzi.muller', u'committee_responsible', u'projekt_b', u'projekt_b'],
[u'nicole.kohler', u'nicole.kohler', u'committee_rpk_group', u'committee_rpk_group'],
[u'franzi.muller', u'committee_responsible', u'committee_rpk_group', u'committee_rpk_group'],
[u'nicole.kohler', u'nicole.kohler', u'committee_ver_group', u'committee_ver_group'],
[u'franzi.muller', u'committee_responsible', u'committee_ver_group', u'committee_ver_group'],
[u'jurgen.konig', u'jurgen.konig', u'fa_inbox_users', u'fa_inbox_users']
[u'kathi.barfuss', u'B\xe4rfuss K\xe4thi', u'fa Users Group', u'fa_users'],
[u'jurgen.fischer', u'Fischer J\xfcrgen', u'fa Users Group', u'fa_users'],
[u'ramon.flucht', u'Flucht Ramon', u'fa Users Group', u'fa_users'],
[u'gunther.frohlich', u'Fr\xf6hlich G\xfcnther', u'fa Users Group', u'fa_users'],
[u'faivel.fruhling', u'Fr\xfchling F\xe4ivel', u'fa Users Group', u'fa_users'],
[u'fridolin.hugentobler', u'Hugentobler Fridolin', u'fa Users Group', u'fa_users'],
[u'maja.harzig', u'H\xe4rzig Maja', u'fa Users Group', u'fa_users'],
[u'herbert.jager', u'J\xe4ger Herbert', u'fa Users Group', u'fa_users'],
[u'nicole.kohler', u'Kohler Nicole', u'fa Users Group', u'fa_users'],
[u'jurgen.konig', u'K\xf6nig J\xfcrgen', u'fa Users Group', u'fa_users'],
[u'propertysheets.manager', u'Manager PropertySheets', u'fa Users Group', u'fa_users'],
[u'webaction.manager', u'Manager WebAction', u'fa Users Group', u'fa_users'],
[u'david.meier', u'Meier David', u'fa Users Group', u'fa_users'],
[u'franzi.muller', u'M\xfcller Fr\xe4nzi', u'fa Users Group', u'fa_users'],
[u'hans.peter', u'Peter Hans', u'fa Users Group', u'fa_users'],
[u'beatrice.schrodinger', u'Schr\xf6dinger B\xe9atrice', u'fa Users Group', u'fa_users'],
[u'committee.secretary', u'Secretary C\xf6mmittee', u'fa Users Group', u'fa_users'],
[u'service.user', u'User Service', u'fa Users Group', u'fa_users'],
[u'robert.ziegler', u'Ziegler Robert', u'fa Users Group', u'fa_users'],
[u'kathi.barfuss', u'B\xe4rfuss K\xe4thi', u'Projekt A', u'projekt_a'],
[u'robert.ziegler', u'Ziegler Robert', u'Projekt A', u'projekt_a'],
[u'james.bond', u'B\xf6nd James', u'rk Users Group', u'rk_users'],
[u'herbert.jager', u'J\xe4ger Herbert', u'Projekt B', u'projekt_b'],
[u'franzi.muller', u'M\xfcller Fr\xe4nzi', u'Projekt B', u'projekt_b'],
[u'nicole.kohler', u'Kohler Nicole', u'Gruppe Rechnungspr\xfcfungskommission', u'committee_rpk_group'],
[u'franzi.muller', u'M\xfcller Fr\xe4nzi', u'Gruppe Rechnungspr\xfcfungskommission', u'committee_rpk_group'],
[u'nicole.kohler', u'Kohler Nicole', u'Gruppe Kommission f\xfcr Verkehr', u'committee_ver_group'],
[u'franzi.muller', u'M\xfcller Fr\xe4nzi', u'Gruppe Kommission f\xfcr Verkehr', u'committee_ver_group'],
[u'jurgen.konig', u'K\xf6nig J\xfcrgen', u'fa Inbox Users Group', u'fa_inbox_users']
]

for row, expected_row in zip(rows, expected_values):
self.assertSequenceEqual(
expected_row,
Expand Down

0 comments on commit b30c334

Please sign in to comment.