Skip to content

Commit

Permalink
feat(CRUI):Change CR state 'On Hold' to 'Awaiting Response' & edit Pr…
Browse files Browse the repository at this point in the history
…eferredClearingDate

Signed-off-by: Abdul Kapti <abdul.kapti@siemens-healthineers.com>
  • Loading branch information
Abdul Kapti committed Oct 18, 2022
1 parent 282298e commit b4c1497
Show file tree
Hide file tree
Showing 12 changed files with 146 additions and 13 deletions.
Expand Up @@ -238,7 +238,7 @@ public RequestStatus sendEmailForClearingRequestUpdate(ClearingRequest clearingR
case IN_PROGRESS:
case IN_QUEUE:
case ACCEPTED:
case ON_HOLD:
case AWAITING_RESPONSE:
sendMailForUpdatedCR(project, projectUrl, clearingRequest, user);
break;

Expand Down
Expand Up @@ -238,6 +238,13 @@ public RequestStatus updateClearingRequest(ClearingRequest request, User user, S
.append(StringUtils.defaultIfBlank(oldPriority, "NULL")).append("</b> to <b>")
.append(StringUtils.defaultIfBlank(newPriority, "NULL")).append("</b>");
}
String oldPreferredClDate = CommonUtils.nullToEmptyString(currentRequest.getRequestedClearingDate());
String newPreferredClDate = CommonUtils.nullToEmptyString(request.getRequestedClearingDate());
if (!oldPreferredClDate.equals(newPreferredClDate)) {
commentText = commentText.append("\n\tPreferred Clearing Date changed from: <b>")
.append(StringUtils.defaultIfBlank(oldPreferredClDate, "NULL")).append("</b> to <b>")
.append(StringUtils.defaultIfBlank(newPreferredClDate, "NULL")).append("</b>");
}
Comment comment = new Comment().setText(commentText.toString());
comment.setCommentedBy(user.getEmail());
comment.setAutoGenerated(true);
Expand Down
Expand Up @@ -110,6 +110,11 @@ public static AddDocumentRequestSummary updateClearingRequest(PortletRequest req
return requestSummary.setMessage("Invalid clearingTeam email");
}
clearingRequest.setClearingTeam(clearingTeam);
String preferredClearingDate = request.getParameter(ClearingRequest._Fields.REQUESTED_CLEARING_DATE.toString());
if (CommonUtils.isNotNullEmptyOrWhitespace(preferredClearingDate) && !preferredClearingDate.equals(clearingRequest.getRequestedClearingDate())
&& SW360Utils.isValidDate(preferredClearingDate, DateTimeFormatter.ISO_LOCAL_DATE, null)) {
clearingRequest.setRequestedClearingDate(preferredClearingDate);
}
if (CommonUtils.isNotNullEmptyOrWhitespace(isClearingExpertEdit) && Boolean.parseBoolean(isClearingExpertEdit)) {
String agreedDate = request.getParameter(ClearingRequest._Fields.AGREED_CLEARING_DATE.toString());
String status = request.getParameter(ClearingRequest._Fields.CLEARING_STATE.toString());
Expand Down
Expand Up @@ -389,7 +389,7 @@
.sw360-tt-ClearingRequestState-CLOSED:hover:after {
content: attr(data-content);
}
.sw360-tt-ClearingRequestState-ON_HOLD:hover:after {
.sw360-tt-ClearingRequestState-AWAITING_RESPONSE:hover:after {
content: attr(data-content);
}

Expand Down
Expand Up @@ -148,7 +148,26 @@
</tr>
<tr>
<td><label class="form-group"><liferay-ui:message key="preferred.clearing.date" />:</label></td>
<td><sw360:out value="${clearingRequest.requestedClearingDate}" bare="true"/></td>
<td>
<core_rt:choose>
<core_rt:when test="${isEditableForRequestingUser}">
<input class="form-control datepicker" id="preferredClearingDate"
name="<portlet:namespace/><%=ClearingRequest._Fields.REQUESTED_CLEARING_DATE%>" type="text" pattern="\d{4}-\d{2}-\d{2}"
value="<sw360:out value="${clearingRequest.requestedClearingDate}"/>" placeholder="<liferay-ui:message key='preferred.clearing.date.yyyy.mm.dd' />" />
<small class="form-text">
<svg class='lexicon-icon'><use href='/o/org.eclipse.sw360.liferay-theme/images/clay/icons.svg#info-circle-open' /></svg>
<liferay-ui:message key="only.current.or.future.date.is.considered.as.valid"/>
</small>
<div class="invalid-feedback">
<liferay-ui:message key="date.should.be.valid" />!
</div>
</core_rt:when>
<core_rt:otherwise>
<sw360:out value="${clearingRequest.requestedClearingDate}" bare="true"/>
</core_rt:otherwise>
</core_rt:choose>

</td>
</tr>
<tr>
<td><label class="form-group"><liferay-ui:message key="business.area.line" />:</label></td>
Expand Down Expand Up @@ -422,16 +441,19 @@
require(['jquery', 'modules/dialog', 'modules/validation', 'modules/button', 'bridges/jquery-ui' ], function($, dialog, validation, button) {
validation.enableForm('#updateCRForm');
let pcdLimit = ${PreferredClearingDateLimit};
let pcDate = $("#preferredClearingDate").val();
var clearingTeamEmailEditable = $("#CLEARING_TEAM");
$('#formSubmit').click(
function() {
let $form = $("#updateCRForm"),
$emailId = $("#CLEARING_TEAMDisplay"),
$acDate = $("#agreedClearingDate");
$acDate = $("#agreedClearingDate"),
$pcDate = $("#preferredClearingDate");
pcdDiff = parseInt((new Date($pcDate.val()) - new Date(pcDate)) / (1000 * 60 * 60 * 24), 10);
$form.addClass('was-validated');
if (clearingTeamEmailEditable){
if (clearingTeamEmailEditable) {
let emailId = $("#CLEARING_TEAM").val();
if (validation.isValidEmail(emailId)) {
$("#clearingTeamEmailErrorMsg").hide();
Expand All @@ -442,6 +464,11 @@ require(['jquery', 'modules/dialog', 'modules/validation', 'modules/button', 'br
}
}
$emailId.removeClass("is-invalid");
if ($pcDate.val() && pcdDiff < 0) {
$pcDate.addClass("is-invalid");
return;
}
$pcDate.removeClass("is-invalid");
if ($acDate.val() && !validation.isValidDate($acDate.val())) {
$acDate.addClass("is-invalid");
return;
Expand Down
Expand Up @@ -106,6 +106,7 @@ authorities=Authorities
authorization.header.authorization.token.api.token=Authorization Header (Authorization: Token <API-Token>)
auto.refresh.in=Auto-refresh in
auto-refresh.in.5=Auto-refresh in 5
awaiting.response=Awaiting Response
ba-bl.slash.group=BA-BL/Group
based.on.license.file.count=based on license file count
basic.fields=Basic fields
Expand Down Expand Up @@ -198,14 +199,14 @@ ClearingRequestPriority-CRITICAL=Clearing time less than 1 week.
ClearingRequestPriority-HIGH=Clearing time greater than 1 week but less than 2 weeks.
ClearingRequestPriority-LOW=Clearing time greater than 4 weeks.
ClearingRequestPriority-MEDIUM=Clearing time greater than 2 weeks but less than 4 weeks.
ClearingRequestState=New: CR is pending to be Accepted by the Clearing Team.&#10A sanity check for the artifacts required for Clearing will be done prior to Accepting a CR. &#10Accepted: CR has passed SanityCheck and is accepted into the clearing queue. &#10Rejected: CR has failed SanityCheck. Contact Clearing Team. (Rejecting resets the CR priority) &#10In Queue: CR is next in queue for clearing. &#10In Progress: CR is being worked on by the clearing team. &#10Closed: Clearings requested in the CR is complete. (Closing resets the CR priority) &#10On Hold: Clearing Team is waiting for input/action from the Requesting User.
ClearingRequestState=New: CR is pending to be Accepted by the Clearing Team.&#10A sanity check for the artifacts required for Clearing will be done prior to Accepting a CR. &#10Accepted: CR has passed SanityCheck and is accepted into the clearing queue. &#10Rejected: CR has failed SanityCheck. Contact Clearing Team. (Rejecting resets the CR priority) &#10In Queue: CR is next in queue for clearing. &#10In Progress: CR is being worked on by the clearing team. &#10Closed: Clearings requested in the CR is complete. (Closing resets the CR priority) &#10Awaiting Response: Clearing Team is waiting for input/action from the Requesting User.
ClearingRequestState-NEW=CR is pending to be Accepted by the Clearing Team.&#10A sanity check for the artifacts required for Clearing will be done prior to Accepting a CR.
ClearingRequestState-ACCEPTED=CR has passed SanityCheck and is accepted into the clearing queue.
ClearingRequestState-REJECTED=CR has failed SanityCheck. Contact Clearing Team. (Rejecting resets the CR priority)
ClearingRequestState-IN_QUEUE=CR is next in queue for clearing.
ClearingRequestState-IN_PROGRESS=CR is being worked on by the clearing team.
ClearingRequestState-CLOSED=Clearings requested in the CR is complete. (Closing resets the CR priority)
ClearingRequestState-ON_HOLD=Clearing Team is waiting for input/action from the Requesting User.
ClearingRequestState-AWAITING_RESPONSE=Clearing Team is waiting for input/action from the Requesting User.
clearing.standard=Clearing Standard
clearing.state=Clearing State
ClearingState=New: &#10Sent to fossology: &#10Under Clearing: &#10Report available: &#10Approved:
Expand Down Expand Up @@ -906,6 +907,7 @@ only.administrators.can.edit.a.closed.project=Only administrators can edit a clo
only.admin.users.can.delete.obligations=Only admin users can delete obliations!
only.approved.cli.files.obligations.will.be.shown.here=Only <b>Approved</b> CLI files Obligations will be shown here.
only.approved=Only Approved
only.current.or.future.date.is.considered.as.valid=Only current or future date is considered as valid
open=Open
open.clearing.requests=Open Clearing Requests
open.components=Open Components
Expand Down
Expand Up @@ -106,6 +106,7 @@ authorities=権利者
authorization.header.authorization.token.api.token=認証ヘッダ, (認証 API-トークン)
auto.refresh.in=自動更新
auto-refresh.in.5=5分毎に自動更新
awaiting.response=Awaiting Response
ba-bl.slash.group=BA-BL/Group
based.on.license.file.count=based on license file count
basic.fields=基本分野
Expand Down Expand Up @@ -198,14 +199,14 @@ ClearingRequestPriority-CRITICAL=クリアリング時間が1週以内.
ClearingRequestPriority-HIGH=クリアリング時間が1週間以上2週間以内.
ClearingRequestPriority-MEDIUM=クリアリング時間が2週間以上4週間以内.
ClearingRequestPriority-LOW=クリアリング時間が4週間以上.
ClearingRequestState=New: 保留されていたクリアリングリクエストがクリアリングチームによって承認.&#10A クリアリングに必要な成果物のSanityCheckはクリアリングリクエスト承認前に行う &#10Accepted: クリアリングリクエストはSanityCheckが完了しクリアリング受領. &#10Rejected:クリアリングリクエストはSanityCheckに失敗. クリアリングチームに連絡してください. (Rejecting resets the CR priority) &#10In Queue:クリアリングリクエストが次のリクエストに入りました. &#10In Progress: クリアリングリクエストはクリアリングチームに確認されています &#10Closed: クリアリングリクエスト完了 (Closing resets the CR priority) &#10On Hold: Clearing Team is waiting for input/action from the Requesting User.
ClearingRequestState=New: 保留されていたクリアリングリクエストがクリアリングチームによって承認.&#10A クリアリングに必要な成果物のSanityCheckはクリアリングリクエスト承認前に行う &#10Accepted: クリアリングリクエストはSanityCheckが完了しクリアリング受領. &#10Rejected:クリアリングリクエストはSanityCheckに失敗. クリアリングチームに連絡してください. (Rejecting resets the CR priority) &#10In Queue:クリアリングリクエストが次のリクエストに入りました. &#10In Progress: クリアリングリクエストはクリアリングチームに確認されています &#10Closed: クリアリングリクエスト完了 (Closing resets the CR priority) &#10Awaiting Response: Clearing Team is waiting for input/action from the Requesting User.
ClearingRequestState-NEW=保留されていたクリアリングリクエストがクリアリングチームによって承認.&#10A クリアリングに必要な成果物のSanityCheckはクリアリングリクエスト承認前に行う.
ClearingRequestState-ACCEPTED=クリアリングリクエストはSanityCheckが完了しクリアリング受領.
ClearingRequestState-REJECTED=クリアリングリクエストはSanityCheckに失敗. クリアリングチームに連絡してください. (Rejecting resets the CR priority)
ClearingRequestState-IN_QUEUE=クリアリングリクエストが次のリクエストに入りました.
ClearingRequestState-IN_PROGRESS=クリアリングリクエストはクリアリングチームに確認されています.
ClearingRequestState-CLOSED=クリアリングリクエスト完了. (Closing resets the CR priority)
ClearingRequestState-ON_HOLD=クリアリングチームはユーザーからの対応待ちです.
ClearingRequestState-AWAITING_RESPONSE=クリアリングチームはユーザーからの対応待ちです.
clearing.standard=クリアリング基準
clearing.state=クリアリングステータス
ClearingState=新規: &#10FOSSologyに送付: &#10クリア中: &#10報告書利用可能: &#10承認済み
Expand Down Expand Up @@ -906,6 +907,7 @@ only.administrators.can.edit.a.closed.project=閉じたプロジェクトを編
only.admin.users.can.delete.todos=アドミンユーザのみがToDoを削除可能
only.approved.cli.files.obligations.will.be.shown.here=ここでは、<b>承認済み</b>のCLIファイルのみが表示されます。
only.approved=承認のみ
only.current.or.future.date.is.considered.as.valid=Only current or future date is considered as valid
open=開く
open.clearing.requests=クリア依頼
open.components=コンポーネント
Expand Down
Expand Up @@ -107,6 +107,7 @@ authorities=Quyền
authorization.header.authorization.token.api.token=Phần đầu mã truy cập. (Authorization: Mã truy cập <API-Token>)
auto.refresh.in=Tự động làm mới trong
auto-refresh.in.5=Tự động làm mới trong 5
awaiting.response=Awaiting Response
ba-bl.slash.group=BA-BL/Group
based.on.license.file.count=based on license file count
basic.fields=Các trường cơ bản
Expand Down Expand Up @@ -199,14 +200,14 @@ ClearingRequestPriority-CRITICAL=Clearing time less than 1 week.
ClearingRequestPriority-HIGH=Clearing time greater than 1 week but less than 2 weeks.
ClearingRequestPriority-MEDIUM=Clearing time greater than 2 weeks but less than 4 weeks.
ClearingRequestPriority-LOW=Clearing time greater than 4 weeks.
ClearingRequestState=New: CR is pending to be Accepted by the Clearing Team.&#10A sanity check for the artifacts required for Clearing will be done prior to Accepting a CR. &#10Accepted: CR has passed SanityCheck and is accepted into the clearing queue. &#10Rejected: CR has failed SanityCheck. Contact Clearing Team. (Rejecting resets the CR priority) &#10In Queue: CR is next in queue for clearing. &#10In Progress: CR is being worked on by the clearing team. &#10Closed: Clearings requested in the CR is complete. (Closing resets the CR priority) &#10On Hold: Clearing Team is waiting for input/action from the Requesting User.
ClearingRequestState=New: CR is pending to be Accepted by the Clearing Team.&#10A sanity check for the artifacts required for Clearing will be done prior to Accepting a CR. &#10Accepted: CR has passed SanityCheck and is accepted into the clearing queue. &#10Rejected: CR has failed SanityCheck. Contact Clearing Team. (Rejecting resets the CR priority) &#10In Queue: CR is next in queue for clearing. &#10In Progress: CR is being worked on by the clearing team. &#10Closed: Clearings requested in the CR is complete. (Closing resets the CR priority) &#10Awaiting Response: Clearing Team is waiting for input/action from the Requesting User.
ClearingRequestState-NEW=CR is pending to be Accepted by the Clearing Team.&#10A sanity check for the artifacts required for Clearing will be done prior to Accepting a CR.
ClearingRequestState-ACCEPTED=CR has passed SanityCheck and is accepted into the clearing queue.
ClearingRequestState-REJECTED=CR has failed SanityCheck. Contact Clearing Team. (Rejecting resets the CR priority)
ClearingRequestState-IN_QUEUE=CR is next in queue for clearing.
ClearingRequestState-IN_PROGRESS=CR is being worked on by the clearing team.
ClearingRequestState-CLOSED=Clearings requested in the CR is complete. (Closing resets the CR priority)
ClearingRequestState-ON_HOLD=Clearing Team is waiting for input/action from the Requesting User.
ClearingRequestState-AWAITING_RESPONSE=Clearing Team is waiting for input/action from the Requesting User.
clearing.standard=Tiêu chuẩn dọn dẹp
clearing.state=Trạng thái dọn dẹp
ClearingState=Mới: &#10Đã gửi đến Fossology: &#10Đang xóa: &#10 Báo cáo có sẵn: &#10Đã phê duyệt:
Expand Down Expand Up @@ -908,6 +909,7 @@ only.administrators.can.edit.a.closed.project=Chỉ quản trị viên có thể
do.you.really.want.to.delete.the.obligation.x=Chỉ người dùng quản trị mới có thể xóa Việc cần làm!
only.approved.cli.files.obligations.will.be.shown.here=Chỉ <b>Được phê duyệt</b> Các tệp CLI Nghĩa vụ sẽ được hiển thị tại đây.
only.approved=Only Approved
only.current.or.future.date.is.considered.as.valid=Only current or future date is considered as valid
open=Mở
open.clearing.requests=Mở yêu cầu thanh toán bù trừ
open.components=Open Components
Expand Down
Expand Up @@ -305,7 +305,7 @@ private ThriftEnumUtils() {
.put(ClearingRequestState.IN_QUEUE, "In Queue")
.put(ClearingRequestState.IN_PROGRESS, "In Progress")
.put(ClearingRequestState.CLOSED, "Closed")
.put(ClearingRequestState.ON_HOLD, "On Hold")
.put(ClearingRequestState.AWAITING_RESPONSE, "Awaiting Response")
.build();

private static final ImmutableMap<ClearingRequestPriority, String> MAP_CLEARING_REQUEST_PRIORITY_STRING = ImmutableMap.of(
Expand Down
2 changes: 1 addition & 1 deletion libraries/datahandler/src/main/thrift/sw360.thrift
Expand Up @@ -71,7 +71,7 @@ enum ClearingRequestState {
IN_QUEUE = 3,
IN_PROGRESS = 4,
CLOSED = 5,
ON_HOLD = 6
AWAITING_RESPONSE = 6
}

enum ClearingRequestPriority {
Expand Down

0 comments on commit b4c1497

Please sign in to comment.