Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CD-CODE Web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CD-CODE team
CD-CODE Web
Commits
2fdf789c
Commit
2fdf789c
authored
3 years ago
by
moon
Browse files
Options
Downloads
Patches
Plain Diff
After changing the column names, the mappings should be changed
parent
a1cf5212
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
web/src/components/UpdateItemTable.vue
+6
-6
6 additions, 6 deletions
web/src/components/UpdateItemTable.vue
web/src/views/UpdateItem.vue
+105
-33
105 additions, 33 deletions
web/src/views/UpdateItem.vue
with
111 additions
and
39 deletions
web/src/components/UpdateItemTable.vue
+
6
−
6
View file @
2fdf789c
...
...
@@ -40,27 +40,27 @@ export default {
},
{
title
:
'
Resource Name
'
,
data
:
'
attributes.
ResourceName
'
,
data
:
'
attributes.
Entity
'
,
},
{
title
:
'
Resource ID
'
,
data
:
'
attributes.
ResourceID
'
,
data
:
'
attributes.
EntityId
'
,
},
{
title
:
'
Attribute
'
,
data
:
'
attributes.
Data
Attribute
'
,
data
:
'
attributes.Attribute
'
,
},
{
title
:
'
Value
'
,
data
:
'
attributes.
DataAttribute
Value
'
,
data
:
'
attributes.Value
'
,
},
{
title
:
'
Change Operation
'
,
data
:
'
attributes.ChangeOperation
'
,
},
{
title
:
'
Review Operation
'
,
data
:
'
attributes.
ReviewOperation
'
,
title
:
'
Status
'
,
data
:
'
attributes.
Status
'
,
},
{
title
:
'
Submitted at
'
,
...
...
This diff is collapsed.
Click to expand it.
web/src/views/UpdateItem.vue
+
105
−
33
View file @
2fdf789c
...
...
@@ -2,7 +2,7 @@
<div>
<div
class=
"flex items-center justify-center"
>
<h3
v-show=
"error"
class=
"text-2xl text-red-500"
>
{{
errorMsg
}}
</h3>
<div
v-if=
"loaded"
class=
"md:flex card p-2 mt-5"
>
<div
v-if=
"
item === 'new' ||
loaded"
class=
"md:flex card p-2 mt-5"
>
<div
class=
"p-5 mx-auto text-left font-raleway container max-w-screen-md"
>
<h1
class=
"font-bold text-left font-montserrat text-3xl sm:text-5xl mb-7"
>
{{
item
===
'
new
'
?
'
Create new Update Item
'
:
item
}}
...
...
@@ -46,8 +46,7 @@
<option
disabled
value=
""
>
Please select one
</option>
<option>
Add
</option>
<option>
Remove
</option>
<option>
Update_Add
</option>
<option>
Update_Remove
</option>
<option>
Update
</option>
</select>
</div>
</div>
...
...
@@ -77,11 +76,11 @@
<div
class=
"md:flex md:items-center mx-3 mb-6"
>
<div
class=
"md:w-1/3"
>
<label
class=
"text-left font-bold md:text-right mb-1 md:mb-0 pr-4"
for=
"inline-comment"
>
Comment
Comment
s
</label>
</div>
<div
class=
"md:w-2/3"
>
<input
v-model=
"
c
omment"
class=
"bg-white w-full py-2 text-gray-700 outline-none bg-transparent border-b hover:border-blue-700 focus:bg-gray-200 focus:border-blue-700"
id=
"inline-comment"
type=
"text"
placeholder=
"your comments here"
>
<input
v-model=
"
submissionC
omment
s
"
class=
"bg-white w-full py-2 text-gray-700 outline-none bg-transparent border-b hover:border-blue-700 focus:bg-gray-200 focus:border-blue-700"
id=
"inline-comment"
type=
"text"
placeholder=
"your comments here"
>
</div>
</div>
...
...
@@ -92,15 +91,7 @@
</label>
</div>
<div
class=
"md:w-2/3"
>
<select
v-if=
"userRole === 'Maintainer' || userRole === 'Administrator'"
v-model=
"status"
class=
"bg-white w-full py-2 text-gray-700 outline-none bg-transparent border-b hover:border-blue-700 focus:bg-gray-200 focus:border-blue-700"
id=
"inline-status"
>
<option
disabled
value=
""
>
Please select one
</option>
<option>
Requested
</option>
<option>
Accepted
</option>
<option>
Rejected
</option>
<option>
Partially_Accepted
</option>
<option>
Synced
</option>
</select>
<p
v-if=
"userRole === 'Contributor' && itemId !== 'new'"
class=
"mt-3"
>
<p
v-if=
"(userRole === 'Contributor' || userRole === 'Maintainer' || userRole === 'Administrator') && itemId !== 'new'"
class=
"mt-3"
>
{{
status
}}
</p>
</div>
...
...
@@ -109,13 +100,12 @@
<div
v-if=
"item !== 'new'"
class=
"md:flex md:items-center mx-3 mb-6"
>
<div
class=
"md:w-1/3"
>
<label
class=
"text-left font-bold md:text-right mb-1 md:mb-0 pr-4"
for=
"inline-reviewer-comment"
>
Reviewer Comment
Reviewer Comment
s
</label>
</div>
<div
class=
"md:w-2/3"
>
<input
v-if=
"userRole === 'Maintainer' || userRole === 'Administrator'"
v-model=
"reviewComment"
class=
"bg-white w-full py-2 text-gray-700 outline-none bg-transparent border-b hover:border-blue-700 focus:bg-gray-200 focus:border-blue-700"
id=
"inline-reviewer-comment"
type=
"text"
placeholder=
"reviewer comments here"
>
<p
v-if=
"userRole === 'Contributor' && itemId !== 'new'"
class=
"mt-3"
>
{{
reviewComment
}}
<p
v-if=
"(userRole === 'Contributor' || userRole === 'Maintainer' || userRole === 'Administrator') && itemId !== 'new'"
class=
"mt-3"
>
{{
reviewComments
}}
</p>
</div>
</div>
...
...
@@ -123,6 +113,55 @@
<button
type=
"submit"
:disabled=
"entityId.length
<
3"
class=
"bg-green-400 p-5 text-white"
>
{{
item
===
'
new
'
?
'
Submit
'
:
'
Update
'
}}
<span
class=
"fa fa-arrow-right"
/>
</button>
<div
v-if=
"(userRole === 'Maintainer' || userRole === 'Administrator') && item !== 'new'"
class=
"mt-10"
>
<hr/>
<div
class=
"md:flex md:items-center mx-3 mb-6"
>
<div
class=
"md:w-1/3"
>
<label
class=
"text-left font-bold md:text-right mb-1 md:mb-0 pr-4"
for=
"inline-status"
>
Status
</label>
</div>
<div
class=
"md:w-2/3"
>
<select
v-model=
"status"
class=
"bg-white w-full py-2 text-gray-700 outline-none bg-transparent border-b hover:border-blue-700 focus:bg-gray-200 focus:border-blue-700"
id=
"inline-status"
>
<option
disabled
value=
""
>
Please select one
</option>
<option>
Requested
</option>
<option>
Accepted
</option>
<option>
Rejected
</option>
<option>
Synced
</option>
</select>
</div>
</div>
<div
class=
"md:flex md:items-center mx-3 mb-6"
>
<div
class=
"md:w-1/3"
>
<label
class=
"text-left font-bold md:text-right mb-1 md:mb-0 pr-4"
for=
"inline-reviewer-comment"
>
Reviewer Comment
</label>
</div>
<div
class=
"md:w-2/3"
>
<input
v-model=
"reviewComments"
class=
"bg-white w-full py-2 text-gray-700 outline-none bg-transparent border-b hover:border-blue-700 focus:bg-gray-200 focus:border-blue-700"
id=
"inline-reviewer-comment"
type=
"text"
placeholder=
"reviewer comments here"
>
</div>
</div>
<div
class=
"md:flex md:items-center mx-3 mb-6"
>
<div
class=
"md:w-1/3"
>
<label
class=
"text-left font-bold md:text-right mb-1 md:mb-0 pr-4"
for=
"inline-reviewer-comment"
>
Sync Response
</label>
</div>
<div
class=
"md:w-2/3"
>
<p
class=
"mt-3"
>
{{
syncResponse
}}
</p>
</div>
</div>
<button
type=
"button"
:disabled=
"entityId.length
<
3"
class=
"bg-green-400 p-5 text-white"
@
click=
"updateReview"
>
{{
'
Update Review
'
}}
<span
class=
"fa fa-arrow-right"
/>
</button>
</div>
</form>
</div>
</div>
...
...
@@ -147,13 +186,12 @@ export default {
status
:
'
Requested
'
,
// 1. Requested, 2. Accepted, 3. Rejected, 4. Patially_Accepted, 5. Synced
submittedBy
:
''
,
submittedAt
:
''
,
// datetime
submissionComment
:
''
,
submissionComment
s
:
''
,
reviewedBy
:
''
,
reviewedAt
:
''
,
// datetime
reviewComment
:
''
,
reviewComment
s
:
''
,
syncedAt
:
''
,
// datetime
syncResponse
:
''
,
// response from the sync process (errors if any)
comment
:
''
,
// user comment
loaded
:
false
,
error
:
false
,
errorMsg
:
`An error occurred, please try again`
...
...
@@ -183,13 +221,13 @@ export default {
// console.log(vm.userData)
let
dat
=
{
ResourceName
:
this
.
entity
,
ResourceID
:
this
.
entityId
,
Data
Attribute
:
this
.
attribute
,
DataAttribute
Value
:
this
.
attributeValue
,
Entity
:
this
.
entity
,
EntityId
:
this
.
entityId
,
Attribute
:
this
.
attribute
,
Value
:
this
.
attributeValue
,
ChangeOperation
:
this
.
changeOperation
,
User
Comment
:
this
.
c
omment
,
ReviewComment
:
this
.
reviewComment
,
Submission
Comment
s
:
this
.
submissionC
omment
s
,
Status
:
this
.
status
,
// ReviewedBy:
// ReviewedAt:
// ReviewComment:
...
...
@@ -249,13 +287,14 @@ export default {
if
(
res
.
data
.
data
)
{
const
d
=
res
.
data
.
data
.
attributes
;
vm
.
item
=
res
.
data
.
data
.
id
;
vm
.
entity
=
d
.
ResourceName
;
vm
.
entityId
=
d
.
ResourceID
;
vm
.
attribute
=
d
.
Data
Attribute
;
vm
.
attributeValue
=
d
.
DataAttribute
Value
;
vm
.
entity
=
d
.
Entity
;
vm
.
entityId
=
d
.
EntityId
;
vm
.
attribute
=
d
.
Attribute
;
vm
.
attributeValue
=
d
.
Value
;
vm
.
changeOperation
=
d
.
ChangeOperation
;
vm
.
comment
=
d
.
UserComment
;
vm
.
reviewComment
=
d
.
reviewComment
;
vm
.
status
=
d
.
Status
;
vm
.
submissionComments
=
d
.
SubmissionComments
;
vm
.
reviewComments
=
d
.
ReviewComments
;
// ReviewedBy:
// ReviewedAt:
// ReviewComment:
...
...
@@ -270,6 +309,39 @@ export default {
this
.
errorMsg
=
"
You are not authorized to access this item.
"
setTimeout
(()
=>
vm
.
$router
.
go
(
-
1
),
2000
);
}
},
async
updateReview
()
{
const
vm
=
this
;
const
jwt
=
vm
.
jwt
;
if
(
jwt
===
null
)
{
vm
.
loaded
=
false
;
return
}
// console.log(vm.userData)
let
dat
=
{
Status
:
this
.
status
,
ReviewComments
:
this
.
reviewComments
,
};
try
{
await
this
.
axios
.
put
(
`http://localhost:1337/api/update-item/review/`
+
vm
.
item
,
{
data
:
dat
,
},
{
headers
:
{
Authorization
:
`Bearer
${
jwt
}
`
}
});
// console.log(res)
vm
.
$router
.
go
(
-
1
)
}
catch
(
error
)
{
// console.log(error.response.data.error.message)
// console.log(error.response)
this
.
error
=
true
this
.
errorMsg
=
error
}
}
},
mounted
:
function
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment