@oxygen-cms/ui 1.7.2 → 1.8.0
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/{.eslintrc.js → .eslintrc.json} +3 -3
- package/package.json +14 -4
- package/src/CrudApi.js +23 -9
- package/src/MediaApi.js +3 -3
- package/src/PagesApi.js +48 -0
- package/src/PartialsApi.js +30 -0
- package/src/components/AuthenticatedLayout.vue +3 -1
- package/src/components/CodeEditor.vue +1 -1
- package/src/components/GroupsChooser.vue +2 -2
- package/src/components/GroupsList.vue +2 -2
- package/src/components/PageActions.vue +28 -0
- package/src/components/PageEdit.vue +164 -0
- package/src/components/PageNestedPagination.vue +27 -0
- package/src/components/PageNestedRow.vue +52 -0
- package/src/components/PageStatusIcon.vue +33 -0
- package/src/components/PageTable.vue +156 -0
- package/src/components/PartialActions.vue +28 -0
- package/src/components/PartialList.vue +74 -0
- package/src/components/PartialStatusIcon.vue +29 -0
- package/src/components/PartialTable.vue +65 -0
- package/src/components/ResourceList.vue +132 -0
- package/src/components/UserManagement.vue +2 -2
- package/src/components/UserProfileForm.vue +1 -1
- package/src/components/UserProfilePage.vue +1 -1
- package/src/components/content/CommandsList.vue +108 -0
- package/src/components/content/ContentEditor.vue +489 -0
- package/src/components/content/GridCellNodeView.vue +82 -0
- package/src/components/content/GridRowNodeView.vue +53 -0
- package/src/components/content/HtmlNodeView.vue +89 -0
- package/src/components/content/MarkMenu.vue +116 -0
- package/src/components/content/MediaNodeView.vue +83 -0
- package/src/components/content/ObjectLinkNodeView.vue +181 -0
- package/src/components/content/PartialNodeView.vue +217 -0
- package/src/components/content/commands.js +72 -0
- package/src/components/content/suggestion.js +211 -0
- package/src/components/media/MediaChooseDirectory.vue +2 -2
- package/src/components/media/MediaDirectory.vue +1 -1
- package/src/components/media/MediaInsertModal.vue +11 -2
- package/src/components/media/MediaItem.vue +1 -1
- package/src/components/media/MediaItemPreview.vue +18 -2
- package/src/components/media/MediaList.vue +4 -5
- package/src/components/media/MediaUpload.vue +1 -1
- package/src/components/media/media.scss +1 -0
- package/src/components/pages/PageList.vue +65 -0
- package/src/components/users/CreateUserModal.vue +1 -1
- package/src/components/util.css +1 -1
- package/src/icons.js +33 -5
- package/src/main.js +4 -0
- package/src/modules/PagesPartials.js +74 -2
- package/src/styles/pages-table.scss +34 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<PageTable :paginated-items="paginatedItems" :sort-field="sortField" :sort-order="sortOrder" :on-page-change="p => paginatedItems.currentPage = p" :on-sort="onSort">
|
|
3
|
+
<template #actions="props">
|
|
4
|
+
<slot name="actions" :row="props.row"></slot>
|
|
5
|
+
</template>
|
|
6
|
+
</PageTable>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import PageTable from "../PageTable.vue";
|
|
11
|
+
import PagesApi from "../../PagesApi.js";
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: "PageList",
|
|
15
|
+
components: {PageTable},
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
searchQuery: '',
|
|
19
|
+
sortField: this.defaultSortField,
|
|
20
|
+
sortOrder: this.defaultSortOrder,
|
|
21
|
+
paginatedItems: {items: [], totalItems: 0, itemsPerPage: 0, loading: false, currentPage: 1},
|
|
22
|
+
pagesApi: new PagesApi()
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
watch: {
|
|
26
|
+
'paginatedItems.currentPage': 'fetchData',
|
|
27
|
+
'searchQuery': 'fetchData',
|
|
28
|
+
'sortField': 'fetchData',
|
|
29
|
+
'sortOrder': 'fetchData'
|
|
30
|
+
},
|
|
31
|
+
created() {
|
|
32
|
+
this.fetchData()
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
onSort(field, order) {
|
|
36
|
+
this.sortField = field;
|
|
37
|
+
this.sortOrder = order;
|
|
38
|
+
},
|
|
39
|
+
async fetchData() {
|
|
40
|
+
if(this.paginatedItems.loading) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.paginatedItems.loading = true;
|
|
44
|
+
this.paginatedItems.items = [];
|
|
45
|
+
|
|
46
|
+
let data = await this.pagesApi.list({
|
|
47
|
+
q: this.searchQuery,
|
|
48
|
+
inTrash: false,
|
|
49
|
+
page: this.paginatedItems.currentPage,
|
|
50
|
+
sortField: this.sortField,
|
|
51
|
+
sortOrder: this.sortOrder
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
this.paginatedItems.items = data.items;
|
|
55
|
+
this.paginatedItems.loading = false;
|
|
56
|
+
this.paginatedItems.itemsPerPage = data.itemsPerPage;
|
|
57
|
+
this.paginatedItems.totalItems = data.totalItems;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style scoped>
|
|
64
|
+
|
|
65
|
+
</style>
|
package/src/components/util.css
CHANGED
package/src/icons.js
CHANGED
|
@@ -74,7 +74,35 @@ import {
|
|
|
74
74
|
faFolderOpen,
|
|
75
75
|
faImages,
|
|
76
76
|
faMinusCircle,
|
|
77
|
-
faCalendarPlus,
|
|
77
|
+
faCalendarPlus,
|
|
78
|
+
faPaperPlane,
|
|
79
|
+
faHandshakeSlash,
|
|
80
|
+
faHandshake,
|
|
81
|
+
faExclamation,
|
|
82
|
+
faMousePointer,
|
|
83
|
+
faUnlink,
|
|
84
|
+
faAngry,
|
|
85
|
+
faGripVertical,
|
|
86
|
+
faHeading,
|
|
87
|
+
faQuoteLeft,
|
|
88
|
+
faListUl,
|
|
89
|
+
faListOl,
|
|
90
|
+
faBold,
|
|
91
|
+
faItalic,
|
|
92
|
+
faParagraph,
|
|
93
|
+
faCode,
|
|
94
|
+
faThLarge,
|
|
95
|
+
faSave,
|
|
96
|
+
faSlidersH,
|
|
97
|
+
faRulerHorizontal,
|
|
98
|
+
faStrikethrough,
|
|
99
|
+
faUnderline,
|
|
100
|
+
faRemoveFormat,
|
|
101
|
+
faLink,
|
|
102
|
+
faCog,
|
|
103
|
+
faArchive,
|
|
104
|
+
faGlobeAsia,
|
|
105
|
+
faPenSquare, faKey
|
|
78
106
|
} from "@fortawesome/free-solid-svg-icons";
|
|
79
107
|
|
|
80
108
|
export const addIconsToLibrary = () => {
|
|
@@ -83,9 +111,9 @@ export const addIconsToLibrary = () => {
|
|
|
83
111
|
faArrowUp, faAngleRight, faEnvelope, faAngleLeft, faTicketAlt, faUserCog, faTags, faCalendarDay, faTimesCircle,
|
|
84
112
|
faMusic, faPencilAlt, faRedoAlt, faBan, faExternalLinkAlt,
|
|
85
113
|
faSearch, faAngleDown, faUserAlt, faCogs, faPhotoVideo, faPuzzlePiece, faPlus, faUserPlus, faMailBulk, faUsers,
|
|
86
|
-
faArrowLeft, faRecycle, faList, faStamp, faCalendarAlt, faAddressCard, faFileImport, faFileExport, faDownload,
|
|
114
|
+
faArrowLeft, faRecycle, faList, faStamp, faCalendarAlt, faAddressCard, faHeading, faQuoteLeft, faListUl, faListOl, faSave, faSlidersH, faCode, faThLarge, faBold, faItalic, faParagraph, faFileImport, faFileExport, faDownload,
|
|
87
115
|
faFileExcel, faFileCsv, faChevronCircleDown, faChevronCircleUp, faTrash,
|
|
88
|
-
faEye, faEyeSlash, faCaretDown, faCaretUp, faUpload, faUser, faFolder, faHome, faFilePdf, faSignOutAlt, faTag,
|
|
89
|
-
faFolderPlus, faTimes, faQuestionCircle, faFileUpload, faLandmark,
|
|
90
|
-
faFolderOpen, faFile, faFileAudio, faFileImage, faShare, faImages, faCalendarPlus, faPaperPlane, faHandshake, faHandshakeSlash, faExclamation, faMousePointer, faUnlink, faAngry);
|
|
116
|
+
faEye, faEyeSlash, faCaretDown, faCaretUp, faUpload, faUser, faFolder, faHome, faFilePdf, faSignOutAlt, faTag, faStrikethrough, faUnderline, faRemoveFormat, faLink,
|
|
117
|
+
faFolderPlus, faTimes, faQuestionCircle, faFileUpload, faLandmark, faRulerHorizontal, faCog, faArchive, faGlobeAsia, faPenSquare, faKey,
|
|
118
|
+
faFolderOpen, faFile, faFileAudio, faFileImage, faShare, faGripVertical, faImages, faCalendarPlus, faPaperPlane, faHandshake, faHandshakeSlash, faExclamation, faMousePointer, faUnlink, faAngry);
|
|
91
119
|
};
|
package/src/main.js
CHANGED
|
@@ -13,6 +13,8 @@ import createStore from "./store/index";
|
|
|
13
13
|
import { checkAuthenticated } from "./AuthApi";
|
|
14
14
|
import Error404 from "./components/Error404.vue";
|
|
15
15
|
import Preferences from "./components/preferences/Preferences.vue";
|
|
16
|
+
import PortalVue from "portal-vue";
|
|
17
|
+
import {CrudApi} from "./CrudApi.js";
|
|
16
18
|
|
|
17
19
|
/**
|
|
18
20
|
* Creates the Vue.js Oxygen application, allowing for a few points of customization (i.e.: adding modules)
|
|
@@ -82,6 +84,7 @@ export default class OxygenUI {
|
|
|
82
84
|
this.Vue.use(VHotkey);
|
|
83
85
|
this.Vue.use(AsyncComputed);
|
|
84
86
|
this.Vue.use(Router);
|
|
87
|
+
this.Vue.use(PortalVue);
|
|
85
88
|
|
|
86
89
|
const store = createStore(this.Vue);
|
|
87
90
|
|
|
@@ -136,6 +139,7 @@ export default class OxygenUI {
|
|
|
136
139
|
FetchBuilder.setStore(store);
|
|
137
140
|
UserPermissions.setBuefy(this.app.$buefy);
|
|
138
141
|
UserPreferences.setBuefy(this.app.$buefy)
|
|
142
|
+
CrudApi.setBuefy(this.app.$buefy);
|
|
139
143
|
return this;
|
|
140
144
|
}
|
|
141
145
|
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import LegacyPage from "../components/LegacyPage.vue";
|
|
2
2
|
import { WEB_CONTENT } from "../main.js";
|
|
3
|
+
import PageEdit from "../components/PageEdit.vue";
|
|
4
|
+
import ResourceList from "../components/ResourceList.vue";
|
|
5
|
+
import PageTable from "../components/PageTable.vue";
|
|
6
|
+
import PagesApi from "../PagesApi.js";
|
|
7
|
+
import PartialsApi from "../PartialsApi.js";
|
|
8
|
+
import PartialTable from "../components/PartialTable.vue";
|
|
9
|
+
import PageActions from "../components/PageActions.vue";
|
|
10
|
+
import PartialActions from "../components/PartialActions.vue";
|
|
3
11
|
|
|
4
12
|
export default function(ui) {
|
|
5
13
|
ui.addMainMenuGroup(WEB_CONTENT, {
|
|
@@ -24,10 +32,24 @@ export default function(ui) {
|
|
|
24
32
|
items: {
|
|
25
33
|
}
|
|
26
34
|
});
|
|
35
|
+
|
|
36
|
+
const partialsProps = { displayName: 'Partials', routePrefix: 'partials', inTrash: false, tableComponent: PartialTable, actionsComponent: PartialActions, singularDisplayName: 'Partial', defaultSortField: 'title', defaultSortOrder: 'asc', resourceApi: new PartialsApi() }
|
|
37
|
+
const pagesProps = { displayName: 'Pages', routePrefix: 'pages', inTrash: false, tableComponent: PageTable, actionsComponent: PageActions, singularDisplayName: 'Page', defaultSortField: 'title', defaultSortOrder: 'asc', resourceApi: new PagesApi() }
|
|
38
|
+
|
|
27
39
|
ui.addAuthenticatedRoutes([
|
|
28
40
|
{
|
|
29
|
-
|
|
30
|
-
|
|
41
|
+
path: '(pages|partials)/create',
|
|
42
|
+
component: LegacyPage,
|
|
43
|
+
props: (route) => {
|
|
44
|
+
return {
|
|
45
|
+
fullPath: route.fullPath,
|
|
46
|
+
legacyPrefix: '/oxygen/view',
|
|
47
|
+
adminPrefix: '/oxygen'
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
path: '(pages|partials)/:subpath/edit',
|
|
31
53
|
component: LegacyPage,
|
|
32
54
|
props: (route) => {
|
|
33
55
|
return {
|
|
@@ -36,6 +58,56 @@ export default function(ui) {
|
|
|
36
58
|
adminPrefix: '/oxygen'
|
|
37
59
|
}
|
|
38
60
|
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
path: 'partials/trash',
|
|
64
|
+
name: 'partials.trash',
|
|
65
|
+
component: ResourceList,
|
|
66
|
+
meta: { title: 'Deleted Partials' },
|
|
67
|
+
props: { ...partialsProps, inTrash: true }
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
path: 'partials',
|
|
71
|
+
name: 'partials.list',
|
|
72
|
+
component: ResourceList,
|
|
73
|
+
meta: { title: 'List Partials' },
|
|
74
|
+
props: { ...partialsProps, inTrash: false }
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
path: 'partials/:id',
|
|
78
|
+
redirect: to => {
|
|
79
|
+
return { path: 'partials/' + to.params.id + '/edit' }
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
path: 'partials/create',
|
|
84
|
+
redirect: 'partials/create'
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
path: 'pages/trash',
|
|
88
|
+
name: 'pages.trash',
|
|
89
|
+
component: ResourceList,
|
|
90
|
+
meta: { title: 'Deleted Pages' },
|
|
91
|
+
props: { ...pagesProps, inTrash: true }
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
path: 'pages2/:id',
|
|
95
|
+
name: 'pages.edit',
|
|
96
|
+
component: PageEdit,
|
|
97
|
+
meta: { title: 'Edit Page' }
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
path: 'pages/:id',
|
|
101
|
+
redirect: to => {
|
|
102
|
+
return { path: 'pages/' + to.params.id + '/edit' }
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
path: 'pages',
|
|
107
|
+
name: 'pages.list',
|
|
108
|
+
component: ResourceList,
|
|
109
|
+
meta: { title: 'List Pages' },
|
|
110
|
+
props: { ...pagesProps, inTrash: false }
|
|
39
111
|
}
|
|
40
112
|
]);
|
|
41
113
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@import "variables";
|
|
2
|
+
|
|
3
|
+
.row-depth-1 {
|
|
4
|
+
background-color: $grey-lightest;
|
|
5
|
+
td {
|
|
6
|
+
border-bottom-color: $grey-light
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
td:nth-child(2) {
|
|
10
|
+
padding-left: 1.5rem;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.row-depth-2 {
|
|
15
|
+
background-color: $grey-lighter;
|
|
16
|
+
td {
|
|
17
|
+
border-bottom-color: $grey-light;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
td:nth-child(2) {
|
|
21
|
+
padding-left: 3rem;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.row-depth-3 {
|
|
26
|
+
background-color: darken($grey-lighter, 10%);
|
|
27
|
+
td {
|
|
28
|
+
border-bottom-color: darken($grey-light, 10%);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
td:nth-child(2) {
|
|
32
|
+
padding-left: 4.5rem;
|
|
33
|
+
}
|
|
34
|
+
}
|