Skip to content

Commit a182ef8

Browse files
authored
Merge pull request #72 from webreinvent/2.x-feature/content-fixes
2.x feature -> 2.x develop | content fixes
2 parents 9c3816f + b6774e2 commit a182ef8

File tree

13 files changed

+403
-403
lines changed

13 files changed

+403
-403
lines changed

Http/Controllers/Backend/ContentTypesController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ public function getAssets(Request $request)
4848
$data['empty_item'][$column] = null;
4949
}
5050

51+
$data['empty_item']['content_statuses'] = [
52+
'draft',
53+
'published',
54+
'protected',
55+
];
56+
5157
$data['field_types'] = FieldType::select('id', 'name', 'slug', 'meta')
5258
->get();
5359

Http/Controllers/Backend/ContentsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public function deleteItem(Request $request,$content_slug,$id)
237237
}
238238
}
239239
//----------------------------------------------------------
240-
public function itemAction(Request $request,$id,$action)
240+
public function itemAction(Request $request,$content_type_slug,$id,$action)
241241
{
242242
try{
243243
return Content::itemAction($request,$id,$action);

Models/Content.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,15 +364,15 @@ public static function itemAction($request, $id, $type): array
364364
{
365365
switch($type)
366366
{
367-
case 'activate':
367+
case 'published':
368368
self::where('id', $id)
369369
->withTrashed()
370-
->update(['status' => 1]);
370+
->update(['status' => 'published']);
371371
break;
372-
case 'deactivate':
372+
case 'draft':
373373
self::where('id', $id)
374374
->withTrashed()
375-
->update(['status' => null]);
375+
->update(['status' => 'draft']);
376376
break;
377377
case 'trash':
378378
self::find($id)->delete();

Models/ContentBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ public static function storeFormGroups(Content $content, $groups, $type = null)
891891
if(!$field['content']){
892892
$row_to_delete_ids = array_diff($relatable_ids, []);
893893
}else{
894-
$row_to_delete_ids = array_diff($relatable_ids, [$field['content']]);
894+
$row_to_delete_ids = array_diff($relatable_ids, $field['content']);
895895
}
896896

897897
if(count($row_to_delete_ids) > 0)

Models/ContentType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function getContentStatusesAttribute($value)
100100
{
101101
return json_decode($value);
102102
}
103-
return null;
103+
return [];
104104
}
105105
//-------------------------------------------------
106106
public function setMetaAttribute($value)

Models/ContentTypeBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function getContentStatusesAttribute($value)
9999
{
100100
return json_decode($value);
101101
}
102-
return null;
102+
return [];
103103
}
104104
//-------------------------------------------------
105105
public function setMetaAttribute($value)

Resources/assets/build/index.js

Lines changed: 356 additions & 355 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/assets/build/vanilla-picker-NKbIFE8h.js

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Vue/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
"primevue": "3.35.0",
1717
"qs": "^6.11.0",
1818
"quill": "^1.3.7",
19+
"uuid": "^9.0.1",
1920
"vue": "^3.2.37",
2021
"vue-router": "^4.1.2",
22+
"vue3-treeselect": "^0.1.10",
2123
"vuedraggable": "^4.1.0"
2224
},
2325
"devDependencies": {

Vue/pages/contents/components/ContentFields.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const props = defineProps({
6565
<div class="w-full flex flex-column gap-1">
6666
<label class="font-medium line-height-1 text-xs">{{ field.name }}</label>
6767
<div v-if="!field.content || typeof field.content === 'string'
68-
|| typeof field.content === 'number' || typeof field.content === 'object'
68+
|| typeof field.content === 'number'
6969
|| store.assets.non_repeatable_fields.includes(field.type.slug)"
7070
class="flex justify-content-between align-items-start gap-3 w-full">
7171
<div class="flex-grow-1">

0 commit comments

Comments
 (0)