Rename report and request props
This commit is contained in:
parent
e4debe06e5
commit
dedd7dc8dc
|
@ -2,10 +2,10 @@
|
||||||
<div class="ui fluid report card">
|
<div class="ui fluid report card">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h4 class="header">
|
<h4 class="header">
|
||||||
<router-link :to="{name: 'manage.moderation.reports.detail', params: {id: obj.uuid}}">
|
<router-link :to="{name: 'manage.moderation.reports.detail', params: {id: report_.uuid}}">
|
||||||
<translate
|
<translate
|
||||||
translate-context="Content/Moderation/Card/Short"
|
translate-context="Content/Moderation/Card/Short"
|
||||||
:translate-params="{id: obj.uuid.substring(0, 8)}"
|
:translate-params="{id: report_.uuid.substring(0, 8)}"
|
||||||
>
|
>
|
||||||
Report %{ id }
|
Report %{ id }
|
||||||
</translate>
|
</translate>
|
||||||
|
@ -28,14 +28,14 @@
|
||||||
</translate>
|
</translate>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div v-if="obj.submitter">
|
<div v-if="report_.submitter">
|
||||||
<actor-link
|
<actor-link
|
||||||
:admin="true"
|
:admin="true"
|
||||||
:actor="obj.submitter"
|
:actor="report_.submitter"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="obj.submitter_email">
|
<div v-else-if="report_.submitter_email">
|
||||||
{{ obj.submitter_email }}
|
{{ report_.submitter_email }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<report-category-dropdown
|
<report-category-dropdown
|
||||||
:value="obj.type"
|
:value="report_.type"
|
||||||
@input="update({type: $event})"
|
@input="update({type: $event})"
|
||||||
>
|
>
|
||||||
 
|
 
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<human-date
|
<human-date
|
||||||
:date="obj.creation_date"
|
:date="report_.creation_date"
|
||||||
:icon="true"
|
:icon="true"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
|
@ -80,8 +80,8 @@
|
||||||
Status
|
Status
|
||||||
</translate>
|
</translate>
|
||||||
</td>
|
</td>
|
||||||
<td v-if="obj.is_handled">
|
<td v-if="report_.is_handled">
|
||||||
<span v-if="obj.is_handled">
|
<span v-if="report_.is_handled">
|
||||||
<i class="success check icon" />
|
<i class="success check icon" />
|
||||||
<translate translate-context="Content/*/*/Short">Resolved</translate>
|
<translate translate-context="Content/*/*/Short">Resolved</translate>
|
||||||
</span>
|
</span>
|
||||||
|
@ -100,10 +100,10 @@
|
||||||
</translate>
|
</translate>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div v-if="obj.assigned_to">
|
<div v-if="report_.assigned_to">
|
||||||
<actor-link
|
<actor-link
|
||||||
:admin="true"
|
:admin="true"
|
||||||
:actor="obj.assigned_to"
|
:actor="report_.assigned_to"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<translate
|
<translate
|
||||||
|
@ -122,8 +122,8 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<human-date
|
<human-date
|
||||||
v-if="obj.handled_date"
|
v-if="report_.handled_date"
|
||||||
:date="obj.handled_date"
|
:date="report_.handled_date"
|
||||||
:icon="true"
|
:icon="true"
|
||||||
/>
|
/>
|
||||||
<translate
|
<translate
|
||||||
|
@ -142,7 +142,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<i class="comment icon" />
|
<i class="comment icon" />
|
||||||
{{ obj.notes.length }}
|
{{ report_.notes.length }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -163,11 +163,11 @@
|
||||||
</translate>
|
</translate>
|
||||||
</h3>
|
</h3>
|
||||||
<expandable-div
|
<expandable-div
|
||||||
v-if="obj.summary"
|
v-if="report_.summary"
|
||||||
class="summary"
|
class="summary"
|
||||||
:content="obj.summary"
|
:content="report_.summary"
|
||||||
>
|
>
|
||||||
<div v-html="markdown.makeHtml(obj.summary)" />
|
<div v-html="markdown.makeHtml(report_.summary)" />
|
||||||
</expandable-div>
|
</expandable-div>
|
||||||
</div>
|
</div>
|
||||||
<aside class="column">
|
<aside class="column">
|
||||||
|
@ -177,7 +177,7 @@
|
||||||
</translate>
|
</translate>
|
||||||
</h3>
|
</h3>
|
||||||
<div
|
<div
|
||||||
v-if="!obj.target"
|
v-if="!report_.target"
|
||||||
role="alert"
|
role="alert"
|
||||||
class="ui warning message"
|
class="ui warning message"
|
||||||
>
|
>
|
||||||
|
@ -188,7 +188,7 @@
|
||||||
<router-link
|
<router-link
|
||||||
v-if="target && configs[target.type].urls.getDetail"
|
v-if="target && configs[target.type].urls.getDetail"
|
||||||
class="ui basic button"
|
class="ui basic button"
|
||||||
:to="configs[target.type].urls.getDetail(obj.target_state)"
|
:to="configs[target.type].urls.getDetail(report_.target_state)"
|
||||||
>
|
>
|
||||||
<i class="eye icon" />
|
<i class="eye icon" />
|
||||||
<translate translate-context="Content/Moderation/Link">
|
<translate translate-context="Content/Moderation/Link">
|
||||||
|
@ -198,7 +198,7 @@
|
||||||
<router-link
|
<router-link
|
||||||
v-if="target && configs[target.type].urls.getAdminDetail"
|
v-if="target && configs[target.type].urls.getAdminDetail"
|
||||||
class="ui basic button"
|
class="ui basic button"
|
||||||
:to="configs[target.type].urls.getAdminDetail(obj.target_state)"
|
:to="configs[target.type].urls.getAdminDetail(report_.target_state)"
|
||||||
>
|
>
|
||||||
<i class="wrench icon" />
|
<i class="wrench icon" />
|
||||||
<translate translate-context="Content/Moderation/Link">
|
<translate translate-context="Content/Moderation/Link">
|
||||||
|
@ -218,7 +218,7 @@
|
||||||
{{ configs[target.type].label }}
|
{{ configs[target.type].label }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="obj.target_owner && (!target || target.type !== 'account')">
|
<tr v-if="report_.target_owner && (!target || target.type !== 'account')">
|
||||||
<td>
|
<td>
|
||||||
<translate translate-context="*/*/*">
|
<translate translate-context="*/*/*">
|
||||||
Owner
|
Owner
|
||||||
|
@ -227,15 +227,15 @@
|
||||||
<td>
|
<td>
|
||||||
<actor-link
|
<actor-link
|
||||||
:admin="true"
|
:admin="true"
|
||||||
:actor="obj.target_owner"
|
:actor="report_.target_owner"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<instance-policy-modal
|
<instance-policy-modal
|
||||||
v-if="!obj.target_owner.is_local"
|
v-if="!report_.target_owner.is_local"
|
||||||
class="right floated mini basic"
|
class="right floated mini basic"
|
||||||
type="actor"
|
type="actor"
|
||||||
:target="obj.target_owner.full_username"
|
:target="report_.target_owner.full_username"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -248,19 +248,19 @@
|
||||||
<td>
|
<td>
|
||||||
<actor-link
|
<actor-link
|
||||||
:admin="true"
|
:admin="true"
|
||||||
:actor="obj.target_owner"
|
:actor="report_.target_owner"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<instance-policy-modal
|
<instance-policy-modal
|
||||||
v-if="!obj.target_owner.is_local"
|
v-if="!report_.target_owner.is_local"
|
||||||
class="right floated mini basic"
|
class="right floated mini basic"
|
||||||
type="actor"
|
type="actor"
|
||||||
:target="obj.target_owner.full_username"
|
:target="report_.target_owner.full_username"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="obj.target_state.is_local">
|
<tr v-if="report_.target_state.is_local">
|
||||||
<td>
|
<td>
|
||||||
<translate translate-context="Content/Moderation/*/Noun">
|
<translate translate-context="Content/Moderation/*/Noun">
|
||||||
Domain
|
Domain
|
||||||
|
@ -273,22 +273,22 @@
|
||||||
</translate>
|
</translate>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-else-if="obj.target_state.domain">
|
<tr v-else-if="report_.target_state.domain">
|
||||||
<td>
|
<td>
|
||||||
<router-link :to="{name: 'manage.moderation.domains.detail', params: {id: obj.target_state.domain }}">
|
<router-link :to="{name: 'manage.moderation.domains.detail', params: {id: report_.target_state.domain }}">
|
||||||
<translate translate-context="Content/Moderation/*/Noun">
|
<translate translate-context="Content/Moderation/*/Noun">
|
||||||
Domain
|
Domain
|
||||||
</translate>
|
</translate>
|
||||||
</router-link>
|
</router-link>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ obj.target_state.domain }}
|
{{ report_.target_state.domain }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<instance-policy-modal
|
<instance-policy-modal
|
||||||
class="right floated mini basic"
|
class="right floated mini basic"
|
||||||
type="domain"
|
type="domain"
|
||||||
:target="obj.target_state.domain"
|
:target="report_.target_state.domain"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -324,12 +324,12 @@
|
||||||
</translate>
|
</translate>
|
||||||
</h3>
|
</h3>
|
||||||
<notes-thread
|
<notes-thread
|
||||||
:notes="obj.notes"
|
:notes="report_.notes"
|
||||||
@deleted="handleRemovedNote($event)"
|
@deleted="handleRemovedNote($event)"
|
||||||
/>
|
/>
|
||||||
<note-form
|
<note-form
|
||||||
:target="{type: 'report', uuid: obj.uuid}"
|
:target="{type: 'report', uuid: report_.uuid}"
|
||||||
@created="obj.notes.push($event)"
|
@created="report_.notes.push($event)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
|
@ -340,7 +340,7 @@
|
||||||
</h3>
|
</h3>
|
||||||
<div class="ui labelled icon basic buttons">
|
<div class="ui labelled icon basic buttons">
|
||||||
<button
|
<button
|
||||||
v-if="obj.is_handled === false"
|
v-if="report_.is_handled === false"
|
||||||
:class="['ui', {loading: isLoading}, 'button']"
|
:class="['ui', {loading: isLoading}, 'button']"
|
||||||
@click="resolve(true)"
|
@click="resolve(true)"
|
||||||
>
|
>
|
||||||
|
@ -350,7 +350,7 @@
|
||||||
</translate>
|
</translate>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="obj.is_handled === true"
|
v-if="report_.is_handled === true"
|
||||||
:class="['ui', {loading: isLoading}, 'button']"
|
:class="['ui', {loading: isLoading}, 'button']"
|
||||||
@click="resolve(false)"
|
@click="resolve(false)"
|
||||||
>
|
>
|
||||||
|
@ -363,7 +363,7 @@
|
||||||
v-for="(action, key) in actions"
|
v-for="(action, key) in actions"
|
||||||
>
|
>
|
||||||
<dangerous-button
|
<dangerous-button
|
||||||
v-if="action.dangerous && action.show(obj)"
|
v-if="action.dangerous && action.show(report_)"
|
||||||
:key="key"
|
:key="key"
|
||||||
:class="['ui', {loading: isLoading}, 'button']"
|
:class="['ui', {loading: isLoading}, 'button']"
|
||||||
:action="action.handler"
|
:action="action.handler"
|
||||||
|
@ -413,12 +413,12 @@ export default {
|
||||||
InstancePolicyModal
|
InstancePolicyModal
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
initObj: { type: Object, required: true },
|
report: { type: Object, required: true },
|
||||||
currentState: { type: String, required: false, default: '' }
|
currentState: { type: String, required: false, default: '' }
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
obj: this.initObj,
|
report_: this.report,
|
||||||
markdown: new showdown.Converter(),
|
markdown: new showdown.Converter(),
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
isCollapsed: false,
|
isCollapsed: false,
|
||||||
|
@ -430,10 +430,10 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
configs: entities.getConfigs,
|
configs: entities.getConfigs,
|
||||||
previousState () {
|
previousState () {
|
||||||
if (this.obj.is_applied) {
|
if (this.report_.is_applied) {
|
||||||
// mutation was applied, we use the previous state that is stored
|
// mutation was applied, we use the previous state that is stored
|
||||||
// on the mutation itself
|
// on the mutation itself
|
||||||
return this.obj.previous_state
|
return this.report_.previous_state
|
||||||
}
|
}
|
||||||
// mutation is not applied yet, so we use the current state that was
|
// mutation is not applied yet, so we use the current state that was
|
||||||
// passed to the component, if any
|
// passed to the component, if any
|
||||||
|
@ -454,14 +454,14 @@ export default {
|
||||||
if (this.target.type === 'artist') {
|
if (this.target.type === 'artist') {
|
||||||
namespace = 'library.artists.edit.detail'
|
namespace = 'library.artists.edit.detail'
|
||||||
}
|
}
|
||||||
return this.$router.resolve({ name: namespace, params: { id, editId: this.obj.uuid } }).href
|
return this.$router.resolve({ name: namespace, params: { id, editId: this.report_.uuid } }).href
|
||||||
},
|
},
|
||||||
|
|
||||||
targetFields () {
|
targetFields () {
|
||||||
if (!this.target) {
|
if (!this.target) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
const payload = this.obj.target_state
|
const payload = this.report_.target_state
|
||||||
const fields = this.configs[this.target.type].moderatedFields
|
const fields = this.configs[this.target.type].moderatedFields
|
||||||
return fields.map((fieldConfig) => {
|
return fields.map((fieldConfig) => {
|
||||||
const dummyRepr = (v) => { return v }
|
const dummyRepr = (v) => { return v }
|
||||||
|
@ -476,10 +476,10 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
target () {
|
target () {
|
||||||
if (this.obj.target) {
|
if (this.report_.target) {
|
||||||
return this.obj.target
|
return this.report_.target
|
||||||
} else {
|
} else {
|
||||||
return this.obj.target_state._target
|
return this.report_.target_state._target
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions () {
|
actions () {
|
||||||
|
@ -498,12 +498,12 @@ export default {
|
||||||
modalConfirmLabel: this.$pgettext('*/*/*/Verb', 'Delete'),
|
modalConfirmLabel: this.$pgettext('*/*/*/Verb', 'Delete'),
|
||||||
icon: 'x',
|
icon: 'x',
|
||||||
iconColor: 'danger',
|
iconColor: 'danger',
|
||||||
show: (obj) => { return !!obj.target },
|
show: (report) => { return !!report.target },
|
||||||
dangerous: true,
|
dangerous: true,
|
||||||
handler: () => {
|
handler: () => {
|
||||||
axios.delete(deleteUrl).then((response) => {
|
axios.delete(deleteUrl).then((response) => {
|
||||||
console.log('Target deleted')
|
console.log('Target deleted')
|
||||||
self.obj.target = null
|
self.report_.target = null
|
||||||
self.resolve(true)
|
self.resolve(true)
|
||||||
}, () => {
|
}, () => {
|
||||||
console.log('Error while deleting target')
|
console.log('Error while deleting target')
|
||||||
|
@ -516,13 +516,13 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
update (payload) {
|
update (payload) {
|
||||||
const url = `manage/moderation/reports/${this.obj.uuid}/`
|
const url = `manage/moderation/reports/${this.report_.uuid}/`
|
||||||
const self = this
|
const self = this
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
setUpdate(payload, this.updating, true)
|
setUpdate(payload, this.updating, true)
|
||||||
axios.patch(url, payload).then((response) => {
|
axios.patch(url, payload).then((response) => {
|
||||||
self.$emit('updated', payload)
|
self.$emit('updated', payload)
|
||||||
Object.assign(self.obj, payload)
|
Object.assign(self.report_, payload)
|
||||||
self.isLoading = false
|
self.isLoading = false
|
||||||
setUpdate(payload, self.updating, false)
|
setUpdate(payload, self.updating, false)
|
||||||
}, () => {
|
}, () => {
|
||||||
|
@ -531,13 +531,13 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
resolve (v) {
|
resolve (v) {
|
||||||
const url = `manage/moderation/reports/${this.obj.uuid}/`
|
const url = `manage/moderation/reports/${this.report_.uuid}/`
|
||||||
const self = this
|
const self = this
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
axios.patch(url, { is_handled: v }).then((response) => {
|
axios.patch(url, { is_handled: v }).then((response) => {
|
||||||
self.$emit('handled', v)
|
self.$emit('handled', v)
|
||||||
self.isLoading = false
|
self.isLoading = false
|
||||||
self.obj.is_handled = v
|
self.report_.is_handled = v
|
||||||
let increment
|
let increment
|
||||||
if (v) {
|
if (v) {
|
||||||
self.isCollapsed = true
|
self.isCollapsed = true
|
||||||
|
@ -551,7 +551,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleRemovedNote (uuid) {
|
handleRemovedNote (uuid) {
|
||||||
this.obj.notes = this.obj.notes.filter((note) => {
|
this.report_.notes = this.report_.notes.filter((note) => {
|
||||||
return note.uuid !== uuid
|
return note.uuid !== uuid
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
<div class="ui fluid user-request card">
|
<div class="ui fluid user-request card">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h4 class="header">
|
<h4 class="header">
|
||||||
<router-link :to="{name: 'manage.moderation.requests.detail', params: {id: obj.uuid}}">
|
<router-link :to="{name: 'manage.moderation.requests.detail', params: {id: user_request.uuid}}">
|
||||||
<translate
|
<translate
|
||||||
translate-context="Content/Moderation/Card/Short"
|
translate-context="Content/Moderation/Card/Short"
|
||||||
:translate-params="{id: obj.uuid.substring(0, 8)}"
|
:translate-params="{id: user_request.uuid.substring(0, 8)}"
|
||||||
>
|
>
|
||||||
Request %{ id }
|
Request %{ id }
|
||||||
</translate>
|
</translate>
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
<td>
|
<td>
|
||||||
<actor-link
|
<actor-link
|
||||||
:admin="true"
|
:admin="true"
|
||||||
:actor="obj.submitter"
|
:actor="user_request.submitter"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<human-date
|
<human-date
|
||||||
:date="obj.creation_date"
|
:date="user_request.creation_date"
|
||||||
:icon="true"
|
:icon="true"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
|
@ -60,19 +60,19 @@
|
||||||
</translate>
|
</translate>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<template v-if="obj.status === 'pending'">
|
<template v-if="user_request.status === 'pending'">
|
||||||
<i class="warning hourglass icon" />
|
<i class="warning hourglass icon" />
|
||||||
<translate translate-context="Content/Library/*/Short">
|
<translate translate-context="Content/Library/*/Short">
|
||||||
Pending
|
Pending
|
||||||
</translate>
|
</translate>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="obj.status === 'refused'">
|
<template v-else-if="user_request.status === 'refused'">
|
||||||
<i class="danger x icon" />
|
<i class="danger x icon" />
|
||||||
<translate translate-context="Content/*/*/Short">
|
<translate translate-context="Content/*/*/Short">
|
||||||
Refused
|
Refused
|
||||||
</translate>
|
</translate>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="obj.status === 'approved'">
|
<template v-else-if="user_request.status === 'approved'">
|
||||||
<i class="success check icon" />
|
<i class="success check icon" />
|
||||||
<translate translate-context="Content/*/*/Short">
|
<translate translate-context="Content/*/*/Short">
|
||||||
Approved
|
Approved
|
||||||
|
@ -87,10 +87,10 @@
|
||||||
</translate>
|
</translate>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div v-if="obj.assigned_to">
|
<div v-if="user_request.assigned_to">
|
||||||
<actor-link
|
<actor-link
|
||||||
:admin="true"
|
:admin="true"
|
||||||
:actor="obj.assigned_to"
|
:actor="user_request.assigned_to"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<translate
|
<translate
|
||||||
|
@ -109,8 +109,8 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<human-date
|
<human-date
|
||||||
v-if="obj.handled_date"
|
v-if="user_request.handled_date"
|
||||||
:date="obj.handled_date"
|
:date="user_request.handled_date"
|
||||||
:icon="true"
|
:icon="true"
|
||||||
/>
|
/>
|
||||||
<translate
|
<translate
|
||||||
|
@ -129,7 +129,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<i class="comment icon" />
|
<i class="comment icon" />
|
||||||
{{ obj.notes.length }}
|
{{ user_request.notes.length }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -154,15 +154,15 @@
|
||||||
This user wants to sign-up on your pod.
|
This user wants to sign-up on your pod.
|
||||||
</translate>
|
</translate>
|
||||||
</p>
|
</p>
|
||||||
<template v-if="obj.metadata">
|
<template v-if="user_request.metadata">
|
||||||
<div class="ui hidden divider" />
|
<div class="ui hidden divider" />
|
||||||
<div
|
<div
|
||||||
v-for="k in Object.keys(obj.metadata)"
|
v-for="k in Object.keys(user_request.metadata)"
|
||||||
:key="k"
|
:key="k"
|
||||||
>
|
>
|
||||||
<h4>{{ k }}</h4>
|
<h4>{{ k }}</h4>
|
||||||
<p v-if="obj.metadata[k] && obj.metadata[k].length">
|
<p v-if="user_request.metadata[k] && user_request.metadata[k].length">
|
||||||
{{ obj.metadata[k] }}
|
{{ user_request.metadata[k] }}
|
||||||
</p>
|
</p>
|
||||||
<translate
|
<translate
|
||||||
v-else
|
v-else
|
||||||
|
@ -175,7 +175,7 @@
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<aside class="column">
|
<aside class="column">
|
||||||
<div v-if="obj.status != 'approved'">
|
<div v-if="user_request.status != 'approved'">
|
||||||
<h3>
|
<h3>
|
||||||
<translate translate-context="Content/*/*/Noun">
|
<translate translate-context="Content/*/*/Noun">
|
||||||
Actions
|
Actions
|
||||||
|
@ -183,7 +183,7 @@
|
||||||
</h3>
|
</h3>
|
||||||
<div class="ui labelled icon basic buttons">
|
<div class="ui labelled icon basic buttons">
|
||||||
<button
|
<button
|
||||||
v-if="obj.status === 'pending' || obj.status === 'refused'"
|
v-if="user_request.status === 'pending' || user_request.status === 'refused'"
|
||||||
:class="['ui', {loading: isLoading}, 'button']"
|
:class="['ui', {loading: isLoading}, 'button']"
|
||||||
@click="approve(true)"
|
@click="approve(true)"
|
||||||
>
|
>
|
||||||
|
@ -193,7 +193,7 @@
|
||||||
</translate>
|
</translate>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="obj.status === 'pending'"
|
v-if="user_request.status === 'pending'"
|
||||||
:class="['ui', {loading: isLoading}, 'button']"
|
:class="['ui', {loading: isLoading}, 'button']"
|
||||||
@click="approve(false)"
|
@click="approve(false)"
|
||||||
>
|
>
|
||||||
|
@ -210,12 +210,12 @@
|
||||||
</translate>
|
</translate>
|
||||||
</h3>
|
</h3>
|
||||||
<notes-thread
|
<notes-thread
|
||||||
:notes="obj.notes"
|
:notes="user_request.notes"
|
||||||
@deleted="handleRemovedNote($event)"
|
@deleted="handleRemovedNote($event)"
|
||||||
/>
|
/>
|
||||||
<note-form
|
<note-form
|
||||||
:target="{type: 'request', uuid: obj.uuid}"
|
:target="{type: 'request', uuid: user_request.uuid}"
|
||||||
@created="obj.notes.push($event)"
|
@created="user_request.notes.push($event)"
|
||||||
/>
|
/>
|
||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
|
@ -235,26 +235,26 @@ export default {
|
||||||
NotesThread
|
NotesThread
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
initObj: { type: Object, required: true }
|
userRequest: { type: Object, required: true }
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
markdown: new showdown.Converter(),
|
markdown: new showdown.Converter(),
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
isCollapsed: false,
|
isCollapsed: false,
|
||||||
obj: this.initObj
|
user_request: this.userRequest
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
approve (v) {
|
approve (v) {
|
||||||
const url = `manage/moderation/requests/${this.obj.uuid}/`
|
const url = `manage/moderation/requests/${this.user_request.uuid}/`
|
||||||
const self = this
|
const self = this
|
||||||
const newStatus = v ? 'approved' : 'refused'
|
const newStatus = v ? 'approved' : 'refused'
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
axios.patch(url, { status: newStatus }).then((response) => {
|
axios.patch(url, { status: newStatus }).then((response) => {
|
||||||
self.$emit('handled', newStatus)
|
self.$emit('handled', newStatus)
|
||||||
self.isLoading = false
|
self.isLoading = false
|
||||||
self.obj.status = newStatus
|
self.user_request.status = newStatus
|
||||||
if (v) {
|
if (v) {
|
||||||
self.isCollapsed = true
|
self.isCollapsed = true
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleRemovedNote (uuid) {
|
handleRemovedNote (uuid) {
|
||||||
this.obj.notes = this.obj.notes.filter((note) => {
|
this.user_request.notes = this.user_request.notes.filter((note) => {
|
||||||
return note.uuid !== uuid
|
return note.uuid !== uuid
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
>
|
>
|
||||||
<div :class="['ui', 'centered', 'active', 'inline', 'loader']" />
|
<div :class="['ui', 'centered', 'active', 'inline', 'loader']" />
|
||||||
</div>
|
</div>
|
||||||
<template v-if="object">
|
<template v-if="report">
|
||||||
<div class="ui vertical stripe segment">
|
<div class="ui vertical stripe segment">
|
||||||
<report-card :obj="object" />
|
<report-card :report="report" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</main>
|
</main>
|
||||||
|
@ -27,7 +27,7 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
object: null
|
report: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
@ -39,7 +39,7 @@ export default {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
const url = `manage/moderation/reports/${this.id}/`
|
const url = `manage/moderation/reports/${this.id}/`
|
||||||
axios.get(url).then(response => {
|
axios.get(url).then(response => {
|
||||||
self.object = response.data
|
self.report = response.data
|
||||||
self.isLoading = false
|
self.isLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
<report-card
|
<report-card
|
||||||
v-for="obj in result.results"
|
v-for="obj in result.results"
|
||||||
:key="obj.uuid"
|
:key="obj.uuid"
|
||||||
:obj="obj"
|
:report="obj"
|
||||||
@handled="fetchData"
|
@handled="fetchData"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
>
|
>
|
||||||
<div :class="['ui', 'centered', 'active', 'inline', 'loader']" />
|
<div :class="['ui', 'centered', 'active', 'inline', 'loader']" />
|
||||||
</div>
|
</div>
|
||||||
<template v-if="object">
|
<template v-if="user_request">
|
||||||
<div class="ui vertical stripe segment">
|
<div class="ui vertical stripe segment">
|
||||||
<user-request-card :obj="object" />
|
<user-request-card :user-request="user_request" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</main>
|
</main>
|
||||||
|
@ -27,7 +27,7 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
object: null
|
user_request: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
@ -39,7 +39,7 @@ export default {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
const url = `manage/moderation/requests/${this.id}/`
|
const url = `manage/moderation/requests/${this.id}/`
|
||||||
axios.get(url).then(response => {
|
axios.get(url).then(response => {
|
||||||
self.object = response.data
|
self.user_request = response.data
|
||||||
self.isLoading = false
|
self.isLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<user-request-card
|
<user-request-card
|
||||||
v-for="obj in result.results"
|
v-for="obj in result.results"
|
||||||
:key="obj.uuid"
|
:key="obj.uuid"
|
||||||
:obj="obj"
|
:user-request="obj"
|
||||||
@handled="fetchData"
|
@handled="fetchData"
|
||||||
/>
|
/>
|
||||||
<div class="ui center aligned basic segment">
|
<div class="ui center aligned basic segment">
|
||||||
|
|
Loading…
Reference in New Issue