Index: arms/html/reqReviewDetail/content-container.html
===================================================================
diff -u -rf9616555dc6fd93e23f0ed767ab67b8ef066fca1 -r959af33bb23a5b89c2ef88364fee946c6c425747
--- arms/html/reqReviewDetail/content-container.html (.../content-container.html) (revision f9616555dc6fd93e23f0ed767ab67b8ef066fca1)
+++ arms/html/reqReviewDetail/content-container.html (.../content-container.html) (revision 959af33bb23a5b89c2ef88364fee946c6c425747)
@@ -8,15 +8,7 @@
-
-
+
@@ -232,7 +224,59 @@
margin-bottom: 20px;
}
- .timeline-with-icons .timeline-item:after {
+ .timeline-with-icons .timeline-item h5 {
+ margin: 0;
+ font-size: 16px;
+ line-height: normal;
+ }
+
+ .timeline-with-icons .timeline-item time {
+ display: block;
+ margin-top: 7px;
+ font-size: 11px;
+ }
+
+ .timeline-item--summary {
+ width: 100%;
+ margin-top: 10px;
+ }
+
+ .history-profile {
+ display: flex;
+ align-items: center;
+ margin-bottom: 5px;
+ }
+ .history-profile--image {
+ margin-right: 7px;
+ width: 25px;
+ height: 25px;
+ border-radius: 50%;
+ overflow: hidden;
+ }
+ .history-profile--image img {
+ width: 100%;
+ }
+ .history-profile--name {
+ flex-basis: 110px;
+ }
+ .history-profile .fa {
+ width: 16px;
+ font-size: 16px;
+ text-align: center;
+ color: #919191;
+ }
+ .history-profile .fa-spinner {
+ width: 16px;
+ font-size: 16px;
+ text-align: center;
+ }
+ .history-profile .fa-check {
+ color: #45ab29;
+ }
+ .history-profile .fa-ban {
+ color: #e91313;
+ }
+ .history-profile . .timeline-with-icons .timeline-item:after {
position: absolute;
display: block;
top: 0;
Index: reference/jquery-plugins/select2-4.0.13/src/scss/theme/default/layout.scss
===================================================================
diff -u -r69fe57ca5defa495d913766c6824be673e88f7ef -r959af33bb23a5b89c2ef88364fee946c6c425747
--- reference/jquery-plugins/select2-4.0.13/src/scss/theme/default/layout.scss (.../layout.scss) (revision 69fe57ca5defa495d913766c6824be673e88f7ef)
+++ reference/jquery-plugins/select2-4.0.13/src/scss/theme/default/layout.scss (.../layout.scss) (revision 959af33bb23a5b89c2ef88364fee946c6c425747)
@@ -54,6 +54,34 @@
});
}
+const makeHtml = function (url, bindTemplate) {
+ console.log("#### url::", url);
+ ajaxGet(url).then(function (data) {
+ bindTemplate(data);
+ });
+};
+
+const dateFormat = (time = 0) => {
+ let date = time ? new Date(time).toISOString() : new Date().toISOString();
+ return date.split("T")[0];
+};
+
+const ajaxGet = (url) =>
+ $.ajax({
+ url,
+ type: "GET",
+ timeout: 7313,
+ global: false,
+ statusCode: {
+ 200: function (data) {
+ return data.responseJSON;
+ },
+ 401: function (n) {
+ location.href = "/sso/login";
+ },
+ },
+ });
+
// Page load
resetToDefaults();
topbar.show();
Index: arms/js/reqReviewDetail.js
===================================================================
diff -u -rf9616555dc6fd93e23f0ed767ab67b8ef066fca1 -r959af33bb23a5b89c2ef88364fee946c6c425747
--- arms/js/reqReviewDetail.js (.../reqReviewDetail.js) (revision f9616555dc6fd93e23f0ed767ab67b8ef066fca1)
+++ arms/js/reqReviewDetail.js (.../reqReviewDetail.js) (revision 959af33bb23a5b89c2ef88364fee946c6c425747)
@@ -1,83 +1,102 @@
-// --- 사이드 메뉴 -- //
-$(function () {
- setSideMenu(
- "sidebar_menu_requirement",
- "sidebar_menu_requirement_review",
- "requirement-elements-collapse"
- );
-
- includeDiff();
-});
-
-const info = {
- title: "리뷰 bla bla bla bla bla",
- history: [
- {
- updated: "2022-07-07 23:18",
- title: "history summary 5",
- label: "success",
- status: "success",
- value: 5,
- },
- {
- updated: "2022-06-29 14:08",
- title: "history summary 4",
- label: "important",
- status: "important",
- value: 4,
- },
- {
- updated: "2022-06-01 18:37",
- title: "history summary 3",
- label: "info",
- status: "info",
- value: 3,
- },
- {
- updated: "2022-05-27 11:59",
- title: "history summary 2",
- label: "warning",
- status: "warning",
- value: 2,
- },
- {
- updated: "2022-05-07 10:23",
- title: "history summary15",
- label: "inverse",
- status: "등록",
- value: 1,
- },
- ],
-};
-
-function makeHistory() {
+const makeHistory = function (data) {
+ console.log("##### makeHistory ::", data);
const historys = document.querySelector(".review-history");
let lists = "";
-
- info.history.forEach((item, index) => {
- const uid = createdUUID();
+ data.history.forEach((item, index) => {
lists += `
- ${item.status}
- ${item.title}
- ${item.updated}
-
-
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit
- necessitatibus adipisci, ad alias, voluptate pariatur officia repellendus
- repellat inventore fugit perferendis totam dolor voluptas et corrupti
- distinctio maxime corporis optio?
-
-
+
+ ${item.status}
+
+ ${item.title}
+ ${dateFormat(item.upd_dt)}
+
+ ${historySummary(item.summary)}
+
+
`;
});
- historys.innerHTML = lists;
-}
-makeHistory();
+ historys.innerHTML = ``;
+};
-function includeDiff() {
+const historySummary = (summary) => {
+ let content = "";
+
+ switch (true) {
+ case !summary:
+ break;
+ case !!summary.desc:
+ content = `${summary.desc}
`;
+ break;
+ case !!summary.progress:
+ content = `진행률: ${summary.progress}%
`;
+ break;
+ case !!summary.modifier:
+ content = `${historyProfile(summary.modifier)} `;
+ break;
+ case !!summary.reviewers:
+ content = `${summary.reviewers.reduce((acc, cur) => {
+ return (acc += historyProfile(cur));
+ }, [])} `;
+ break;
+ }
+
+ return content;
+};
+
+const historyReviewerStatus = (status) => {
+ let icon = "fa-spinner";
+ switch (status) {
+ case "reject":
+ icon = "fa-ban";
+ break;
+ case "pass":
+ icon = "fa-check";
+ break;
+ case "none":
+ default:
+ break;
+ }
+ return ` `;
+};
+const historyProfile = (profile) => {
+ return `
+
+
+ ${profile.name}
+ ${!!profile.confirm ? historyReviewerStatus(profile.confirm) : ""}
+
+ `;
+};
+
+const historyLabel = (name) => {
+ let label = "inverse";
+
+ switch (name) {
+ case "close":
+ label = "success";
+ break;
+ case "reject":
+ label = "important";
+ break;
+ case "modify":
+ label = "warning";
+ break;
+ case "review":
+ case "work":
+ label = "info";
+ break;
+ case "start":
+ default:
+ break;
+ }
+
+ return label;
+};
+
+const includeDiff = function () {
const diffString = `diff --git a/sample.js b/sample.js
index 0000001..0ddf2ba
--- a/sample.js
@@ -100,8 +119,20 @@
};
const diff2htmlUi = new Diff2HtmlUI(targetElement, diffString, configuration);
- console.log("###### diff2htmlUi");
diff2htmlUi.draw();
diff2htmlUi.highlightCode();
diff2htmlUi.fileListToggle(false);
-}
+};
+
+// --- 사이드 메뉴 -- //
+$(function () {
+ setSideMenu(
+ "sidebar_menu_requirement",
+ "sidebar_menu_requirement_review",
+ "requirement-elements-collapse"
+ );
+
+ makeHtml("./js/reviewDetailHistory.json", makeHistory);
+
+ includeDiff();
+});
Index: arms/js/reviewDetailHistory.json
===================================================================
diff -u -rf9616555dc6fd93e23f0ed767ab67b8ef066fca1 -r959af33bb23a5b89c2ef88364fee946c6c425747
--- arms/js/reviewDetailHistory.json (.../reviewDetailHistory.json) (revision f9616555dc6fd93e23f0ed767ab67b8ef066fca1)
+++ arms/js/reviewDetailHistory.json (.../reviewDetailHistory.json) (revision 959af33bb23a5b89c2ef88364fee946c6c425747)
@@ -5,49 +5,81 @@
"status": "review",
"history": [
{
+ "upd_dt": 1661904000000,
+ "title": "요구사항 결과",
+ "status": "close",
+ "summary": {
+ "desc": "요구사항 수행 결과 bla bla bla bla bla bla bla bla"
+ }
+ },
+ {
+ "upd_dt": 1661904000000,
+ "title": "요구사항 결과",
+ "status": "reject",
+ "summary": {
+ "desc": "요구사항 수행 결과 bla bla bla bla bla bla bla bla"
+ }
+ },
+ {
"upd_dt": 1661040000000,
"title": "요구사항 리뷰",
"status": "review",
- "reviewer": [
- {
- "name": "이름 A",
- "confirm": "none"
- },
- {
- "name": "이름 B",
- "confirm": "reject"
- },
- {
- "name": "이름 C",
- "confirm": "none"
- },
- {
- "name": "이름 D",
- "confirm": "pass"
- },
- {
- "name": "이름 E",
- "confirm": "pass"
- }
- ]
+ "summary": {
+ "reviewers": [
+ {
+ "name": "Jessica Johnsson",
+ "image": "../reference/light-blue/img/14.jpg",
+ "confirm": "none"
+ },
+ {
+ "name": "Frans Garey",
+ "image": "../reference/light-blue/img/13.jpg",
+ "confirm": "reject"
+ },
+ {
+ "name": "Erebus Novak",
+ "image": "../reference/light-blue/img/3.jpg",
+ "confirm": "none"
+ },
+ {
+ "name": "Leopoldo Reier",
+ "image": "../reference/light-blue/img/2.jpg",
+ "confirm": "pass"
+ },
+ {
+ "name": "Finees Lund",
+ "image": "../reference/light-blue/img/1.jpg",
+ "confirm": "pass"
+ }
+ ]
+ }
},
{
"upd_dt": 1660953600000,
"title": "요구사항 작업",
"status": "work",
- "progress": 100
+ "summary": {
+ "progress": 100
+ }
},
{
"upd_dt": 1659657600000,
"title": "요구사항 변경",
"status": "modify",
- "modifier": "변경자 A"
+ "summary": {
+ "modifier": {
+ "name": "Leopoldo Reier",
+ "image": "../reference/light-blue/img/2.jpg"
+ }
+ }
},
{
"upd_dt": 1656633600000,
"title": "요구사항 작업",
"status": "work",
- "progress": 100
+ "summary": {
+ "progress": 100
+ }
},
{
"upd_dt": 1656288000000,
@@ -57,7 +89,10 @@
{
"rgt_dt": 1656201600000,
"title": "요구사항 등록",
- "status": "done"
+ "status": "start",
+ "summary": {
+ "desc": "요구사항 요약 bla bla bla"
+ }
}
]
}