Skip to content
Snippets Groups Projects
Commit 879066b5 authored by John's avatar John
Browse files

Merge branch 'develop' into 'develop'

Issue #233 - Support confidential issue creation

See merge request !21
parents 55f997b7 70f0c8ed
No related branches found
No related tags found
1 merge request!21Issue #233 - Support confidential issue creation
Pipeline #
Loading
Loading
@@ -8,6 +8,7 @@ import android.os.Parcelable
import android.support.design.widget.Snackbar
import android.support.design.widget.TextInputLayout
import android.support.v7.app.AlertDialog
import android.support.v7.widget.SwitchCompat
import android.support.v7.widget.Toolbar
import android.text.TextUtils
import android.view.View
Loading
Loading
@@ -87,6 +88,8 @@ class AddIssueActivity : MorphActivity() {
lateinit var rootAddLabels: ViewGroup
@BindView(R.id.list_labels)
lateinit var listLabels: AdapterFlowLayout
@BindView(R.id.confidential_switch)
lateinit var switchConfidential: SwitchCompat
 
lateinit var adapterLabels: AddIssueLabelAdapter
lateinit var teleprinter: Teleprinter
Loading
Loading
@@ -239,6 +242,7 @@ class AddIssueActivity : MorphActivity() {
if (!TextUtils.isEmpty(issue!!.description)) {
textDescription.setText(issue!!.description)
}
switchConfidential.isChecked = issue!!.isConfidential
}
 
private fun setAssignees() {
Loading
Loading
@@ -324,14 +328,15 @@ class AddIssueActivity : MorphActivity() {
textDescription.text.toString(),
assigneeId,
milestoneId,
labelsCommaSeperated)
labelsCommaSeperated,
switchConfidential.isChecked)
} else {
textInputLayoutTitle.error = getString(R.string.required_field)
}
}
 
private fun createOrSaveIssue(title: String, description: String, assigneeId: Long?,
milestoneId: Long?, labels: String?) {
milestoneId: Long?, labels: String?, isConfidential: Boolean) {
if (issue == null) {
observeUpdate(App.get().gitLab.createIssue(
project.id,
Loading
Loading
@@ -339,7 +344,8 @@ class AddIssueActivity : MorphActivity() {
description,
assigneeId,
milestoneId,
labels))
labels,
isConfidential))
} else {
observeUpdate(App.get().gitLab.updateIssue(project.id,
issue!!.id,
Loading
Loading
@@ -347,7 +353,8 @@ class AddIssueActivity : MorphActivity() {
description,
assigneeId,
milestoneId,
labels))
labels,
isConfidential))
}
}
 
Loading
Loading
Loading
Loading
@@ -252,7 +252,8 @@ interface GitLab {
@Field("description") description: String,
@Field("assignee_id") assigneeId: Long?,
@Field("milestone_id") milestoneId: Long?,
@Field("labels") commaSeparatedLabelNames: String?): Single<Issue>
@Field("labels") commaSeparatedLabelNames: String?,
@Field("confidential") isConfidential: Boolean): Single<Issue>
 
@PUT(API_VERSION + "/projects/{id}/issues/{issue_id}")
fun updateIssue(@Path("id") projectId: Long,
Loading
Loading
@@ -261,7 +262,8 @@ interface GitLab {
@Query("description") description: String,
@Query("assignee_id") assigneeId: Long?,
@Query("milestone_id") milestoneId: Long?,
@Query("labels") commaSeparatedLabelNames: String?): Single<Issue>
@Query("labels") commaSeparatedLabelNames: String?,
@Query("confidential") isConfidential: Boolean): Single<Issue>
 
@PUT(API_VERSION + "/projects/{id}/issues/{issue_id}")
fun updateIssueStatus(@Path("id") projectId: Long,
Loading
Loading
Loading
Loading
@@ -58,6 +58,8 @@ public class Issue {
UserBasic assignee;
@JsonField(name = "author")
UserBasic author;
@JsonField(name = "confidential")
boolean confidential;
 
public Issue() {
}
Loading
Loading
@@ -117,6 +119,10 @@ public class Issue {
.build();
}
 
public boolean isConfidential() {
return confidential;
}
@Override
public boolean equals(Object o) {
if (!(o instanceof Issue)) {
Loading
Loading
Loading
Loading
@@ -155,6 +155,13 @@
</LinearLayout>
 
</FrameLayout>
<android.support.v7.widget.SwitchCompat
android:id="@+id/confidential_switch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="false"
android:text="@string/confidential"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
 
Loading
Loading
Loading
Loading
@@ -220,6 +220,7 @@
<string name="label_already_added">Label already added</string>
<string name="failed_to_delete_issue">Failed to delete issue</string>
<string name="issue_deleted">Issue deleted</string>
<string name="confidential">Confidential</string>
 
<!-- Labels -->
<string name="labels">Labels</string>
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment