mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-16 15:48:13 +08:00
Make DueDate optional on MilestoneCreaton (#252)
Merge branch 'master' into milestone-DueDate-optional_240 add check again if gitea is older than 1.10.0 ... Crowdin [2020-01-04] + add Latvian (#253) update Translators add Latvian update Crowdin Co-authored-by: 6543 <6543@obermui.de> make DueDate optional on MilestoneCreaton Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
b3e67113f5
commit
ec62e3cebf
@ -18,6 +18,7 @@ import org.mian.gitnex.R;
|
|||||||
import org.mian.gitnex.clients.RetrofitClient;
|
import org.mian.gitnex.clients.RetrofitClient;
|
||||||
import org.mian.gitnex.helpers.AlertDialogs;
|
import org.mian.gitnex.helpers.AlertDialogs;
|
||||||
import org.mian.gitnex.helpers.Authorization;
|
import org.mian.gitnex.helpers.Authorization;
|
||||||
|
import org.mian.gitnex.helpers.VersionCheck;
|
||||||
import org.mian.gitnex.helpers.Toasty;
|
import org.mian.gitnex.helpers.Toasty;
|
||||||
import org.mian.gitnex.models.Milestones;
|
import org.mian.gitnex.models.Milestones;
|
||||||
import org.mian.gitnex.util.AppUtil;
|
import org.mian.gitnex.util.AppUtil;
|
||||||
@ -117,15 +118,16 @@ public class NewMilestoneActivity extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newMilestoneDueDate.equals("")) {
|
String finalMilestoneDueDate = null;
|
||||||
|
if(!newMilestoneDueDate.isEmpty()) {
|
||||||
|
finalMilestoneDueDate = (AppUtil.customDateCombine(AppUtil.customDateFormat(newMilestoneDueDate)));
|
||||||
|
} else if (VersionCheck.compareVersion("1.10.0", tinyDb.getString("giteaVersion")) > 1) {
|
||||||
|
// if Gitea version is less than 1.10.0 DueDate is required
|
||||||
Toasty.info(getApplicationContext(), getString(R.string.milestoneDateEmpty));
|
Toasty.info(getApplicationContext(), getString(R.string.milestoneDateEmpty));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
disableProcessButton();
|
disableProcessButton();
|
||||||
String finalMilestoneDueDate = (AppUtil.customDateCombine(AppUtil.customDateFormat(newMilestoneDueDate)));
|
|
||||||
createNewMilestone(instanceUrl, Authorization.returnAuthentication(getApplicationContext(), loginUid, instanceToken), repoOwner, repoName, newMilestoneTitle, newMilestoneDescription, finalMilestoneDueDate);
|
createNewMilestone(instanceUrl, Authorization.returnAuthentication(getApplicationContext(), loginUid, instanceToken), repoOwner, repoName, newMilestoneTitle, newMilestoneDescription, finalMilestoneDueDate);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user