You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2021/09/10 16:01:51 UTC
[whimsy] branch master updated (300b6c0 -> ce01b81)
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git.
from 300b6c0 Add summary counts
new a7833df Tidy
new ce01b81 Add summary counts
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
www/roster/public_ldap_groups.rb | 44 +++++++++++++++++++++++++---------------
1 file changed, 28 insertions(+), 16 deletions(-)
[whimsy] 01/02: Tidy
Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
commit a7833df4e0b40383e6bad5747f658509617d2f46
Author: Sebb <se...@apache.org>
AuthorDate: Fri Sep 10 16:55:35 2021 +0100
Tidy
---
www/roster/public_ldap_groups.rb | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/www/roster/public_ldap_groups.rb b/www/roster/public_ldap_groups.rb
index 041608f..8c77f3e 100644
--- a/www/roster/public_ldap_groups.rb
+++ b/www/roster/public_ldap_groups.rb
@@ -37,6 +37,7 @@ end
class MyPerson
attr_accessor :name
+
def initialize(name)
@name=name
end
@@ -72,20 +73,20 @@ groups.select{|g| EXTRAS.include? g.name}.each do |group,data|
projects[project] = []
end
-projects.keys.sort_by {|a| a.name}.each do |project|
- next unless WANTED.include? project.name
- m = []
- createTimestamp = project.createTimestamp
- modifyTimestamp = project.modifyTimestamp
- project.members.sort_by {|a| a.name}.each do |e|
- m << e.name
- end
- lastStamp = modifyTimestamp if modifyTimestamp > lastStamp
- entries[project.name] = {
- createTimestamp: createTimestamp,
- modifyTimestamp: modifyTimestamp,
- roster: m
- }
+projects.keys.sort_by(&:name).each do |project|
+ next unless WANTED.include? project.name
+ m = []
+ createTimestamp = project.createTimestamp
+ modifyTimestamp = project.modifyTimestamp
+ project.members.sort_by(&:name).each do |e|
+ m << e.name
+ end
+ lastStamp = modifyTimestamp if modifyTimestamp > lastStamp
+ entries[project.name] = {
+ createTimestamp: createTimestamp,
+ modifyTimestamp: modifyTimestamp,
+ roster: m
+ }
end
info = {
[whimsy] 02/02: Add summary counts
Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
commit ce01b818d5fea0e985c972fbe368c0ccb99bbb74
Author: Sebb <se...@apache.org>
AuthorDate: Fri Sep 10 17:01:46 2021 +0100
Add summary counts
---
www/roster/public_ldap_groups.rb | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/www/roster/public_ldap_groups.rb b/www/roster/public_ldap_groups.rb
index 8c77f3e..2d315c5 100644
--- a/www/roster/public_ldap_groups.rb
+++ b/www/roster/public_ldap_groups.rb
@@ -10,9 +10,15 @@
#
# {
# "lastTimestamp": "20160119171152Z", // most recent modifyTimestamp
+# "group_count": 123,
+# "roster_counts": {
+# "name": 1,
+# ///
+# },
# "groups": {
# "abdera": {
# "modifyTimestamp": "20111204095436Z",
+# "roster_count": 123,
# "roster": ["uid",
# ...
# ]
@@ -62,17 +68,18 @@ lastStamp = ''
# Add the non-project entries from the groups
ALREADY = projects.keys.map(&:name)
-groups.select{|g| EXTRAS.include? g.name}.each do |group,data|
+groups.select {|g| EXTRAS.include? g.name}.each do |group, data|
next if ALREADY.include?(group.name)
project = MyProject.new
project.name = group.name
project.createTimestamp = group.createTimestamp
project.modifyTimestamp = group.modifyTimestamp
- project.members = group.members.map{|p| MyPerson.new(p.name)}
+ project.members = group.members.map {|p| MyPerson.new(p.name)}
project.owners = []
projects[project] = []
end
+roster_counts = Hash.new(0)
projects.keys.sort_by(&:name).each do |project|
next unless WANTED.include? project.name
m = []
@@ -85,13 +92,17 @@ projects.keys.sort_by(&:name).each do |project|
entries[project.name] = {
createTimestamp: createTimestamp,
modifyTimestamp: modifyTimestamp,
+ roster_count: m.size,
roster: m
}
+ roster_counts[project.name] = m.size
end
info = {
# Is there a use case for the last createTimestamp ?
lastTimestamp: lastStamp,
+ group_count: entries.size,
+ roster_counts: roster_counts,
groups: entries,
}