99 deselect-label =" Can't remove this value"
1010 track-by =" name"
1111 label =" name"
12- placeholder =" Select your eCommerce platform"
12+ placeholder =" Select your e-commerce platform"
1313 >
1414 <template
1515 slot="singleLabel"
@@ -61,7 +61,7 @@ export default {
6161
6262 computed: {
6363 categories () {
64- return this .$site .themeConfig .CATEGORIES ;
64+ return this .$site .themeConfig .CATEGORY ;
6565 },
6666
6767 options () {
@@ -89,24 +89,28 @@ export default {
8989 return allIntegrations;
9090 }
9191
92- // Return integrations without specific compabilities or including currently selected eCommerce platform
93- return allIntegrations .filter (({ compatibility }) => {
94- return ! compatibility
95- || ! compatibility .length
96- || compatibility .includes (this .selected .value );
92+ return allIntegrations .filter (({ link }) => {
93+ // If link is a string, the integration can be used for all e-commerce platforms
94+ if (typeof link === ' string' ) {
95+ return true ;
96+ }
97+
98+ // If link is an array, it only works with specified e-commerce platforms
99+ return link .map (({ name }) => name).includes (this .selected .value );
97100 });
98101 },
99102
100103 sortedIntegrations () {
101104 return this .availableIntegrations .sort ((a , b ) => {
102- const getIndex = (s ) => {
103- return Object
104- .values (this .$site .themeConfig .STATUSES )
105- .findIndex (status => status === s);
106- }
107-
108- // Order integrations in reversed order of available STATUSES
109- return getIndex (b .status ) - getIndex (a .status );
105+ const getStatusIndex = (s ) => s !== this .$site .themeConfig .STATUS .WIP ;
106+
107+ /**
108+ * Order integrations by:
109+ * - status (WIP integrations at the end)
110+ * - name
111+ */
112+ return getStatusIndex (b .status ) - getStatusIndex (a .status )
113+ || a .name .localeCompare (b .name );
110114 })
111115 }
112116 }
@@ -117,21 +121,15 @@ export default {
117121
118122< style scoped>
119123.list {
120- display: grid;
121- grid- auto- columns: 1fr ;
122- grid- auto- rows: 1fr ;
123- grid- template- columns: 1fr 1fr ;
124- gap: 20px 20px ;
124+ display: grid;
125+ grid- auto- columns: 1fr ;
126+ grid- template- columns: 1fr ;
127+ gap: 20px 20px ;
125128 margin: 20px 0 ;
126129}
127130
128131.multiselect {
129132 margin- bottom: 20px ;
130133}
131134
132- @media (max - width : 1023px ) {
133- .list {
134- grid- template- columns: 1fr ;
135- }
136- }
137135< / style>
0 commit comments