From 476269d2f2e010022cf9e7cb9cea968f80794a3b Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 12 Oct 2012 18:11:41 -0400 Subject: [PATCH] Implemented Manager support for team roles and verify committer --- .../gitblit/client/EditRepositoryDialog.java | 8 +++++++- src/com/gitblit/client/EditTeamDialog.java | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/com/gitblit/client/EditRepositoryDialog.java b/src/com/gitblit/client/EditRepositoryDialog.java index 840281bd..e15b1546 100644 --- a/src/com/gitblit/client/EditRepositoryDialog.java +++ b/src/com/gitblit/client/EditRepositoryDialog.java @@ -108,6 +108,8 @@ public class EditRepositoryDialog extends JDialog { private JCheckBox allowForks; + private JCheckBox verifyCommitter; + private JComboBox federationStrategy; private JComboBox ownerField; @@ -231,7 +233,8 @@ public class EditRepositoryDialog extends JDialog { authorizationPanel.add(allowAuthenticated); authorizationPanel.add(allowNamed); - allowForks = new JCheckBox(Translation.get("gb.allowForks"), anRepository.allowForks); + allowForks = new JCheckBox(Translation.get("gb.allowForksDescription"), anRepository.allowForks); + verifyCommitter = new JCheckBox(Translation.get("gb.verifyCommitterDescription"), anRepository.verifyCommitter); // federation strategies - remove ORIGIN choice if this repository has // no origin. @@ -274,6 +277,8 @@ public class EditRepositoryDialog extends JDialog { .add(newFieldPanel(Translation.get("gb.isFrozen"), isFrozen)); clonePushPanel .add(newFieldPanel(Translation.get("gb.allowForks"), allowForks)); + clonePushPanel + .add(newFieldPanel(Translation.get("gb.verifyCommitter"), verifyCommitter)); usersPalette = new JPalette(); JPanel northAccessPanel = new JPanel(new BorderLayout(5, 5)); @@ -484,6 +489,7 @@ public class EditRepositoryDialog extends JDialog { repository.isFrozen = isFrozen.isSelected(); repository.allowForks = allowForks.isSelected(); + repository.verifyCommitter = verifyCommitter.isSelected(); String ml = mailingListsField.getText(); if (!StringUtils.isEmpty(ml)) { diff --git a/src/com/gitblit/client/EditTeamDialog.java b/src/com/gitblit/client/EditTeamDialog.java index 2f9796ce..57d6bcfb 100644 --- a/src/com/gitblit/client/EditTeamDialog.java +++ b/src/com/gitblit/client/EditTeamDialog.java @@ -33,6 +33,7 @@ import java.util.Set; import javax.swing.ImageIcon; import javax.swing.JButton; +import javax.swing.JCheckBox; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JLabel; @@ -64,6 +65,12 @@ public class EditTeamDialog extends JDialog { private boolean canceled = true; private JTextField teamnameField; + + private JCheckBox canAdminCheckbox; + + private JCheckBox canForkCheckbox; + + private JCheckBox canCreateCheckbox; private JTextField mailingListsField; @@ -115,11 +122,19 @@ public class EditTeamDialog extends JDialog { private void initialize(int protocolVersion, TeamModel aTeam) { teamnameField = new JTextField(aTeam.name == null ? "" : aTeam.name, 25); + canAdminCheckbox = new JCheckBox(Translation.get("gb.canAdminDescription"), aTeam.canAdmin); + canForkCheckbox = new JCheckBox(Translation.get("gb.canForkDescription"), aTeam.canFork); + canCreateCheckbox = new JCheckBox(Translation.get("gb.canCreateDescription"), aTeam.canCreate); + mailingListsField = new JTextField(aTeam.mailingLists == null ? "" : StringUtils.flattenStrings(aTeam.mailingLists, " "), 50); JPanel fieldsPanel = new JPanel(new GridLayout(0, 1)); fieldsPanel.add(newFieldPanel(Translation.get("gb.teamName"), teamnameField)); + fieldsPanel.add(newFieldPanel(Translation.get("gb.canAdmin"), canAdminCheckbox)); + fieldsPanel.add(newFieldPanel(Translation.get("gb.canFork"), canForkCheckbox)); + fieldsPanel.add(newFieldPanel(Translation.get("gb.canCreate"), canCreateCheckbox)); + fieldsPanel.add(newFieldPanel(Translation.get("gb.mailingLists"), mailingListsField)); final Insets _insets = new Insets(5, 5, 5, 5); @@ -246,6 +261,10 @@ public class EditTeamDialog extends JDialog { } team.name = tname; + team.canAdmin = canAdminCheckbox.isSelected(); + team.canFork = canForkCheckbox.isSelected(); + team.canCreate = canCreateCheckbox.isSelected(); + String ml = mailingListsField.getText(); if (!StringUtils.isEmpty(ml)) { Set list = new HashSet(); -- 2.39.5