Commit 52da957 1 parent 691a7a6 commit 52da957 Copy full SHA for 52da957
File tree 5 files changed +57
-91
lines changed
5 files changed +57
-91
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <!-- <div class="flex flex-wrap">-->
4
+ <!-- <div-->
5
+ <!-- v-for="(item, i) in items"-->
6
+ <!-- :key="item.id"-->
7
+ <!-- class="relationship-index-field-item h-5"-->
8
+ <!-- :class="{ 'mb-1.5': i < items.length-1 }"-->
9
+ <!-- >-->
10
+ <!-- <div class="flex items-center shrink">-->
11
+ <!-- <div v-if="item.hasOwnProperty('published') && item.published !== null"-->
12
+ <!-- class="little-dot h-1 w-1 rtl:ml-1 ltr:mr-1" :class="[item.published ? 'bg-green-600' : 'bg-gray-400 dark:bg-dark-200']" />-->
13
+ <!-- <a :href="item.edit_url" :title="item.title" v-text="item.title" />-->
14
+ <!-- </div>-->
15
+ <!-- </div>-->
16
+ <!-- </div>-->
17
+ <!-- <button v-if="hasMore && ! showingAll" @click.stop="showAll" class="mt-1 text-blue text-2xs" v-text="__('messages.view_more_count', {count: value.length - 2})" />-->
18
+ <!-- <button v-if="showingAll" @click.stop="hideExtra" class="mt-1 text-blue text-2xs" v-text="__('Hide')" />-->
19
+
20
+ <div class =" flex items-center" >
21
+ <div class =" flex-1" >
22
+ <div class =" truncate" >
23
+ <a v-if =" value.type === 'user' && value.viewable" :href =" value.edit_url" class =" truncate v-popper--has-tooltip" >
24
+ {{ value.name }}
25
+ </a >
26
+ <div v-else-if =" value.type === 'guest'" class =" truncate v-popper--has-tooltip" >
27
+ {{ value.name }}
28
+ <div class =" status-index-field select-none status-draft ml-2" >Guest</div >
29
+ </div >
30
+ <div v-else v-text =" value.name" />
31
+ </div >
32
+ </div >
33
+ </div >
34
+ </div >
35
+ </template >
36
+
37
+ <script >
38
+ export default {
39
+ mixins: [IndexFieldtype],
40
+ }
41
+ </script >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import OrderReceiptFieldtype from './components/Fieldtypes/OrderReceiptFieldtype
3
3
import MoneyFieldtype from './components/Fieldtypes/MoneyFieldtype.vue'
4
4
import ProductVariantsFieldtype from './components/Fieldtypes/ProductVariants/ProductVariantsFieldtype.vue'
5
5
import CustomerFieldtype from './components/Fieldtypes/CustomerFieldtype.vue'
6
+ import CustomerFieldtypeIndex from './components/Fieldtypes/CustomerFieldtypeIndex.vue'
6
7
7
8
Statamic . $components . register ( 'order_receipt-fieldtype' , OrderReceiptFieldtype )
8
9
Statamic . $components . register ( 'money-fieldtype' , MoneyFieldtype )
@@ -11,10 +12,7 @@ Statamic.$components.register(
11
12
ProductVariantsFieldtype
12
13
)
13
14
Statamic . $components . register ( 'customer-fieldtype' , CustomerFieldtype )
14
-
15
- // Inputs
16
- import RegionSelector from './components/Inputs/RegionSelector.vue'
17
- Statamic . $components . register ( 'region-selector' , RegionSelector )
15
+ Statamic . $components . register ( 'customer-fieldtype-index' , CustomerFieldtypeIndex )
18
16
19
17
// Listings
20
18
import CouponListing from './components/Listings/CouponListing.vue'
Original file line number Diff line number Diff line change 3
3
namespace DuncanMcClean \SimpleCommerce \Fieldtypes ;
4
4
5
5
use DuncanMcClean \SimpleCommerce \Customers \GuestCustomer ;
6
- use Statamic \Facades \Blueprint ;
7
6
use Statamic \Facades \User ;
8
7
use Statamic \Fields \Field ;
9
8
use Statamic \Fields \Fieldtype ;
@@ -56,4 +55,18 @@ public function preProcess($data)
56
55
'edit_url ' => $ data ->editUrl (),
57
56
];
58
57
}
58
+
59
+ public function preProcessIndex ($ data )
60
+ {
61
+ return $ this ->preProcess ($ data );
62
+ }
63
+
64
+ public function augment ($ value )
65
+ {
66
+ if (! $ value ) {
67
+ return ;
68
+ }
69
+
70
+ return $ value ;
71
+ }
59
72
}
Original file line number Diff line number Diff line change @@ -33,15 +33,4 @@ private function commonKeys(): array
33
33
}
34
34
35
35
// todo: status
36
-
37
- public function customer ()
38
- {
39
- $ customer = $ this ->data ->customer ();
40
-
41
- if ($ customer instanceof GuestCustomer) {
42
- return $ customer ->toArray ();
43
- }
44
-
45
- return $ customer ?->toAugmentedCollection();
46
- }
47
36
}
You can’t perform that action at this time.
0 commit comments