@mapomodule/uikit 1.0.0-alpha.4 → 1.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +148 -0
- package/components/Detail/Detail.vue +181 -104
- package/components/Detail/DetailField.vue +20 -16
- package/components/Detail/DetailLangSwitch.vue +1 -1
- package/components/Detail/defaults.js +31 -25
- package/components/DropArea.vue +3 -3
- package/components/List/List.vue +100 -40
- package/components/List/ListActions.vue +56 -17
- package/components/List/ListFilters.vue +127 -113
- package/components/List/ListHead.vue +30 -12
- package/components/List/ListQuickEdit.vue +198 -55
- package/components/List/ListTable.vue +225 -77
- package/components/Login.vue +14 -5
- package/components/MediaManager/MediaEditor.vue +253 -107
- package/components/MediaManager/MediaFolders.vue +125 -41
- package/components/MediaManager/MediaGallery.vue +56 -52
- package/components/MediaManager/MediaManager.vue +114 -74
- package/components/MediaManager/MediaManagerDialog.vue +19 -22
- package/components/MediaManager/MediaPreview.vue +180 -0
- package/components/MediaManager/MediaUploader.vue +35 -32
- package/components/SnackBar.vue +3 -4
- package/components/fields/DateField.vue +8 -3
- package/components/fields/FksField.vue +60 -0
- package/components/fields/MediaField.vue +24 -6
- package/components/fields/MediaM2mField.vue +8 -3
- package/components/fields/SeoPreview.vue +89 -0
- package/components/fields/{TinyMce → wygEditor}/defaults.js +1 -1
- package/components/fields/{TinyMce → wygEditor}/utils/events.js +0 -0
- package/components/fields/{TinyMce → wygEditor}/utils/mapomedia.plugin.js +0 -0
- package/components/fields/{TinyMce → wygEditor}/utils/script.injector.js +0 -0
- package/components/fields/{TinyMce/TinyMce.vue → wygEditor/wygEditor.vue} +40 -21
- package/components/layout/Sidebar/Sidebar.vue +46 -24
- package/components/layout/Sidebar/SidebarFooter.vue +42 -46
- package/components/layout/Sidebar/SidebarList.vue +13 -14
- package/components/layout/Sidebar/SidebarListItem.vue +81 -38
- package/components/layout/Topbar/Topbar.vue +3 -36
- package/components/layout/routebuilder.js +1 -1
- package/layouts/default.vue +3 -14
- package/package.json +3 -3
- package/pages/index.vue +0 -1
- package/components/fields/M2mField.vue +0 -95
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,154 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-alpha.8](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2022-01-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **detail:** fix lang switch crop in small devices ([fc05f1e](https://github.com/lotrekagency/mapo/commit/fc05f1e437c8c9318354a95c9edd19fb12e0cff9))
|
|
12
|
+
* **detailfield:** fix default prop handling ([b3297f1](https://github.com/lotrekagency/mapo/commit/b3297f10a1ca2bf8db1690c6dcf680baaf96f71b))
|
|
13
|
+
* **langs:** fixed lang detection from model api ([1653740](https://github.com/lotrekagency/mapo/commit/165374080e91571e89b1fc48f43983b681b1ffc0))
|
|
14
|
+
* **list:** remove quickadd if user cannot add ([aef919e](https://github.com/lotrekagency/mapo/commit/aef919ee94c71475b812378126369233df09d055))
|
|
15
|
+
* **login:** fix bad handling of login call ([2d73570](https://github.com/lotrekagency/mapo/commit/2d73570720c91cf8922ed750adeb8cf7f89360c7))
|
|
16
|
+
* **m2m:** let v-model be an object to let field manage fk ([5500870](https://github.com/lotrekagency/mapo/commit/550087025235adf5016ea9340090b3ce1278e126))
|
|
17
|
+
* **mediamanager:** fix linked models ([35611ed](https://github.com/lotrekagency/mapo/commit/35611ed104643c72d5317beef3349928eed09ee8))
|
|
18
|
+
* **permissions:** collect route middleware info directly from ([e1937cc](https://github.com/lotrekagency/mapo/commit/e1937cc835cd4d331a43c4bbf9581c16bfc03f41))
|
|
19
|
+
* **quickedit:** fix close button position ([8e15d47](https://github.com/lotrekagency/mapo/commit/8e15d47c6dd69dfbb2cbf3f70f2fb342202bf9a2))
|
|
20
|
+
* **quickedit:** temporary disable patch diff to fix translation problems ([1ec4b04](https://github.com/lotrekagency/mapo/commit/1ec4b04723d2d25ffdabfb5e5e69dd7c66735fe4))
|
|
21
|
+
* **sidebar:** fix footer menu auth ([6a986ba](https://github.com/lotrekagency/mapo/commit/6a986ba6def87a341e2bf670278716811336c725))
|
|
22
|
+
* **snackbar:** fix snack color ([9fcc053](https://github.com/lotrekagency/mapo/commit/9fcc053a1a52c3970706dcb4393be3aec0aa8c55))
|
|
23
|
+
* fix m2mfield for null values ([fbdf045](https://github.com/lotrekagency/mapo/commit/fbdf0456660b4cc6f46ac7d0ca40278451e87059))
|
|
24
|
+
* **uikit:** fix color mismatch in some components ([06cc23c](https://github.com/lotrekagency/mapo/commit/06cc23c8835c891e9ff15d277ba8bc4e54f1b8b8))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* **detail:** added permission logics to detail component ([475d063](https://github.com/lotrekagency/mapo/commit/475d063ac1979380ec64afc057786a6b2ec142ba))
|
|
30
|
+
* **detail:** added permission logics to list actions component ([eebe25a](https://github.com/lotrekagency/mapo/commit/eebe25a8e0ef6f7d89dd7e1eca762d65ecc090a0))
|
|
31
|
+
* **detail:** added permission logics to list component ([83343ca](https://github.com/lotrekagency/mapo/commit/83343ca4038002d4528de0ec5d746c4420d5d157))
|
|
32
|
+
* **detail:** added permission logics to list head component ([95a37a2](https://github.com/lotrekagency/mapo/commit/95a37a2139726eed85824cf425dd15022d37bf88))
|
|
33
|
+
* **detail:** show backend error messages on model update ([a456a81](https://github.com/lotrekagency/mapo/commit/a456a81610b7b95e231f33cc35f2c87fb9a80071))
|
|
34
|
+
* **fields:** added readonly prop to date custom field ([682bab5](https://github.com/lotrekagency/mapo/commit/682bab59ce88a0dbfa1be644103ccf8b0cb6bf41))
|
|
35
|
+
* **fields:** added readonly prop to various custom fields ([ed45190](https://github.com/lotrekagency/mapo/commit/ed45190cec6250bb26e91b26dc570e07e0fd800c))
|
|
36
|
+
* **m2m:** added autocomplete by default ([1956427](https://github.com/lotrekagency/mapo/commit/19564271f71a289d840a3e1200098e911935da4f))
|
|
37
|
+
* **m2m:** autodisable chips if multiple = false ([5dcc88d](https://github.com/lotrekagency/mapo/commit/5dcc88d671b4c06bd378573a27c9bc1b44b4b736))
|
|
38
|
+
* **m2m:** restyle m2m field ([bb49f3d](https://github.com/lotrekagency/mapo/commit/bb49f3dbf9ba3d6fb2a78e69113645fdde2e1cce))
|
|
39
|
+
* **M2m:** added max height ([d32a383](https://github.com/lotrekagency/mapo/commit/d32a3831f903d20924408536b2921fba3f5e683e))
|
|
40
|
+
* **quickedit:** add close button on hover ([c365f51](https://github.com/lotrekagency/mapo/commit/c365f515dbb2edbf9d964c63b170bf3247309d70))
|
|
41
|
+
* **quickedit:** added non field errors ([4b63e73](https://github.com/lotrekagency/mapo/commit/4b63e734818a0d690831c39ccbe73403400dffd4))
|
|
42
|
+
* **quickedit:** merge detail component logics in to quickedit ([691f610](https://github.com/lotrekagency/mapo/commit/691f610b156f58a5d30598d89bf06425d90451d8))
|
|
43
|
+
* **sidebar:** hide not navigable entries depending on user permissions ([349dd6c](https://github.com/lotrekagency/mapo/commit/349dd6c102cdf80d25de4db988f1ccf29047dfcd))
|
|
44
|
+
* **uikit:** more consistent ui style ([54c464f](https://github.com/lotrekagency/mapo/commit/54c464f0c8ea86d87e5ae2004b7744bb4126ebba))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# [1.0.0-alpha.7](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2022-01-13)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Bug Fixes
|
|
54
|
+
|
|
55
|
+
* **detail:** fix v-card content margin on detail component ([f07d5c1](https://github.com/lotrekagency/mapo/commit/f07d5c1581e71407e79fce95c8dc10109196ed0b))
|
|
56
|
+
* **detail:** remove lang swtch if only one lang is selected ([35cf58a](https://github.com/lotrekagency/mapo/commit/35cf58aa17ce4350f983643a8182fdf795dd4abb))
|
|
57
|
+
* **detail:** remove v-container from detail component to fix sizing ([2947652](https://github.com/lotrekagency/mapo/commit/29476528a6c13325c4da49a3e2aa842302e6bd04))
|
|
58
|
+
* **list:** fix search box for very small displays ([edf7287](https://github.com/lotrekagency/mapo/commit/edf7287c6974b8bb1412d9e0fb8bc4b1f1b48480))
|
|
59
|
+
* **media:** fix reset on media dialog ([3727502](https://github.com/lotrekagency/mapo/commit/3727502b59c9fa809b4dbc139b0cd01198008a18))
|
|
60
|
+
* **media:** reset media dialog after close ([5aded79](https://github.com/lotrekagency/mapo/commit/5aded794dbfb5482119db45bfb975e7241f86f15))
|
|
61
|
+
* **mediamanager:** better display of folder path in media manager ([bdc5692](https://github.com/lotrekagency/mapo/commit/bdc569264164e61af1c210aeb1c5da9d5b21220a))
|
|
62
|
+
* **mediamanager:** better ui for selection ([2307d38](https://github.com/lotrekagency/mapo/commit/2307d38a5a4e0fe838b5f9173692e132fe69e3be))
|
|
63
|
+
* **mediamanager:** fix backbutton background in media editor ([315d9df](https://github.com/lotrekagency/mapo/commit/315d9df2a9021ee1ea1328b4d959f0fd5f652f47))
|
|
64
|
+
* **mediamanager:** fix corb errors loading image preview in mediamanager ([7f34e34](https://github.com/lotrekagency/mapo/commit/7f34e34dfdfe4380d1704c0c8dda0a507676aeae))
|
|
65
|
+
* **mediamanager:** fix DOMException: The play() request was interrupted ([89a2a3e](https://github.com/lotrekagency/mapo/commit/89a2a3e1bb47178245ca7d131bdfedbcbcc41c17))
|
|
66
|
+
* **mediamanager:** fix editor opening ([3888652](https://github.com/lotrekagency/mapo/commit/3888652b0441cd17f0468db57fd895afd97a3625))
|
|
67
|
+
* **mediamanager:** make editing animation smooth ([81bd34b](https://github.com/lotrekagency/mapo/commit/81bd34b04d0d561317a1928dcdc796adc539350b))
|
|
68
|
+
* **mediamanager:** minor fixes to mediamanager ui ([a7b6089](https://github.com/lotrekagency/mapo/commit/a7b6089c38af9a6079bd8bebfeddd2dcff0b2c75))
|
|
69
|
+
* **mediamanager:** prevent media type check fail if no media type present ([2ee88fe](https://github.com/lotrekagency/mapo/commit/2ee88fed81d527434cf854e68ff8210247b2cf39))
|
|
70
|
+
* **mediamanagerdialog:** better positioning on small device of media manager dialog content ([9da147c](https://github.com/lotrekagency/mapo/commit/9da147c7e2d356da7f74e2edcbf05c5dafcbd94d))
|
|
71
|
+
* **sidebar:** fix nested SidebarListItems not triggering active class when the list-item is not a link ([9e92971](https://github.com/lotrekagency/mapo/commit/9e929710e74946c1470c29c007d780a1e712170b))
|
|
72
|
+
* **tinymce:** added missing al text to image tag ([55a3926](https://github.com/lotrekagency/mapo/commit/55a39261b3e449381d974eaa1b328a46dffb6f51))
|
|
73
|
+
* **uikit:** fix some content disposition in main layout ([1e9c79b](https://github.com/lotrekagency/mapo/commit/1e9c79b6b80d781c5aded10800c9df255b6ef8e8))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Features
|
|
77
|
+
|
|
78
|
+
* **media:** added mime type filtering ([da01658](https://github.com/lotrekagency/mapo/commit/da016585d450143f6419d98a7f53ee5ec8cf7358))
|
|
79
|
+
* **media:** added search input ([a1ac6ae](https://github.com/lotrekagency/mapo/commit/a1ac6aef8d28a248431cd80955c5a1446f41f608))
|
|
80
|
+
* **media:** selection prop 2-way binded ([e87f21c](https://github.com/lotrekagency/mapo/commit/e87f21c085e0cf0a61a99025d9f5e7970285ab72))
|
|
81
|
+
* **mediafield:** update media field to handle files ([5158108](https://github.com/lotrekagency/mapo/commit/51581086d96e09af31471721f0ea32df3fe58e09))
|
|
82
|
+
* **mediamanager:** added audio playback for audio files ([6aec9f7](https://github.com/lotrekagency/mapo/commit/6aec9f7b749c5002832fd194d565742b99a4b700))
|
|
83
|
+
* **mediamanager:** added icon for media that are not images ([d77f17b](https://github.com/lotrekagency/mapo/commit/d77f17b2d77db7bf4dc387be0b6d3892a4772b02))
|
|
84
|
+
* **mediamanager:** added link to img shortcut button in editor ([1dd446f](https://github.com/lotrekagency/mapo/commit/1dd446f76df1d3a7e71fdefb81ad60de1fdb4e93))
|
|
85
|
+
* **mediamanager:** added the possibility to change the media file using same url of the old file ([f21f383](https://github.com/lotrekagency/mapo/commit/f21f383b6f3f0176f806688a50ebff93a53d3203))
|
|
86
|
+
* **mediamanager:** added video preview for video mime types ([55fc423](https://github.com/lotrekagency/mapo/commit/55fc423c03265fb2c17bc42f1be0ba511928267c))
|
|
87
|
+
* **mediamanager:** many ui enhancements for mediamanager ([30ab3ff](https://github.com/lotrekagency/mapo/commit/30ab3ff89dc0ff3b9a210cfd32e2a874dfc073a6))
|
|
88
|
+
* **mediamanager:** media folders manager graphic enhancements ([0e8e7ec](https://github.com/lotrekagency/mapo/commit/0e8e7ec35482d043c42c88c38c9d32c8fa8e54e9))
|
|
89
|
+
* **sidebar:** added spidermenu for nested routes ([084029d](https://github.com/lotrekagency/mapo/commit/084029de717f29412b045fe703c4cfbd19353400))
|
|
90
|
+
* **tinymce:** added callback to manage video and documents insertions with mapomedia plugin ([b4e6f63](https://github.com/lotrekagency/mapo/commit/b4e6f6362e025010614e7ca8351a9d1e3af08650))
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
# [1.0.0-alpha.6](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2021-12-26)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### Bug Fixes
|
|
100
|
+
|
|
101
|
+
* **uikit:** fix sidebar footer items not collapsing on mini variant ([04c510e](https://github.com/lotrekagency/mapo/commit/04c510ee87bd7b74161725c366e2eac2bd3efe9f))
|
|
102
|
+
* **uikit:** fix sidebar items not collapsing on mini variant ([67a9524](https://github.com/lotrekagency/mapo/commit/67a9524b17b6cbdf455b8e6f56f7cc0674b1dbed))
|
|
103
|
+
* various css fixes ([658c363](https://github.com/lotrekagency/mapo/commit/658c3636e869f0a2bd53efe41295cf87d6af3962))
|
|
104
|
+
* **list:** fix v-menu position on large screens ([41bd08d](https://github.com/lotrekagency/mapo/commit/41bd08d36d85e685a755c7e0de97bbb05a24c03d))
|
|
105
|
+
* **list:** fixed v-menu filter positioning ([e99848e](https://github.com/lotrekagency/mapo/commit/e99848e0beb2df124db1ba9968696bbe8ee7b683))
|
|
106
|
+
* **list:** fixed v-menu position for filters ([cb95260](https://github.com/lotrekagency/mapo/commit/cb9526085d536ff7b468316b1d2571c7ae9509d8))
|
|
107
|
+
* **list:** load page from query params ([88dea98](https://github.com/lotrekagency/mapo/commit/88dea98063cdab79c9c518fe0e3bf8d3c90f0161))
|
|
108
|
+
* **list:** refactoring for injected elements and FE pagination ([f9c968e](https://github.com/lotrekagency/mapo/commit/f9c968e0edf87654df60781d7d2d465d15e40ab9))
|
|
109
|
+
* **list:** removed lock to BE pagination if items in list are less than itemsPerPage ([3fe34e0](https://github.com/lotrekagency/mapo/commit/3fe34e0d1438a0980e8819070f9b158ad3b6e0b8))
|
|
110
|
+
* **uikit:** better handle detail component lang switches ([5297e49](https://github.com/lotrekagency/mapo/commit/5297e4956536b382600c250f5c797c8db5e58f84))
|
|
111
|
+
* **uikit:** fix detailfield not reading conf value changes ([5628268](https://github.com/lotrekagency/mapo/commit/5628268e4e78201523eba60adaf17286dfb38c8b))
|
|
112
|
+
* **uikit:** fix lang changhe in detail component ([32494f7](https://github.com/lotrekagency/mapo/commit/32494f7d094f7e9cebc14f7524ad716eb89fd6d7))
|
|
113
|
+
* **uikit:** fix positioning of element in list component and subcomponents ([887c3b6](https://github.com/lotrekagency/mapo/commit/887c3b6aae52d1a3494ebcc01f0f155f21373f9c))
|
|
114
|
+
* **uikit:** set endpoint to default null in detail field ([5c9296c](https://github.com/lotrekagency/mapo/commit/5c9296c81f8667319699e933f528c4c05a1f541d))
|
|
115
|
+
* fixed v-model with datepicker filter ([ef4634e](https://github.com/lotrekagency/mapo/commit/ef4634e8ad0719ec2991a8c40a87191c0e32d7ec))
|
|
116
|
+
* load saved date range into datepicker ([eb94dd5](https://github.com/lotrekagency/mapo/commit/eb94dd5686b9fed16e0f39bf122c767d8bd1017b))
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
### Features
|
|
120
|
+
|
|
121
|
+
* **list:** added support to offline items ([495fd1f](https://github.com/lotrekagency/mapo/commit/495fd1f30cd0adc228b48ca4384b9df572e69216))
|
|
122
|
+
* **list:** handle multisort ([41feb88](https://github.com/lotrekagency/mapo/commit/41feb88ec15be5cc9afbcdf3d2dea23142301153))
|
|
123
|
+
* **uikit:** add possibility to remove icon from sidebar ([106d85f](https://github.com/lotrekagency/mapo/commit/106d85f576cdc9e6438b48fa8e695315cac2262b))
|
|
124
|
+
* **uikit:** added langChange event to detail component ([70d3430](https://github.com/lotrekagency/mapo/commit/70d3430694e67dfcd65539a3d474847123e05db5))
|
|
125
|
+
* **uikit:** added possibility to change detail component current lang fromprop ([1993aa7](https://github.com/lotrekagency/mapo/commit/1993aa74a66768eea319f41a41878916544adcbb))
|
|
126
|
+
* **uikit:** added possibility to override field container class in detail component with key class in field configuration ([afe1e52](https://github.com/lotrekagency/mapo/commit/afe1e522683d08c5e63650e55dbe2f9a9404e681))
|
|
127
|
+
* **uikit:** added seopreview field ([03e52fe](https://github.com/lotrekagency/mapo/commit/03e52fed08e60c8b43226856a8d05d4c724ad9b2))
|
|
128
|
+
* **uikit:** added v-model to Detail Component, now you can bind the payload externally from detail field. ([a50b082](https://github.com/lotrekagency/mapo/commit/a50b08261d6b8eba3e5b6f1ea2f1f4bb0d591b8e))
|
|
129
|
+
* **uikit:** display errors on tinymce component also with red label shake animation ([2c9e158](https://github.com/lotrekagency/mapo/commit/2c9e158090ee1f770518ad755437171a1b16afbd))
|
|
130
|
+
* **uikit:** newsidebar built with vuetify components to better support theming ([9cc237f](https://github.com/lotrekagency/mapo/commit/9cc237fa7dcfe193edc0fd9cb90e3bbbb103931d))
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
# [1.0.0-alpha.5](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2021-12-20)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### Bug Fixes
|
|
140
|
+
|
|
141
|
+
* **uikit:** fix list component http call with no pagination at all ([ebe4b61](https://github.com/lotrekagency/mapo/commit/ebe4b617f3be5ccb70c10c041c81868e9ee6b828))
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
### Features
|
|
145
|
+
|
|
146
|
+
* added search field on list component ([0c845e2](https://github.com/lotrekagency/mapo/commit/0c845e26e30afed66b351cc7a0f940f9a20e0943))
|
|
147
|
+
* select all option on list component ([588d2c5](https://github.com/lotrekagency/mapo/commit/588d2c57ca5fd36477cf1ee3c33e2289eb979acf))
|
|
148
|
+
* slot for selected items' counter ([0551b5e](https://github.com/lotrekagency/mapo/commit/0551b5e916f25fc740a0cae58c5548ab0c6e35ff))
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
6
154
|
# [1.0.0-alpha.4](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2021-10-25)
|
|
7
155
|
|
|
8
156
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<div>
|
|
3
3
|
<!-- Use this to override the title of the detail component. -->
|
|
4
4
|
<slot name="title" v-bind="slotBindings">
|
|
5
5
|
<!-- `<h1> "Create | Edit" + modelName </h1>` -->
|
|
6
|
-
<v-row class="mb-
|
|
7
|
-
<h1>{{ isNew ? "Create" : "Edit" }} {{ modelName }}</h1>
|
|
6
|
+
<v-row class="mb-5">
|
|
7
|
+
<v-col col="12"><h1 class="display-1">{{ isNew ? "Create" : "Edit" }} {{ modelName }}</h1></v-col>
|
|
8
8
|
</v-row>
|
|
9
9
|
</slot>
|
|
10
10
|
<v-form ref="form">
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<slot name="body.lang" v-bind="slotBindings">
|
|
17
17
|
<!-- [`DetailLangSwitch`](/components/detail/DetailLangSwitch/) -->
|
|
18
18
|
<DetailLangSwitch
|
|
19
|
-
v-if="langs && langs.length"
|
|
19
|
+
v-if="langs && langs.length > 1"
|
|
20
20
|
class="mb-4"
|
|
21
21
|
v-model="currentLang"
|
|
22
22
|
:langs="langs"
|
|
@@ -26,47 +26,57 @@
|
|
|
26
26
|
<slot name="body.top.underlang" v-bind="slotBindings"></slot>
|
|
27
27
|
<!-- Use this to override the content of the main body. -->
|
|
28
28
|
<slot name="body" v-bind="slotBindings">
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<v-card-text>
|
|
37
|
-
<div
|
|
38
|
-
v-for="(fields, fieldsI) in field.fields"
|
|
39
|
-
:key="fieldsI"
|
|
40
|
-
class="mb-4"
|
|
41
|
-
>
|
|
42
|
-
<!-- This is a dynamic slot. You can use it to override a field component. For example use `fields.title` to override the component of the field with value `title`. -->
|
|
43
|
-
<slot
|
|
44
|
-
:name="fields.slotName"
|
|
45
|
-
v-bind="{
|
|
46
|
-
conf: fields,
|
|
47
|
-
...slotBindings,
|
|
48
|
-
}"
|
|
49
|
-
>
|
|
50
|
-
<!-- A [`DetailField`](/components/detail/DetailField/) configured by a [`FieldConfiguration`](#fieldconfiguration). -->
|
|
51
|
-
<DetailField
|
|
52
|
-
v-model="model"
|
|
53
|
-
:conf="fields"
|
|
54
|
-
:errors="errors"
|
|
55
|
-
/>
|
|
56
|
-
</slot>
|
|
57
|
-
</div>
|
|
58
|
-
</v-card-text>
|
|
59
|
-
</v-card>
|
|
60
|
-
<slot
|
|
61
|
-
v-else
|
|
62
|
-
:name="field.slotName"
|
|
63
|
-
v-bind="{
|
|
64
|
-
conf: field,
|
|
65
|
-
...slotBindings,
|
|
66
|
-
}"
|
|
29
|
+
<div class="row">
|
|
30
|
+
<!-- The result of the [`DetailConfiguration`](#detailconfiguration) contained in the main body. -->
|
|
31
|
+
<div
|
|
32
|
+
class="col-12"
|
|
33
|
+
:class="field.class"
|
|
34
|
+
v-for="(field, index) in mainFields"
|
|
35
|
+
:key="index"
|
|
67
36
|
>
|
|
68
|
-
<
|
|
69
|
-
|
|
37
|
+
<v-card v-if="field.group" class="my-2 rounded-0">
|
|
38
|
+
<v-card-title>
|
|
39
|
+
<v-icon left> {{ field.group.icon }} </v-icon>
|
|
40
|
+
<span>{{ field.group.name }}</span>
|
|
41
|
+
</v-card-title>
|
|
42
|
+
<div class="container">
|
|
43
|
+
<div class="row">
|
|
44
|
+
<div
|
|
45
|
+
v-for="(fields, fieldsI) in field.fields"
|
|
46
|
+
:key="fieldsI"
|
|
47
|
+
class="col-12"
|
|
48
|
+
:class="fields.class"
|
|
49
|
+
>
|
|
50
|
+
<!-- This is a dynamic slot. You can use it to override a field component. For example use `fields.title` to override the component of the field with value `title`. -->
|
|
51
|
+
<slot
|
|
52
|
+
:name="fields.slotName"
|
|
53
|
+
v-bind="{
|
|
54
|
+
conf: fields,
|
|
55
|
+
...slotBindings,
|
|
56
|
+
}"
|
|
57
|
+
>
|
|
58
|
+
<!-- A [`DetailField`](/components/detail/DetailField/) configured by a [`FieldConfiguration`](#fieldconfiguration). -->
|
|
59
|
+
<DetailField
|
|
60
|
+
v-model="model"
|
|
61
|
+
:conf="fields"
|
|
62
|
+
:errors="errors"
|
|
63
|
+
/>
|
|
64
|
+
</slot>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</v-card>
|
|
69
|
+
<slot
|
|
70
|
+
v-else
|
|
71
|
+
:name="field.slotName"
|
|
72
|
+
v-bind="{
|
|
73
|
+
conf: field,
|
|
74
|
+
...slotBindings,
|
|
75
|
+
}"
|
|
76
|
+
>
|
|
77
|
+
<DetailField v-model="model" :conf="field" :errors="errors" />
|
|
78
|
+
</slot>
|
|
79
|
+
</div>
|
|
70
80
|
</div>
|
|
71
81
|
</slot>
|
|
72
82
|
<!-- Use this to add content under the main body. -->
|
|
@@ -83,14 +93,14 @@
|
|
|
83
93
|
<!-- Use this to override the Save button. -->
|
|
84
94
|
<slot name="button.save" v-bind="slotBindings">
|
|
85
95
|
<!-- The Save button. -->
|
|
86
|
-
<v-btn class="mb-2" tile block @click="saveItem(true)">{{
|
|
96
|
+
<v-btn :disabled="isReadonly" class="mb-2" tile block @click="saveItem(true)">{{
|
|
87
97
|
isNew ? "Create" : "Save"
|
|
88
98
|
}}</v-btn>
|
|
89
99
|
</slot>
|
|
90
100
|
<!-- Use this to override the Save and continue button. -->
|
|
91
101
|
<slot name="button.savecontinue" v-bind="slotBindings">
|
|
92
102
|
<!-- The Save and continue button. -->
|
|
93
|
-
<v-btn class="mb-2" tile block @click="saveItem(false)"
|
|
103
|
+
<v-btn :disabled="isReadonly" class="mb-2" tile block @click="saveItem(false)"
|
|
94
104
|
>{{ isNew ? "Create" : "Save" }} and continue</v-btn
|
|
95
105
|
>
|
|
96
106
|
</slot>
|
|
@@ -110,6 +120,7 @@
|
|
|
110
120
|
color="error"
|
|
111
121
|
tile
|
|
112
122
|
block
|
|
123
|
+
:disabled="!canDelete"
|
|
113
124
|
@click="deleteItem"
|
|
114
125
|
>Delete</v-btn
|
|
115
126
|
>
|
|
@@ -118,45 +129,55 @@
|
|
|
118
129
|
</slot>
|
|
119
130
|
<!-- Use this to add content on the top of the sidebar fields (or under sidebar buttons). -->
|
|
120
131
|
<slot name="side.top" v-bind="slotBindings"></slot>
|
|
121
|
-
<div
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
<v-card-text>
|
|
128
|
-
<div
|
|
129
|
-
v-for="(fields, fieldsI) in field.fields"
|
|
130
|
-
:key="fieldsI"
|
|
131
|
-
class="mb-4"
|
|
132
|
-
>
|
|
133
|
-
<!-- @vuese-ignore -->
|
|
134
|
-
<slot
|
|
135
|
-
:name="fields.slotName"
|
|
136
|
-
v-bind="{
|
|
137
|
-
conf: fields,
|
|
138
|
-
...slotBindings,
|
|
139
|
-
}"
|
|
140
|
-
>
|
|
141
|
-
<DetailField
|
|
142
|
-
v-model="model"
|
|
143
|
-
:conf="fields"
|
|
144
|
-
:errors="errors"
|
|
145
|
-
/>
|
|
146
|
-
</slot>
|
|
147
|
-
</div>
|
|
148
|
-
</v-card-text>
|
|
149
|
-
</v-card>
|
|
150
|
-
<slot
|
|
151
|
-
v-else
|
|
152
|
-
:name="field.slotName"
|
|
153
|
-
v-bind="{
|
|
154
|
-
conf: field,
|
|
155
|
-
...slotBindings,
|
|
156
|
-
}"
|
|
132
|
+
<div class="row">
|
|
133
|
+
<div
|
|
134
|
+
class="col-12"
|
|
135
|
+
:class="field.class"
|
|
136
|
+
v-for="(field, index) in sideFields"
|
|
137
|
+
:key="index"
|
|
157
138
|
>
|
|
158
|
-
<
|
|
159
|
-
|
|
139
|
+
<v-card v-if="field.group" class="rounded-0 mb-4">
|
|
140
|
+
<v-card-title>
|
|
141
|
+
<v-icon left> {{ field.group.icon }} </v-icon>
|
|
142
|
+
<span>{{ field.group.name }}</span>
|
|
143
|
+
</v-card-title>
|
|
144
|
+
<div class="container">
|
|
145
|
+
<div class="row">
|
|
146
|
+
<div
|
|
147
|
+
v-for="(fields, fieldsI) in field.fields"
|
|
148
|
+
:key="fieldsI"
|
|
149
|
+
class="col-12"
|
|
150
|
+
:class="field.class"
|
|
151
|
+
>
|
|
152
|
+
<!-- @vuese-ignore -->
|
|
153
|
+
<slot
|
|
154
|
+
:name="fields.slotName"
|
|
155
|
+
v-bind="{
|
|
156
|
+
conf: fields,
|
|
157
|
+
...slotBindings,
|
|
158
|
+
}"
|
|
159
|
+
>
|
|
160
|
+
<DetailField
|
|
161
|
+
v-model="model"
|
|
162
|
+
:conf="fields"
|
|
163
|
+
:errors="errors"
|
|
164
|
+
/>
|
|
165
|
+
</slot>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
</v-card>
|
|
170
|
+
<slot
|
|
171
|
+
v-else
|
|
172
|
+
:name="field.slotName"
|
|
173
|
+
v-bind="{
|
|
174
|
+
conf: field,
|
|
175
|
+
...slotBindings,
|
|
176
|
+
}"
|
|
177
|
+
>
|
|
178
|
+
<DetailField v-model="model" :conf="field" :errors="errors" />
|
|
179
|
+
</slot>
|
|
180
|
+
</div>
|
|
160
181
|
</div>
|
|
161
182
|
<!-- Use this to add content under the sidebar fields. -->
|
|
162
183
|
<slot name="side.bottom" v-bind="slotBindings"></slot>
|
|
@@ -164,7 +185,7 @@
|
|
|
164
185
|
</v-col>
|
|
165
186
|
</v-row>
|
|
166
187
|
</v-form>
|
|
167
|
-
</
|
|
188
|
+
</div>
|
|
168
189
|
</template>
|
|
169
190
|
|
|
170
191
|
|
|
@@ -183,6 +204,16 @@ export default {
|
|
|
183
204
|
};
|
|
184
205
|
},
|
|
185
206
|
props: {
|
|
207
|
+
// V-model of the object we are editing.
|
|
208
|
+
value: {
|
|
209
|
+
type: Object,
|
|
210
|
+
required: false
|
|
211
|
+
},
|
|
212
|
+
// Set the current lang to value.
|
|
213
|
+
lang: {
|
|
214
|
+
type: String,
|
|
215
|
+
required: false
|
|
216
|
+
},
|
|
186
217
|
// The main configuration that determines the arrangement of the fields in the detail layout.
|
|
187
218
|
fields: {
|
|
188
219
|
// [`DetailConfiguration`](#detailconfiguration)
|
|
@@ -195,7 +226,10 @@ export default {
|
|
|
195
226
|
default: () => []
|
|
196
227
|
},
|
|
197
228
|
// The url of the endpoint to which the payload is to be sent. From this url a complete crud (See [this.$mapo.$api.crud](/core/#$api.crud)) will be created.
|
|
198
|
-
endpoint:
|
|
229
|
+
endpoint: {
|
|
230
|
+
type: String,
|
|
231
|
+
default: null
|
|
232
|
+
},
|
|
199
233
|
// The identifier of the object you need to retrieve and edit. It can be "new" if you need to create a new payload.
|
|
200
234
|
identifier: {
|
|
201
235
|
// `String|Number`.
|
|
@@ -221,7 +255,7 @@ export default {
|
|
|
221
255
|
this.errors =
|
|
222
256
|
(error.response.status == 400 && error.response.data) || null;
|
|
223
257
|
this.$mapo.$snack.open({
|
|
224
|
-
message: "Something whent bad, please try again later...",
|
|
258
|
+
message: error.response?.data?.detail || "Something whent bad, please try again later...",
|
|
225
259
|
color: "error"
|
|
226
260
|
});
|
|
227
261
|
});
|
|
@@ -231,7 +265,7 @@ export default {
|
|
|
231
265
|
.open({
|
|
232
266
|
title: "Delete",
|
|
233
267
|
question: "Are you sure you want to delete this item?",
|
|
234
|
-
approveButton: { text: "Delete", attrs: { color: "red" } }
|
|
268
|
+
approveButton: { text: "Delete", attrs: { color: "red", text: true } }
|
|
235
269
|
})
|
|
236
270
|
.then(res => {
|
|
237
271
|
if (res) {
|
|
@@ -240,19 +274,32 @@ export default {
|
|
|
240
274
|
.then(() => this.$router.back())
|
|
241
275
|
.catch(error =>
|
|
242
276
|
this.$mapo.$snack.open({
|
|
243
|
-
message: "Something whent bad, please try again later...",
|
|
277
|
+
message: error.response?.data?.detail || "Something whent bad, please try again later...",
|
|
244
278
|
color: "error"
|
|
245
279
|
})
|
|
246
280
|
);
|
|
247
281
|
}
|
|
248
282
|
});
|
|
249
283
|
},
|
|
250
|
-
|
|
284
|
+
initLang(lang = this.currentLang) {
|
|
285
|
+
if (lang && !this.model.translations) {
|
|
286
|
+
this.model.translations = {};
|
|
287
|
+
}
|
|
288
|
+
if (lang && !this.model.translations[lang]) {
|
|
289
|
+
this.model.translations[lang] = {};
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
parseConf(field, i) {
|
|
251
293
|
const conf = typeof field === "string" ? { value: field } : field;
|
|
252
|
-
conf.value = conf.value
|
|
253
|
-
conf.
|
|
294
|
+
conf.value = conf.value || "";
|
|
295
|
+
conf.value = conf.value.replace(new RegExp(`^translations\.(${this.langs.join("|")})\.?`), "");
|
|
296
|
+
conf.slotName = `fields.${conf.value || i}`;
|
|
254
297
|
if (this.currentLang && !field.synci18n) {
|
|
255
|
-
|
|
298
|
+
const base = `translations.${this.currentLang}`;
|
|
299
|
+
conf.value = (conf.value && `${base}.${conf.value}`) || base;
|
|
300
|
+
}
|
|
301
|
+
if (this.isReadonly){
|
|
302
|
+
conf.attrs = {...conf.attrs, readonly: true}
|
|
256
303
|
}
|
|
257
304
|
return conf;
|
|
258
305
|
},
|
|
@@ -262,20 +309,34 @@ export default {
|
|
|
262
309
|
typeof group === "string"
|
|
263
310
|
? { name: group, icon }
|
|
264
311
|
: { ...group, icon: group.icon || icon };
|
|
265
|
-
return fields.map(f =>
|
|
312
|
+
return fields.map((f, i) =>
|
|
266
313
|
f.group
|
|
267
314
|
? { group: parseGroup(f.group), fields: this.mapConf(f.fields) }
|
|
268
|
-
: this.parseConf(f)
|
|
315
|
+
: this.parseConf(f, i)
|
|
269
316
|
);
|
|
270
317
|
}
|
|
271
318
|
},
|
|
272
319
|
watch: {
|
|
273
320
|
currentLang(val) {
|
|
274
|
-
|
|
275
|
-
|
|
321
|
+
this.initLang();
|
|
322
|
+
// Fired when the current language changes.
|
|
323
|
+
// @arg Emits the language name as a string.
|
|
324
|
+
this.$emit("update:lang", val);
|
|
325
|
+
},
|
|
326
|
+
model(val) {
|
|
327
|
+
// Fired when the v-model changes.
|
|
328
|
+
// @arg Emits the entire payload modified.
|
|
329
|
+
this.$emit("input", val);
|
|
330
|
+
},
|
|
331
|
+
lang(val) {
|
|
332
|
+
if (val && this.langs.includes(val)) {
|
|
333
|
+
this.currentLang = val;
|
|
276
334
|
}
|
|
277
|
-
|
|
278
|
-
|
|
335
|
+
},
|
|
336
|
+
value(val) {
|
|
337
|
+
if (val) {
|
|
338
|
+
this.model = val;
|
|
339
|
+
this.initLang();
|
|
279
340
|
}
|
|
280
341
|
}
|
|
281
342
|
},
|
|
@@ -283,6 +344,18 @@ export default {
|
|
|
283
344
|
crud() {
|
|
284
345
|
return this.$mapo.$api.crud(this.endpoint);
|
|
285
346
|
},
|
|
347
|
+
isReadonly() {
|
|
348
|
+
if (this.$mapo.$auth.routeMiddlewares.includes("permissions")){
|
|
349
|
+
return !this.$mapo.$auth.user.permissions.includes(this.isNew ? "add" : "change")
|
|
350
|
+
}
|
|
351
|
+
return false
|
|
352
|
+
},
|
|
353
|
+
canDelete() {
|
|
354
|
+
if (this.$mapo.$auth.routeMiddlewares.includes("permissions")){
|
|
355
|
+
return this.$mapo.$auth.user.permissions.includes("delete")
|
|
356
|
+
}
|
|
357
|
+
return true
|
|
358
|
+
},
|
|
286
359
|
mainFields() {
|
|
287
360
|
return this.mapConf(
|
|
288
361
|
this.fields instanceof Array ? this.fields : this.fields.main || []
|
|
@@ -304,7 +377,7 @@ export default {
|
|
|
304
377
|
},
|
|
305
378
|
langs() {
|
|
306
379
|
return (
|
|
307
|
-
this.model?.
|
|
380
|
+
this.model?.lang_info?.site_languages.map(l => l.id) || this.languages
|
|
308
381
|
);
|
|
309
382
|
},
|
|
310
383
|
slotBindings() {
|
|
@@ -331,7 +404,10 @@ export default {
|
|
|
331
404
|
},
|
|
332
405
|
mounted() {
|
|
333
406
|
if (this.identifier && this.identifier !== "new") {
|
|
334
|
-
this.crud.detail(this.identifier).then(res =>
|
|
407
|
+
this.crud.detail(this.identifier).then(res => {
|
|
408
|
+
this.model = res;
|
|
409
|
+
this.initLang();
|
|
410
|
+
});
|
|
335
411
|
}
|
|
336
412
|
}
|
|
337
413
|
};
|
|
@@ -383,10 +459,10 @@ Here the list of the FieldConfiguration type association.
|
|
|
383
459
|
- `switch` ==> [v-switch](https://vuetifyjs.com/en/components/switches/),
|
|
384
460
|
- `slider` ==> [v-slider](https://vuetifyjs.com/en/components/sliders/),
|
|
385
461
|
- `file` ==> [v-file-input](https://vuetifyjs.com/en/components/file-inputs/),
|
|
386
|
-
- `editor` ==> [
|
|
462
|
+
- `editor` ==> [wyg-editor](/components/fields/wygEditor/wygEditor/),
|
|
387
463
|
- `media` ==> [media-field](/components/fields/MediaField/),
|
|
388
|
-
- `m2m` ==> [
|
|
389
|
-
- `mediaList` ==> [media-
|
|
464
|
+
- `m2m` ==> [fks-field](/components/fields/FksField/),
|
|
465
|
+
- `mediaList` ==> [media-fks-field](/components/fields/MediaM2mField/)
|
|
390
466
|
|
|
391
467
|
|
|
392
468
|
#### Example of a [`FieldConfiguration`](#fieldconfiguration):
|
|
@@ -446,6 +522,7 @@ export default {
|
|
|
446
522
|
"title",
|
|
447
523
|
{ value: "description", type: "textarea" },
|
|
448
524
|
"permalink",
|
|
525
|
+
{ type: "seoPreview" }
|
|
449
526
|
]
|
|
450
527
|
}
|
|
451
528
|
],
|