stash
This commit is contained in:
parent
4738651b66
commit
5af3e72218
1 changed files with 8 additions and 27 deletions
|
@ -3,20 +3,23 @@
|
||||||
<i class="avatar | small">
|
<i class="avatar | small">
|
||||||
<font-awesome-icon icon="user"/>
|
<font-awesome-icon icon="user"/>
|
||||||
</i>
|
</i>
|
||||||
<!--span><a href="#">$USER</a> has changed state to <span
|
<span><a href="#">$USER</a> has claimed sipping code
|
||||||
class="badge badge-pill badge-primary" :class="'bg-' + colorLookup">{{ lookupState.text }}</span> at <time
|
<ClipboardButton class="btn btn-primary badge badge-pill" title="Copy shipping code to clipboard" :payload="item.code">{{ item.code }}
|
||||||
|
<font-awesome-icon icon="clipboard"/>
|
||||||
|
</ClipboardButton> of type <span class="badge badge-pill badge-secondary">{{ item.code_type }}</span> for this ticket at <time
|
||||||
:datetime="timestamp">{{ timestamp }}</time>
|
:datetime="timestamp">{{ timestamp }}</time>
|
||||||
</span-->
|
</span>
|
||||||
{{item}}
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import {mapState} from "vuex";
|
import {mapState} from "vuex";
|
||||||
|
import ClipboardButton from "@/components/inputs/ClipboardButton.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TimelineShippingCode',
|
name: 'TimelineShippingCode',
|
||||||
|
components: {ClipboardButton},
|
||||||
props: {
|
props: {
|
||||||
'item': {
|
'item': {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -25,28 +28,6 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['state_options']),
|
...mapState(['state_options']),
|
||||||
lookupState: function () {
|
|
||||||
try {
|
|
||||||
if (this.item.state)
|
|
||||||
return this.state_options.find(state => state.value === this.item.state);
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
text: 'Unknown',
|
|
||||||
value: 'unknown'
|
|
||||||
};
|
|
||||||
},
|
|
||||||
colorLookup: function () {
|
|
||||||
if (this.item.state.startsWith('closed_')) {
|
|
||||||
return 'secondary';
|
|
||||||
} else if (this.item.state.startsWith('pending_')) {
|
|
||||||
return 'warning';
|
|
||||||
} else if (this.item.state.startsWith('waiting_')) {
|
|
||||||
return 'primary';
|
|
||||||
} else {
|
|
||||||
return 'danger';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'timestamp': function () {
|
'timestamp': function () {
|
||||||
return new Date(this.item.timestamp).toLocaleString();
|
return new Date(this.item.timestamp).toLocaleString();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue