jira-integration: Rename jiraLabelUrl to jiraLabels
Due to previous commit, this field could save a URL or a list of labels, so the name has been changed to avoid misunderstandings. FEA: ItEr77S16JiraAndTimConnectorContributionIntegration
This commit is contained in:
parent
5d439b032a
commit
25d1461263
5 changed files with 33 additions and 15 deletions
|
|
@ -37,7 +37,14 @@ public class JiraConfiguration extends BaseEntity {
|
|||
|
||||
private String jiraUrl;
|
||||
|
||||
private String jiraLabelUrl;
|
||||
/**
|
||||
* Stores one of the next 2 options:
|
||||
* <ul>
|
||||
* <li>A comma-separated list of labels</li>
|
||||
* <li>A URL that will return a comma-separated list of labels</li>
|
||||
* </ul>
|
||||
*/
|
||||
private String jiraLabels;
|
||||
|
||||
private String jiraUserId;
|
||||
|
||||
|
|
@ -67,12 +74,12 @@ public class JiraConfiguration extends BaseEntity {
|
|||
this.jiraUrl = jiraUrl;
|
||||
}
|
||||
|
||||
public String getJiraLabelUrl() {
|
||||
return jiraLabelUrl;
|
||||
public String getJiraLabels() {
|
||||
return jiraLabels;
|
||||
}
|
||||
|
||||
public void setJiraLabelUrl(String jiraLabelUrl) {
|
||||
this.jiraLabelUrl = jiraLabelUrl;
|
||||
public void setJiraLabels(String jiraLabels) {
|
||||
this.jiraLabels = jiraLabels;
|
||||
}
|
||||
|
||||
public String getJiraUserId() {
|
||||
|
|
|
|||
|
|
@ -286,4 +286,15 @@
|
|||
referencedColumnNames="id" />
|
||||
</changeSet>
|
||||
|
||||
<changeSet id="rename-column-jira_label_url-in-configuration"
|
||||
author="mrego">
|
||||
<comment>
|
||||
Rename column jira_label_url to jira_labels in configuration table
|
||||
</comment>
|
||||
<renameColumn tableName="configuration"
|
||||
oldColumnName="jira_label_url"
|
||||
newColumnName="jira_labels"
|
||||
columnDataType="VARCHAR(255)" />
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@
|
|||
<component name="jiraConfiguration" class="org.libreplan.business.common.entities.JiraConfiguration">
|
||||
<property name="jiraActivated" column="jira_activated" not-null="true"/>
|
||||
<property name="jiraUrl" column="jira_url"/>
|
||||
<property name="jiraLabelUrl" column="jira_label_url"/>
|
||||
<property name="jiraLabels" column="jira_labels"/>
|
||||
<property name="jiraUserId" column="jira_user_id"/>
|
||||
<property name="jiraPassword" column="jira_password"/>
|
||||
<many-to-one name="jiraConnectorTypeOfWorkHours" cascade="none"
|
||||
|
|
|
|||
|
|
@ -68,15 +68,15 @@ public class JiraOrderElementSynchronizer implements IJiraOrderElementSynchroniz
|
|||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<String> getAllJiraLabels() {
|
||||
String jiraLabelUrl = configurationDAO.getConfiguration()
|
||||
.getJiraConfiguration().getJiraLabelUrl();
|
||||
String jiraLabels = configurationDAO.getConfiguration()
|
||||
.getJiraConfiguration().getJiraLabels();
|
||||
|
||||
String labels;
|
||||
try {
|
||||
new URL(jiraLabelUrl);
|
||||
labels = JiraRESTClient.getAllLables(jiraLabelUrl);
|
||||
new URL(jiraLabels);
|
||||
labels = JiraRESTClient.getAllLables(jiraLabels);
|
||||
} catch (MalformedURLException e) {
|
||||
labels = jiraLabelUrl;
|
||||
labels = jiraLabels;
|
||||
}
|
||||
return Arrays.asList(StringUtils.split(labels, ","));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -430,10 +430,6 @@
|
|||
<label value="${i18n:_('JIRA URL')}" />
|
||||
<textbox id="jiraURL" value="@{configurationController.jiraConfiguration.jiraUrl}" width="300px"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('JIRA label URL')}" />
|
||||
<textbox id="jiraLabelURL" value="@{configurationController.jiraConfiguration.jiraLabelUrl}" width="300px"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('JIRA sync account')}" />
|
||||
<textbox id="jiraSyncAccount" value="@{configurationController.jiraConfiguration.jiraUserId}" width="300px"/>
|
||||
|
|
@ -442,6 +438,10 @@
|
|||
<label value="${i18n:_('JIRA sync password')}" />
|
||||
<textbox id="jiraSyncPassword" value="@{configurationController.jiraConfiguration.jiraPassword}" type="password" width="300px"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('JIRA labels: comma-separated list of labels or URL')}" />
|
||||
<textbox id="jiraLabels" value="@{configurationController.jiraConfiguration.jiraLabels}" width="300px"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('Hours type for JIRA connector')}" />
|
||||
<bandboxSearch
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue