Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge branch 'master' into ZNTA-872
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed May 24, 2016
2 parents bf04457 + 6065cb3 commit 27e7b4f
Show file tree
Hide file tree
Showing 20 changed files with 624 additions and 81 deletions.
68 changes: 52 additions & 16 deletions docs/release-notes.md
Expand Up @@ -10,6 +10,9 @@
* (/user-guide/system-admin/configuration/document-storage-directory)
<h5>New feature</h5>
* [ZNTA-746](https://zanata.atlassian.net/browse/ZNTA-746) - Add shorcut key for approve and reject translation
<h5>New Features</h5>
* [ZNTA-1059](https://zanata.atlassian.net/browse/ZNTA-1059) - Language coordinator can contact team members


-----------------------

Expand Down Expand Up @@ -37,25 +40,58 @@
...
</profiles>

##### Changes
* [ZNTA-1067](https://zanata.atlassian.net/browse/ZNTA-1067) - Kerberos ticket authentication leads to mostly blank page
* [ZNTA-1017](https://zanata.atlassian.net/browse/ZNTA-1017) - Refactor translation update event to use batches
* [ZNTA-958](https://zanata.atlassian.net/browse/ZNTA-958) - Integrate sidebar
* [ZNTA-957](https://zanata.atlassian.net/browse/ZNTA-957) - User profile
* [ZNTA-956](https://zanata.atlassian.net/browse/ZNTA-956) - Migrate glossary to redux
* [ZNTA-939](https://zanata.atlassian.net/browse/ZNTA-939) - Update to WildFly 10 (ready for EAP 7)
* [ZNTA-905](https://zanata.atlassian.net/browse/ZNTA-905) - 0% matching translation listed in TM
* [ZNTA-894](https://zanata.atlassian.net/browse/ZNTA-894) - dswid is not unique after opening link in new tab (in projects list)
* [ZNTA-892](https://zanata.atlassian.net/browse/ZNTA-892) - Performance tests for REST in Jenkins
* [ZNTA-887](https://zanata.atlassian.net/browse/ZNTA-887) - Conversation scope message not displaying
* [ZNTA-879](https://zanata.atlassian.net/browse/ZNTA-879) - Display user email based on admin configuration
* [ZNTA-833](https://zanata.atlassian.net/browse/ZNTA-833) - Reduce JS runtime warnings and errors
* [ZNTA-797](https://zanata.atlassian.net/browse/ZNTA-797) - Replace SeamAutowire with real CDI in tests
* [ZNTA-793](https://zanata.atlassian.net/browse/ZNTA-793) - TranslationMemoryAction.lastTaskResult appears to be useless
* [ZNTA-744](https://zanata.atlassian.net/browse/ZNTA-744) - Add review data to the contribution statistics API
* [ZNTA-742](https://zanata.atlassian.net/browse/ZNTA-742) - Get a list of contributors for a Project version via the API
* [ZNTA-699](https://zanata.atlassian.net/browse/ZNTA-699) - Migrate page navigation flow from Seam pages.xml to faces-config.xml
* [ZNTA-684](https://zanata.atlassian.net/browse/ZNTA-684) - Migrate suggestions panel from AngularJS to ReactJS

##### Bug Fixes
* [ZNTA-804](https://zanata.atlassian.net/browse/ZNTA-804) - Coordinators' email addresses should be BCC in Contact Coordinator
* [ZNTA-693](https://zanata.atlassian.net/browse/ZNTA-693) - Handle ClientAbortException exception and reduce severity.
* [ZNTA-742](https://zanata.atlassian.net/browse/ZNTA-742) - Get a list of contributors for a Project version via the API
* [ZNTA-744](https://zanata.atlassian.net/browse/ZNTA-744) - Add review data to the contribution statistics API
* [ZNTA-879](https://zanata.atlassian.net/browse/ZNTA-879) - Allow admin to configure the visibility of user email
* [ZNTA-412](https://zanata.atlassian.net/browse/ZNTA-412) - Profile link to project maintainers, language members, and version group maintainers
* [ZNTA-905](https://zanata.atlassian.net/browse/ZNTA-905) - Remove 0% matching translation memory entry
* [ZNTA-928](https://zanata.atlassian.net/browse/ZNTA-928) - Readonly project doesn't have "lock" icon in UI
* [ZNTA-54](https://zanata.atlassian.net/browse/ZNTA-54) - Allow delete language
* [ZNTA-1066](https://zanata.atlassian.net/browse/ZNTA-1066) - Delete project still indicates "Obsolete" in the notification
* [ZNTA-1068](https://zanata.atlassian.net/browse/ZNTA-1068) - Refresh page after adding language in project page
* [ZNTA-1074](https://zanata.atlassian.net/browse/ZNTA-1074) - Hide notification details section
* [ZNTA-1065](https://zanata.atlassian.net/browse/ZNTA-1065) - Drop-down user menu does not obscure the Glossary buttons
* [ZNTA-1086](https://zanata.atlassian.net/browse/ZNTA-1086) - NullPointerException when uploading from client (tested with cs-CZ)

* [ZNTA-981](https://zanata.atlassian.net/browse/ZNTA-981) - Remove file extension for gettext project file type
* [ZNTA-1120](https://zanata.atlassian.net/browse/ZNTA-1120) - Rest endpoint broken for alpha editor
* [ZNTA-1086](https://zanata.atlassian.net/browse/ZNTA-1086) - NullPointerException when uploading from client (tested with cs-CZ)
* [ZNTA-1084](https://zanata.atlassian.net/browse/ZNTA-1084) - NoSuchElementException when uploading empty data
* [ZNTA-1081](https://zanata.atlassian.net/browse/ZNTA-1081) - Should use @Synchronized for @SessionScoped beans
* [ZNTA-1074](https://zanata.atlassian.net/browse/ZNTA-1074) - Glossary blurts entire exception stacktrace to user dialog
* [ZNTA-1072](https://zanata.atlassian.net/browse/ZNTA-1072) - [Regression] Cannot set multiple roles for a user
* [ZNTA-1068](https://zanata.atlassian.net/browse/ZNTA-1068) - Adding multiple languages to a project does not update the page
* [ZNTA-1066](https://zanata.atlassian.net/browse/ZNTA-1066) - Delete project still indicates "Obsolete" in the notification
* [ZNTA-1065](https://zanata.atlassian.net/browse/ZNTA-1065) - Drop-down user menu does not obscure the Glossary buttons
* [ZNTA-1060](https://zanata.atlassian.net/browse/ZNTA-1060) - Unable to upload translations on Wildfly 10
* [ZNTA-1013](https://zanata.atlassian.net/browse/ZNTA-1013) - Merge translation triggers exception when creating new TextFlowTarget
* [ZNTA-991](https://zanata.atlassian.net/browse/ZNTA-991) - Cannot change email addresses in app config (ClassNotFoundException)
* [ZNTA-981](https://zanata.atlassian.net/browse/ZNTA-981) - Uploading a .pot file via Web UI retains the extension
* [ZNTA-931](https://zanata.atlassian.net/browse/ZNTA-931) - Reset password feature fails on session closed
* [ZNTA-928](https://zanata.atlassian.net/browse/ZNTA-928) - Readonly project doesn't have "lock" icon in UI
* [ZNTA-871](https://zanata.atlassian.net/browse/ZNTA-871) - Changing user email address redirects to invalid page
* [ZNTA-870](https://zanata.atlassian.net/browse/ZNTA-870) - Reset Password feature not inserting key into database
* [ZNTA-850](https://zanata.atlassian.net/browse/ZNTA-850) - org.zanata.async.AsyncTaskManager: Exception when executing an asynchronous task.
* [ZNTA-804](https://zanata.atlassian.net/browse/ZNTA-804) - Coordinators' email addresses should be BCC in Contact Coordinator
* [ZNTA-693](https://zanata.atlassian.net/browse/ZNTA-693) - ClientAbortException: java.net.SocketException: Connection reset
* [ZNTA-668](https://zanata.atlassian.net/browse/ZNTA-668) - ServerConfiguration tests unstable
* [ZNTA-537](https://zanata.atlassian.net/browse/ZNTA-537) - Expired sessions have poor usability
* [ZNTA-470](https://zanata.atlassian.net/browse/ZNTA-470) - RFE: Prevent user sending large text in 'contact admin' emails
* [ZNTA-412](https://zanata.atlassian.net/browse/ZNTA-412) - RFE: Link displayed usernames to profile page
* [ZNTA-393](https://zanata.atlassian.net/browse/ZNTA-393) - Redirect to a "good" page if URL is not known to zanata
* [ZNTA-358](https://zanata.atlassian.net/browse/ZNTA-358) - Unable to sign up with user specified OpenID
* [ZNTA-54](https://zanata.atlassian.net/browse/ZNTA-54) - Can't remove languages
* [ZNTA-12](https://zanata.atlassian.net/browse/ZNTA-12) - User cannot send two messages to admin in a row

-----------------------

## 3.8.4
##### Changes
* [ZNTA-1000](https://zanata.atlassian.net/browse/ZNTA-1000) - Try catch finally on copy version action, logging exception
Expand Down
81 changes: 55 additions & 26 deletions zanata-test-war/pom.xml
Expand Up @@ -26,11 +26,25 @@
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
<!--<exclusions>-->
<!--<exclusion>-->
<!--<groupId>*</groupId>-->
<!--<artifactId>*</artifactId>-->
<!--</exclusion>-->
<!--</exclusions>-->
</dependency>

<dependency>
<groupId>org.apache.deltaspike.modules</groupId>
<artifactId>deltaspike-jpa-module-api</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -48,6 +62,12 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-orm</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -67,14 +87,42 @@
<groupId>com.github.huangp</groupId>
<artifactId>entityunit</artifactId>
<version>0.3</version>
<exclusions>
<exclusion>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</exclusion>
<exclusion>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</exclusion>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.zanata</groupId>
<artifactId>zanata-model</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>jaxrs-api</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
Expand All @@ -87,35 +135,16 @@
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.jboss.resteasy</groupId>
<artifactId>jaxrs-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-multipart-provider</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
</exclusion>
<exclusion>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<scope>provided</scope>
</dependency>

<!-- the war itself. See zanata-war pom.xml dependency:copy -->
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion zanata-war/pom.xml
Expand Up @@ -1612,7 +1612,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>${hibernate.scope}</scope>
<scope>compile</scope>
</dependency>

<!--<dependency>-->
Expand Down
@@ -0,0 +1,157 @@
/*
* Copyright 2016, Red Hat, Inc. and individual contributors as indicated by the
* @author tags. See the copyright.txt file in the distribution for a full
* listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
* site: http://www.fsf.org.
*/

package org.zanata.action;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

import org.apache.commons.lang.StringUtils;
import org.zanata.ApplicationConfiguration;
import org.zanata.common.LocaleId;
import org.zanata.dao.LocaleMemberDAO;
import org.zanata.email.ContactLanguageTeamMembersEmailStrategy;
import org.zanata.email.EmailStrategy;
import org.zanata.i18n.Messages;
import org.zanata.model.HAccount;
import org.zanata.model.HLocale;
import org.zanata.model.HLocaleMember;
import org.zanata.security.annotations.Authenticated;
import org.zanata.security.annotations.CheckLoggedIn;
import org.zanata.service.EmailService;
import org.zanata.service.LocaleService;
import org.zanata.ui.faces.FacesMessages;

import javax.inject.Inject;
import javax.inject.Named;
import java.io.Serializable;
import java.util.List;

import com.google.common.collect.Lists;

/**
* @author Alex Eng <a href="mailto:aeng@redhat.com">aeng@redhat.com</a>
*/

@Named("contactLanguageTeamMembersAction")
@javax.faces.bean.ViewScoped

@Slf4j
public class ContactLanguageTeamMembersAction implements Serializable {

@Inject
@Authenticated
private HAccount authenticatedAccount;

@Inject
private FacesMessages facesMessages;

@Inject
private EmailService emailServiceImpl;

@Inject
private LocaleService localeServiceImpl;

@Inject
private Messages msgs;

@Inject
private ApplicationConfiguration applicationConfiguration;

@Inject
private LocaleMemberDAO localeMemberDAO;

@Getter
@Setter
private String message;

@Getter
@Setter
private String subject;

@Getter
@Setter
private String localeId;

private HLocale locale;

public List<HLocaleMember> getMembers() {
if(StringUtils.isBlank(localeId)) {
return Lists.newArrayList();
}
if (authenticatedAccount == null) {
return localeMemberDAO.findAllActiveMembers(new LocaleId(localeId));
}
return localeMemberDAO.findActiveMembers(new LocaleId(localeId),
authenticatedAccount.getPerson());
}

@CheckLoggedIn
public void send() {
List<HLocaleMember> members = getMembers();
if(!members.isEmpty()) {
String fromName = authenticatedAccount.getPerson().getName();
String fromLoginName = authenticatedAccount.getUsername();
String replyEmail = authenticatedAccount.getPerson().getEmail();
String contactCoordinatorLink =
applicationConfiguration.getServerPath() +
"/language/view/" + localeId;

String localeNativeName = getLocale().retrieveNativeName();

EmailStrategy strategy =
new ContactLanguageTeamMembersEmailStrategy(
fromLoginName, fromName, replyEmail,
getSubject(),
getLocale().getLocaleId().getId(),
localeNativeName, message, contactCoordinatorLink);
try {
String msg = emailServiceImpl.sendToLanguageTeamMembers(
getLocale().getLocaleId(), strategy, members);
facesMessages.addGlobal(msg);
} catch (Exception e) {
String subject = strategy.getSubject(msgs);

StringBuilder sb =
new StringBuilder()
.append("Failed to send email with subject '")
.append(strategy.getSubject(msgs))
.append("' , message '").append(message)
.append("'");
log.error(
"Failed to send email: fromName '{}', fromLoginName '{}', replyEmail '{}', subject '{}', message '{}'. {}",
fromName, fromLoginName, replyEmail, subject, message, e);
facesMessages.addGlobal(sb.toString());
} finally {
message = null;
subject = null;
}
}
}

public HLocale getLocale() {
if (locale == null) {
locale = localeServiceImpl.getByLocaleId(new LocaleId(localeId));
}
return locale;
}
}
Expand Up @@ -276,7 +276,7 @@ public HLocale getLocale() {
* to access the 'members' collection from inside the security
* listener's postLoad method to evaluate rules.
*/
if(locale == null) {
if(locale == null && StringUtils.isNotBlank(language)) {
locale = localeServiceImpl.getByLocaleId(new LocaleId(language));
locale.getMembers();
}
Expand Down
Expand Up @@ -656,6 +656,7 @@ public void setRestrictedByRole(String key, boolean checked) {
update();
}

@Transactional
public void setInviteOnly(boolean inviteOnly) {
identity.checkPermission(getInstance(), "update");
getInstance().setAllowGlobalTranslation(!inviteOnly);
Expand Down

0 comments on commit 27e7b4f

Please sign in to comment.