@raketa-cloud/admin 0.0.10 → 0.0.12
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/package.json +1 -1
- package/src/cloud/PageRevisions.js +15 -1
- package/src/cloud/Pages.js +68 -0
- package/src/handlers/{RevertPageRevisionHandler.js → page_revisions/RevertsHandler.js} +1 -1
- package/src/handlers/{PageCloneHandler.js → pages/ClonesHandler.js} +1 -1
- package/src/handlers/{PageDeleteHandler.js → pages/DeletesHandler.js} +2 -2
- package/src/handlers/{PageTranslationsHandler.js → pages/TranslationsHandler.js} +2 -2
- package/src/handlers/{PageURLsHandler.js → pages/URLsHandler.js} +1 -1
- package/src/index.js +26 -26
- package/src/routeNestedCollection.js +7 -7
- package/src/routePages.js +31 -76
- package/src/routeSettings.js +6 -6
- package/src/setupCloud.js +0 -19
- package/src/{handlers → tests/handlers}/RedirectsHandler.test/create.test.js +4 -4
- package/src/{handlers → tests/handlers}/RedirectsHandler.test/create_form.test.js +3 -3
- package/src/{handlers → tests/handlers}/RedirectsHandler.test/destroy.test.js +4 -4
- package/src/{handlers → tests/handlers}/RedirectsHandler.test/edit_form.test.js +4 -4
- package/src/{handlers → tests/handlers}/RedirectsHandler.test/index.test.js +4 -4
- package/src/{handlers → tests/handlers}/RedirectsHandler.test/show.test.js +4 -4
- package/src/{handlers → tests/handlers}/RedirectsHandler.test/update.test.js +4 -4
- package/src/{handlers/PageRevisionsCodesHandler.test → tests/handlers/page_revisions/CodesHandler.test}/edit_form.test.js +6 -6
- package/src/{handlers/PageRevisionsCodesHandler.test → tests/handlers/page_revisions/CodesHandler.test}/update.test.js +7 -7
- package/src/{handlers/PageRevisionsGeneralHandler.test → tests/handlers/page_revisions/GeneralHandler.test}/edit_form.test.js +7 -7
- package/src/{handlers/PageRevisionsGeneralHandler.test → tests/handlers/page_revisions/GeneralHandler.test}/update.test.js +8 -9
- package/src/{handlers/PageRevisionsMetaHandler.test → tests/handlers/page_revisions/MetaHandler.test}/edit_form.test.js +6 -6
- package/src/{handlers/PageRevisionsMetaHandler.test → tests/handlers/page_revisions/MetaHandler.test}/update.test.js +7 -7
- package/src/{handlers → tests/handlers/page_revisions}/PageRevisionsHandler.test/create.test.js +4 -4
- package/src/{handlers → tests/handlers/page_revisions}/PageRevisionsHandler.test/destroy.test.js +4 -5
- package/src/{handlers/PublishPageRevisionHandler.test → tests/handlers/page_revisions/PublishesHandler.test}/create.test.js +7 -7
- package/src/{handlers/PublishPageRevisionHandler.test → tests/handlers/page_revisions/PublishesHandler.test}/create_form.test.js +6 -6
- package/src/{handlers/RevertPageRevisionHandler.test → tests/handlers/page_revisions/RevertsHandler.test}/create.test.js +10 -10
- package/src/{handlers/PageRevisionsTagsHandler.test → tests/handlers/page_revisions/TagHandler.test}/edit_form.test.js +7 -7
- package/src/{handlers/PageRevisionsTagsHandler.test → tests/handlers/page_revisions/TagHandler.test}/update.test.js +8 -8
- package/src/{handlers/PageRevisionsVisualsHandler.test → tests/handlers/page_revisions/VisualHandler.test.test}/edit_form.test.js +6 -6
- package/src/{handlers/PageRevisionsVisualsHandler.test → tests/handlers/page_revisions/VisualHandler.test.test}/update.test.js +7 -7
- package/src/{handlers/PageRevisionsWidgetsHandler.test → tests/handlers/page_revisions/WidgetHandler.test}/show.test.js +7 -8
- package/src/{handlers/PageRevisionsWidgetsHandler.test → tests/handlers/page_revisions/WidgetHandler.test}/update.test.js +8 -9
- package/src/{handlers/PageCloneHandler.test → tests/handlers/pages/ConesHandler.test}/create.test.js +9 -10
- package/src/{handlers/PageDeleteHandler.test → tests/handlers/pages/DeletesHandler.test}/create.test.js +9 -11
- package/src/{handlers/PageDeleteHandler.test → tests/handlers/pages/DeletesHandler.test}/create_form.test.js +6 -6
- package/src/{handlers → tests/handlers/pages}/PagesHandler.test/create.test.js +5 -5
- package/src/{handlers → tests/handlers/pages}/PagesHandler.test/create_form.test.js +5 -5
- package/src/{handlers → tests/handlers/pages}/PagesHandler.test/index.test.js +5 -5
- package/src/{handlers → tests/handlers/pages}/PagesHandler.test/show.test.js +6 -6
- package/src/{handlers/PageURLsHandler.test → tests/handlers/pages/URLsHandler.test}/create.test.js +11 -13
- package/src/{handlers/PageURLsHandler.test → tests/handlers/pages/URLsHandler.test}/create_form.test.js +6 -6
- package/src/tests/routeNestedCollection.test.js +14 -14
- package/src/views/{page_lock → page_revisions/locks}/create_form.ejs +2 -2
- package/src/views/{page_publish → page_revisions/publishes}/_form.ejs +1 -1
- package/src/views/page_revisions/publishes/create_form.ejs +10 -0
- package/src/views/{page_deletes → pages/deletes}/create_form.ejs +2 -2
- package/src/views/pages/index.ejs +2 -2
- package/src/views/pages/show.ejs +7 -7
- package/src/views/{page_translations → pages/translations}/_form.ejs +2 -2
- package/src/views/{page_urls → pages/urls}/create_form.ejs +2 -2
- package/src/cloud/ChangePageURL.js +0 -24
- package/src/cloud/ClonePage.js +0 -14
- package/src/cloud/DeletePage.js +0 -35
- package/src/cloud/PageTranslations.js +0 -22
- package/src/cloud/RevertPageRevision.js +0 -18
- package/src/views/page_publish/create_form.ejs +0 -11
- /package/src/handlers/{PageRevisionsCodesHandler.js → page_revisions/CodeHandler.js} +0 -0
- /package/src/handlers/{PageRevisionsGeneralHandler.js → page_revisions/GeneralHandler.js} +0 -0
- /package/src/handlers/{PageRevisionsLockHandler.js → page_revisions/LocksHandler.js} +0 -0
- /package/src/handlers/{PageRevisionsMetaHandler.js → page_revisions/MetaHandler.js} +0 -0
- /package/src/handlers/{PageRevisionsHandler.js → page_revisions/PageRevisionsHandler.js} +0 -0
- /package/src/handlers/{PublishPageRevisionHandler.js → page_revisions/PublishesHandler.js} +0 -0
- /package/src/handlers/{PageRevisionsTagsHandler.js → page_revisions/TagHandler.js} +0 -0
- /package/src/handlers/{PageRevisionsUnlockHandler.js → page_revisions/UnlocksHandler.js} +0 -0
- /package/src/handlers/{PageRevisionsVisualsHandler.js → page_revisions/VisualHandler.js} +0 -0
- /package/src/handlers/{PageRevisionsWidgetsHandler.js → page_revisions/WidgetHandler.js} +0 -0
- /package/src/handlers/{PagesHandler.js → pages/PagesHandler.js} +0 -0
- /package/src/handlers/{SettingsGeneralHandler.js → settings/GeneralHandler.js} +0 -0
- /package/src/handlers/{SettingsLayoutHandler.js → settings/LayoutHandler.js} +0 -0
- /package/src/handlers/{SettingsMetaHandler.js → settings/MetaHandler.js} +0 -0
- /package/src/views/{page_translations → pages/translations}/create_form.ejs +0 -0
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Pages from "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { testConfig } from "../../../../../apps/admin/test/handlersHelper";
|
|
1
|
+
import DeletesHandler from "../../../../handlers/pages/DeletesHandler";
|
|
2
|
+
import Pages from "../../../../cloud/Pages";
|
|
3
|
+
import Factory from "../../../../../test/factory";
|
|
4
|
+
import { testConfig } from "../../../../../test//handlersHelper";
|
|
6
5
|
|
|
7
6
|
function buildCtx(page, updateSettings) {
|
|
8
7
|
return {
|
|
9
8
|
client: {
|
|
10
9
|
pages: new Pages(testConfig, "token"),
|
|
11
|
-
deletePage: new DeletePage(testConfig, "token"),
|
|
12
10
|
},
|
|
13
11
|
params: { parent_id: page.id },
|
|
14
12
|
resourceParams: {
|
|
@@ -32,10 +30,10 @@ describe("Page delete", () => {
|
|
|
32
30
|
.mockImplementation(() => page);
|
|
33
31
|
|
|
34
32
|
const mockDelete = jest
|
|
35
|
-
.spyOn(ctx.client.
|
|
33
|
+
.spyOn(ctx.client.pages, "delete")
|
|
36
34
|
.mockImplementation(() => ({ page, errors: null }));
|
|
37
35
|
|
|
38
|
-
const result = await
|
|
36
|
+
const result = await DeletesHandler.create(ctx);
|
|
39
37
|
|
|
40
38
|
expect(mockFind).toHaveBeenCalledWith(page.id, "en");
|
|
41
39
|
expect(mockDelete).toHaveBeenCalledWith(page.id, "en", {
|
|
@@ -63,7 +61,7 @@ describe("Page delete", () => {
|
|
|
63
61
|
.mockImplementation(() => page);
|
|
64
62
|
|
|
65
63
|
const mockDelete = jest
|
|
66
|
-
.spyOn(ctx.client.
|
|
64
|
+
.spyOn(ctx.client.pages, "delete")
|
|
67
65
|
.mockImplementation(() => ({
|
|
68
66
|
page: null,
|
|
69
67
|
errors: [
|
|
@@ -75,7 +73,7 @@ describe("Page delete", () => {
|
|
|
75
73
|
],
|
|
76
74
|
}));
|
|
77
75
|
|
|
78
|
-
const result = await
|
|
76
|
+
const result = await DeletesHandler.create(ctx);
|
|
79
77
|
|
|
80
78
|
expect(mockFind).toHaveBeenCalledWith(page.id, "en");
|
|
81
79
|
expect(mockDelete).toHaveBeenCalledWith(page.id, "en", {
|
|
@@ -104,7 +102,7 @@ describe("Page delete", () => {
|
|
|
104
102
|
.mockImplementation(() => null);
|
|
105
103
|
|
|
106
104
|
expect(async () => {
|
|
107
|
-
await
|
|
105
|
+
await DeletesHandler.create(ctx);
|
|
108
106
|
}).rejects.toThrow("Missing page #42");
|
|
109
107
|
|
|
110
108
|
expect(mockFind).toHaveBeenCalledWith("42", "en");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Pages from "
|
|
3
|
-
import Factory from "
|
|
4
|
-
import { testConfig } from "
|
|
1
|
+
import DeletesHandler from "../../../../handlers/pages/DeletesHandler";
|
|
2
|
+
import Pages from "../../../../cloud/Pages";
|
|
3
|
+
import Factory from "../../../../../test/factory";
|
|
4
|
+
import { testConfig } from "../../../../../test//handlersHelper";
|
|
5
5
|
|
|
6
6
|
function buildCtx(page) {
|
|
7
7
|
return {
|
|
@@ -22,7 +22,7 @@ describe("Page delete", () => {
|
|
|
22
22
|
.spyOn(ctx.client.pages, "find")
|
|
23
23
|
.mockImplementation(() => page);
|
|
24
24
|
|
|
25
|
-
const result = await
|
|
25
|
+
const result = await DeletesHandler.create_form(ctx);
|
|
26
26
|
|
|
27
27
|
expect(mockFind).toHaveBeenCalledWith(page.id, "en");
|
|
28
28
|
|
|
@@ -46,7 +46,7 @@ describe("Page delete", () => {
|
|
|
46
46
|
.mockImplementation(() => null);
|
|
47
47
|
|
|
48
48
|
expect(async () => {
|
|
49
|
-
await
|
|
49
|
+
await DeletesHandler.create_form(ctx);
|
|
50
50
|
}).rejects.toThrow("Missing page #42");
|
|
51
51
|
|
|
52
52
|
expect(mockFind).toHaveBeenCalledWith("42", "en");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import PagesHandler from "
|
|
2
|
-
import Pages from "
|
|
3
|
-
import Tags from "
|
|
4
|
-
import { testConfig } from "../../../../../
|
|
5
|
-
import Factory from "../../../../../
|
|
1
|
+
import PagesHandler from "../../../../handlers/pages/PagesHandler";
|
|
2
|
+
import Pages from "../../../../cloud/Pages";
|
|
3
|
+
import Tags from "../../../../cloud/Tags";
|
|
4
|
+
import { testConfig } from "../../../../../test/handlersHelper";
|
|
5
|
+
import Factory from "../../../../../test/factory";
|
|
6
6
|
|
|
7
7
|
describe("Pages Handler", () => {
|
|
8
8
|
function buildCtx(params) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import PagesHandler from "
|
|
2
|
-
import Pages from "
|
|
3
|
-
import Tags from "
|
|
4
|
-
import { testConfig } from "
|
|
5
|
-
import Factory from "
|
|
1
|
+
import PagesHandler from "../../../../handlers/pages/PagesHandler";
|
|
2
|
+
import Pages from "../../../../cloud/Pages";
|
|
3
|
+
import Tags from "../../../../cloud/Tags";
|
|
4
|
+
import { testConfig } from "../../../../../test/handlersHelper";
|
|
5
|
+
import Factory from "../../../../../test/factory";
|
|
6
6
|
|
|
7
7
|
describe("Pages Handler", () => {
|
|
8
8
|
function buildCtx() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import PagesHandler from "
|
|
2
|
-
import Pages from "
|
|
3
|
-
import Tags from "
|
|
4
|
-
import { testConfig } from "
|
|
5
|
-
import Factory from "
|
|
1
|
+
import PagesHandler from "../../../../handlers/pages/PagesHandler";
|
|
2
|
+
import Pages from "../../../../cloud/Pages";
|
|
3
|
+
import Tags from "../../../../cloud/Tags";
|
|
4
|
+
import { testConfig } from "../../../../../test/handlersHelper";
|
|
5
|
+
import Factory from "../../../../../test/factory";
|
|
6
6
|
|
|
7
7
|
describe("Pages Handler", () => {
|
|
8
8
|
function buildCtx() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import PagesHandler from "
|
|
2
|
-
import Pages from "
|
|
3
|
-
import PageChanges from "
|
|
4
|
-
import PageRevisions from "
|
|
5
|
-
import { testConfig } from "
|
|
6
|
-
import Factory from "
|
|
1
|
+
import PagesHandler from "../../../../handlers/pages/PagesHandler";
|
|
2
|
+
import Pages from "../../../../cloud/Pages";
|
|
3
|
+
import PageChanges from "../../../../cloud/PageChanges";
|
|
4
|
+
import PageRevisions from "../../../../cloud/PageRevisions";
|
|
5
|
+
import { testConfig } from "../../../../../test/handlersHelper";
|
|
6
|
+
import Factory from "../../../../../test/factory";
|
|
7
7
|
|
|
8
8
|
describe("Pages Handler", () => {
|
|
9
9
|
function buildCtx(page) {
|
package/src/{handlers/PageURLsHandler.test → tests/handlers/pages/URLsHandler.test}/create.test.js
RENAMED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Pages from "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { testConfig } from "../../../../../apps/admin/test/handlersHelper";
|
|
1
|
+
import URLsHandler from "../../../../handlers/pages/URLsHandler";
|
|
2
|
+
import Pages from "../../../../cloud/Pages";
|
|
3
|
+
import Factory from "../../../../../test/factory";
|
|
4
|
+
import { testConfig } from "../../../../../test/handlersHelper";
|
|
6
5
|
|
|
7
6
|
function buildCtx(page, updateSettings) {
|
|
8
7
|
return {
|
|
9
8
|
client: {
|
|
10
9
|
pages: new Pages(testConfig, "token"),
|
|
11
|
-
changePageURL: new ChangePageURL(testConfig, "token"),
|
|
12
10
|
},
|
|
13
11
|
params: { parent_id: page.id },
|
|
14
12
|
resourceParams: {
|
|
@@ -32,10 +30,10 @@ describe("Page change url", () => {
|
|
|
32
30
|
.mockImplementation(() => page);
|
|
33
31
|
|
|
34
32
|
const mockChange = jest
|
|
35
|
-
.spyOn(ctx.client.
|
|
33
|
+
.spyOn(ctx.client.pages, "updateSlug")
|
|
36
34
|
.mockImplementation(() => ({ page, errors: null }));
|
|
37
35
|
|
|
38
|
-
const result = await
|
|
36
|
+
const result = await URLsHandler.create(ctx);
|
|
39
37
|
|
|
40
38
|
expect(mockFind).toHaveBeenCalledWith(page.id, "en");
|
|
41
39
|
expect(mockChange).toHaveBeenCalledWith(
|
|
@@ -67,13 +65,13 @@ describe("Page change url", () => {
|
|
|
67
65
|
.mockImplementation(() => page);
|
|
68
66
|
|
|
69
67
|
const mockChange = jest
|
|
70
|
-
.spyOn(ctx.client.
|
|
68
|
+
.spyOn(ctx.client.pages, "updateSlug")
|
|
71
69
|
.mockImplementation(() => ({
|
|
72
70
|
page: null,
|
|
73
71
|
errors: [{ codes: [], key: "slug", message: "has already been taken" }],
|
|
74
72
|
}));
|
|
75
73
|
|
|
76
|
-
const result = await
|
|
74
|
+
const result = await URLsHandler.create(ctx);
|
|
77
75
|
|
|
78
76
|
expect(mockFind).toHaveBeenCalledWith(page.id, "en");
|
|
79
77
|
expect(mockChange).toHaveBeenCalledWith(
|
|
@@ -105,7 +103,7 @@ describe("Page change url", () => {
|
|
|
105
103
|
.mockImplementation(() => page);
|
|
106
104
|
|
|
107
105
|
const mockChange = jest
|
|
108
|
-
.spyOn(ctx.client.
|
|
106
|
+
.spyOn(ctx.client.pages, "updateSlug")
|
|
109
107
|
.mockImplementation(() => ({
|
|
110
108
|
page: null,
|
|
111
109
|
errors: [
|
|
@@ -117,7 +115,7 @@ describe("Page change url", () => {
|
|
|
117
115
|
],
|
|
118
116
|
}));
|
|
119
117
|
|
|
120
|
-
const result = await
|
|
118
|
+
const result = await URLsHandler.create(ctx);
|
|
121
119
|
|
|
122
120
|
expect(mockFind).toHaveBeenCalledWith(page.id, "en");
|
|
123
121
|
expect(mockChange).toHaveBeenCalledWith(
|
|
@@ -149,7 +147,7 @@ describe("Page change url", () => {
|
|
|
149
147
|
.mockImplementation(() => null);
|
|
150
148
|
|
|
151
149
|
expect(async () => {
|
|
152
|
-
await
|
|
150
|
+
await URLsHandler.create(ctx);
|
|
153
151
|
}).rejects.toThrow("Cannot find page with id 42");
|
|
154
152
|
|
|
155
153
|
expect(mockFind).toHaveBeenCalledWith("42", "en");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Pages from "
|
|
3
|
-
import Factory from "
|
|
4
|
-
import { testConfig } from "
|
|
1
|
+
import URLsHandler from "../../../../handlers/pages/URLsHandler";
|
|
2
|
+
import Pages from "../../../../cloud/Pages";
|
|
3
|
+
import Factory from "../../../../../test/factory";
|
|
4
|
+
import { testConfig } from "../../../../../test/handlersHelper";
|
|
5
5
|
|
|
6
6
|
function buildCtx(page) {
|
|
7
7
|
return {
|
|
@@ -22,7 +22,7 @@ describe("Page change url", () => {
|
|
|
22
22
|
.spyOn(ctx.client.pages, "find")
|
|
23
23
|
.mockImplementation(() => page);
|
|
24
24
|
|
|
25
|
-
const result = await
|
|
25
|
+
const result = await URLsHandler.create_form(ctx);
|
|
26
26
|
|
|
27
27
|
expect(mockFind).toHaveBeenCalledWith(page.id, "en");
|
|
28
28
|
|
|
@@ -43,7 +43,7 @@ describe("Page change url", () => {
|
|
|
43
43
|
.mockImplementation(() => null);
|
|
44
44
|
|
|
45
45
|
expect(async () => {
|
|
46
|
-
await
|
|
46
|
+
await URLsHandler.create_form(ctx);
|
|
47
47
|
}).rejects.toThrow("Cannot find page with id 42");
|
|
48
48
|
|
|
49
49
|
expect(mockFind).toHaveBeenCalledWith("42", "en");
|
|
@@ -37,7 +37,7 @@ describe("routeNestedCollection", () => {
|
|
|
37
37
|
"GET",
|
|
38
38
|
"/orders/:parent_id/line_items",
|
|
39
39
|
"line_items",
|
|
40
|
-
"line_items",
|
|
40
|
+
"orders/line_items",
|
|
41
41
|
"index",
|
|
42
42
|
OrdersHandler.index,
|
|
43
43
|
],
|
|
@@ -45,7 +45,7 @@ describe("routeNestedCollection", () => {
|
|
|
45
45
|
"GET",
|
|
46
46
|
"/orders/:parent_id/line_items/new",
|
|
47
47
|
"line_items",
|
|
48
|
-
"line_items",
|
|
48
|
+
"orders/line_items",
|
|
49
49
|
"create_form",
|
|
50
50
|
OrdersHandler.create_form,
|
|
51
51
|
],
|
|
@@ -53,7 +53,7 @@ describe("routeNestedCollection", () => {
|
|
|
53
53
|
"GET",
|
|
54
54
|
"/line_items/:id",
|
|
55
55
|
"line_items",
|
|
56
|
-
"line_items",
|
|
56
|
+
"orders/line_items",
|
|
57
57
|
"show",
|
|
58
58
|
OrdersHandler.show,
|
|
59
59
|
],
|
|
@@ -61,7 +61,7 @@ describe("routeNestedCollection", () => {
|
|
|
61
61
|
"GET",
|
|
62
62
|
"/line_items/:id/edit",
|
|
63
63
|
"line_items",
|
|
64
|
-
"line_items",
|
|
64
|
+
"orders/line_items",
|
|
65
65
|
"edit_form",
|
|
66
66
|
OrdersHandler.edit_form,
|
|
67
67
|
],
|
|
@@ -69,7 +69,7 @@ describe("routeNestedCollection", () => {
|
|
|
69
69
|
"POST",
|
|
70
70
|
"/orders/:parent_id/line_items",
|
|
71
71
|
"line_items",
|
|
72
|
-
"line_items",
|
|
72
|
+
"orders/line_items",
|
|
73
73
|
"create_form",
|
|
74
74
|
OrdersHandler.create,
|
|
75
75
|
],
|
|
@@ -77,7 +77,7 @@ describe("routeNestedCollection", () => {
|
|
|
77
77
|
"PUT",
|
|
78
78
|
"/line_items/:id",
|
|
79
79
|
"line_items",
|
|
80
|
-
"line_items",
|
|
80
|
+
"orders/line_items",
|
|
81
81
|
"update",
|
|
82
82
|
OrdersHandler.update,
|
|
83
83
|
],
|
|
@@ -85,7 +85,7 @@ describe("routeNestedCollection", () => {
|
|
|
85
85
|
"DELETE",
|
|
86
86
|
"/line_items/:id",
|
|
87
87
|
"line_items",
|
|
88
|
-
"line_items",
|
|
88
|
+
"orders/line_items",
|
|
89
89
|
"destroy",
|
|
90
90
|
OrdersHandler.destroy,
|
|
91
91
|
],
|
|
@@ -105,7 +105,7 @@ describe("routeNestedCollection", () => {
|
|
|
105
105
|
"GET",
|
|
106
106
|
"/orders/:parent_id/line_items",
|
|
107
107
|
"line_items",
|
|
108
|
-
"line_items",
|
|
108
|
+
"orders/line_items",
|
|
109
109
|
"index",
|
|
110
110
|
OrdersHandlerWithFilters.index,
|
|
111
111
|
OrdersHandlerWithFilters.before_filter,
|
|
@@ -115,7 +115,7 @@ describe("routeNestedCollection", () => {
|
|
|
115
115
|
"GET",
|
|
116
116
|
"/orders/:parent_id/line_items/new",
|
|
117
117
|
"line_items",
|
|
118
|
-
"line_items",
|
|
118
|
+
"orders/line_items",
|
|
119
119
|
"create_form",
|
|
120
120
|
OrdersHandlerWithFilters.create_form,
|
|
121
121
|
OrdersHandlerWithFilters.before_filter,
|
|
@@ -125,7 +125,7 @@ describe("routeNestedCollection", () => {
|
|
|
125
125
|
"GET",
|
|
126
126
|
"/line_items/:id",
|
|
127
127
|
"line_items",
|
|
128
|
-
"line_items",
|
|
128
|
+
"orders/line_items",
|
|
129
129
|
"show",
|
|
130
130
|
OrdersHandlerWithFilters.show,
|
|
131
131
|
OrdersHandlerWithFilters.before_filter,
|
|
@@ -135,7 +135,7 @@ describe("routeNestedCollection", () => {
|
|
|
135
135
|
"GET",
|
|
136
136
|
"/line_items/:id/edit",
|
|
137
137
|
"line_items",
|
|
138
|
-
"line_items",
|
|
138
|
+
"orders/line_items",
|
|
139
139
|
"edit_form",
|
|
140
140
|
OrdersHandlerWithFilters.edit_form,
|
|
141
141
|
OrdersHandlerWithFilters.before_filter,
|
|
@@ -145,7 +145,7 @@ describe("routeNestedCollection", () => {
|
|
|
145
145
|
"POST",
|
|
146
146
|
"/orders/:parent_id/line_items",
|
|
147
147
|
"line_items",
|
|
148
|
-
"line_items",
|
|
148
|
+
"orders/line_items",
|
|
149
149
|
"create_form",
|
|
150
150
|
OrdersHandlerWithFilters.create,
|
|
151
151
|
OrdersHandlerWithFilters.before_filter,
|
|
@@ -155,7 +155,7 @@ describe("routeNestedCollection", () => {
|
|
|
155
155
|
"PUT",
|
|
156
156
|
"/line_items/:id",
|
|
157
157
|
"line_items",
|
|
158
|
-
"line_items",
|
|
158
|
+
"orders/line_items",
|
|
159
159
|
"update",
|
|
160
160
|
OrdersHandlerWithFilters.update,
|
|
161
161
|
OrdersHandlerWithFilters.before_filter,
|
|
@@ -165,7 +165,7 @@ describe("routeNestedCollection", () => {
|
|
|
165
165
|
"DELETE",
|
|
166
166
|
"/line_items/:id",
|
|
167
167
|
"line_items",
|
|
168
|
-
"line_items",
|
|
168
|
+
"orders/line_items",
|
|
169
169
|
"destroy",
|
|
170
170
|
OrdersHandlerWithFilters.destroy,
|
|
171
171
|
OrdersHandlerWithFilters.before_filter,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div class="grid gap-4 md:grid-cols-3">
|
|
7
7
|
<div>
|
|
8
8
|
<% form_for({ lock_settings }, errors, (f) => { %>
|
|
9
|
-
<form action="<%= `/${_context.locale}/page_revisions/${lock_settings.revision.id}/
|
|
9
|
+
<form action="<%= `/${_context.locale}/page_revisions/${lock_settings.revision.id}/locks` %>" method="POST" class="form">
|
|
10
10
|
<%- f.field('lock_settings.message', { as: 'textarea', label: 'Lock Message', required: true }) %>
|
|
11
11
|
<div class="form-actions">
|
|
12
12
|
<div class="btn-toolbar">
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
</div>
|
|
33
33
|
</div>
|
|
34
34
|
</div>
|
|
35
|
-
</div>
|
|
35
|
+
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<% form_for({ publishing }, errors, (f) => { %>
|
|
2
|
-
<form action="<%= `/${_context.locale}/page_revisions/${publishing.id}/
|
|
2
|
+
<form action="<%= `/${_context.locale}/page_revisions/${publishing.id}/publishes` %>" method="post" class="form">
|
|
3
3
|
<%- f.field('publishing.title'), { required: true } %>
|
|
4
4
|
<%- f.field('publishing.description', { as: "textarea" }) %>
|
|
5
5
|
<%- f.field('publishing.visibility', { as: 'select', required: true, options: visibilityOptions }) %>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div class="grid gap-4 md:grid-cols-3">
|
|
7
7
|
<div>
|
|
8
8
|
<% form_for({ deleteAction }, errors, (f) => { %>
|
|
9
|
-
<form action="<%= `/${_context.locale}/pages/${deleteAction.id}/
|
|
9
|
+
<form action="<%= `/${_context.locale}/pages/${deleteAction.id}/deletes` %>" method="POST" class="form">
|
|
10
10
|
<%- f.field('deleteAction.redirect', { as: 'select', required: true,options: [['301', 'Redirect to another page'], ['404', 'Return 404'],['410', 'Return 410']] }) %>
|
|
11
11
|
<%- f.field('deleteAction.destination', {label: 'Destination URL', required: true}) %>
|
|
12
12
|
|
|
@@ -52,4 +52,4 @@
|
|
|
52
52
|
})
|
|
53
53
|
|
|
54
54
|
document.getElementById("f_redirect").addEventListener("change", onDestinationChange)
|
|
55
|
-
</script>
|
|
55
|
+
</script>
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
103
103
|
</a>
|
|
104
104
|
<% } else { %>
|
|
105
|
-
<a href="<%= `/${_context.locale}/pages/${item.id}/
|
|
105
|
+
<a href="<%= `/${_context.locale}/pages/${item.id}/translations/new?target_locale=${key}` %>">
|
|
106
106
|
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="<%= [" transition-all ease-in-out duration-300 size-6 rounded-full border hover:opacity-100 dark:border-neutral-700", key === _context.locale ? "opacity-100" : "opacity-10"].join(" ") %>" />
|
|
107
107
|
</a>
|
|
108
108
|
<% } %>
|
|
@@ -158,4 +158,4 @@
|
|
|
158
158
|
searchToggle.addEventListener('click', () => {
|
|
159
159
|
sidebar.classList.toggle('hidden');
|
|
160
160
|
});
|
|
161
|
-
</script>
|
|
161
|
+
</script>
|
package/src/views/pages/show.ejs
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
13
13
|
</a>
|
|
14
14
|
<% } else { %>
|
|
15
|
-
<a href="<%= `/${_context.locale}/pages/${page.id}/
|
|
15
|
+
<a href="<%= `/${_context.locale}/pages/${page.id}/translations/new?target_locale=${key}` %>">
|
|
16
16
|
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="<%= [" transition-all ease-in-out duration-300 size-6 rounded-full border hover:opacity-100 dark:border-neutral-700", key === _context.locale ? "opacity-100" : "opacity-10"].join(" ") %>" />
|
|
17
17
|
</a>
|
|
18
18
|
<% } %>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</button>
|
|
28
28
|
</form>
|
|
29
29
|
|
|
30
|
-
<a href="<%= `/${_context.locale}/pages/${page.id}/
|
|
30
|
+
<a href="<%= `/${_context.locale}/pages/${page.id}/urls/new` %>" class="btn-text has-icon">
|
|
31
31
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
|
|
32
32
|
<path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244" />
|
|
33
33
|
</svg>
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
</button>
|
|
46
46
|
</form>
|
|
47
47
|
|
|
48
|
-
<a href="<%= `/${_context.locale}/pages/${page.id}/
|
|
48
|
+
<a href="<%= `/${_context.locale}/pages/${page.id}/deletes/new` %>" class="btn-danger has-icon">
|
|
49
49
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
|
|
50
50
|
<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" />
|
|
51
51
|
</svg>
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
Edit content
|
|
126
126
|
</a>
|
|
127
127
|
|
|
128
|
-
<a href="<%= `/${_context.locale}/page_revisions/${revision.id}/
|
|
128
|
+
<a href="<%= `/${_context.locale}/page_revisions/${revision.id}/publishes/new` %>" class="btn-text has-icon <%= revision.meta && revision.meta.locked ? 'cursor-not-allowed text-gray-400 pointer-events-none' : '' %>">
|
|
129
129
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
|
|
130
130
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z" />
|
|
131
131
|
</svg>
|
|
@@ -160,14 +160,14 @@
|
|
|
160
160
|
</a>
|
|
161
161
|
|
|
162
162
|
<% if (revision.meta && revision.meta.locked) { %>
|
|
163
|
-
<form action="<%= `/${_context.locale}/page_revisions/${revision.id}/
|
|
163
|
+
<form action="<%= `/${_context.locale}/page_revisions/${revision.id}/unlocks` %>" method="post" class="inline-flex gap-2 items-center">
|
|
164
164
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
|
|
165
165
|
<path stroke-linecap="round" stroke-linejoin="round" d="M13.5 10.5V6.75a4.5 4.5 0 1 1 9 0v3.75M3.75 21.75h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H3.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z" />
|
|
166
166
|
</svg>
|
|
167
167
|
<%- f.submit('Unlock', { class: 'btn-text' }) %>
|
|
168
168
|
</form>
|
|
169
169
|
<% } else { %>
|
|
170
|
-
<a href="<%= `/${_context.locale}/page_revisions/${revision.id}/
|
|
170
|
+
<a href="<%= `/${_context.locale}/page_revisions/${revision.id}/locks/new` %>" class="btn-text has-icon">
|
|
171
171
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
|
|
172
172
|
<path stroke-linecap="round" stroke-linejoin="round" d="M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z" />
|
|
173
173
|
</svg>
|
|
@@ -278,4 +278,4 @@
|
|
|
278
278
|
</tbody>
|
|
279
279
|
</table>
|
|
280
280
|
</div>
|
|
281
|
-
</div>
|
|
281
|
+
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<% form_for({ translation }, errors, (f) => { %>
|
|
2
|
-
<form action="<%= `/${_context.locale}/pages/${page.id}/
|
|
2
|
+
<form action="<%= `/${_context.locale}/pages/${page.id}/translations` %>" method="post" class="form">
|
|
3
3
|
<input type="hidden" name="target_locale" value="<%= targetLocale %>" />
|
|
4
4
|
|
|
5
5
|
<%- f.field('translation.title', { required: true }) %>
|
|
@@ -73,4 +73,4 @@
|
|
|
73
73
|
})
|
|
74
74
|
|
|
75
75
|
document.getElementById("f_visibility").addEventListener("change", onVisibilityChange)
|
|
76
|
-
</script>
|
|
76
|
+
</script>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
<div class="grid gap-4 md:grid-cols-3">
|
|
7
7
|
<% form_for({ change }, errors, (f) => { %>
|
|
8
|
-
<form action="<%= `/${_context.locale}/pages/${change.id}/
|
|
8
|
+
<form action="<%= `/${_context.locale}/pages/${change.id}/urls` %>" method="post" class="form">
|
|
9
9
|
<%- f.field('change.slug', { label: "URL", required: true }) %>
|
|
10
10
|
<%- f.field('change.redirect', { as: "checkbox", value: "1", label: "Create 301 redirect for the old URL" }) %>
|
|
11
11
|
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
|
-
</div>
|
|
31
|
+
</div>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import RaketaClient from "./RaketaClient";
|
|
2
|
-
import { ChangePageSlugDocument } from "./documents/pagesDocuments";
|
|
3
|
-
|
|
4
|
-
export default class ChangePageURL extends RaketaClient {
|
|
5
|
-
async update(id, slug, locale, redirect) {
|
|
6
|
-
const input = {
|
|
7
|
-
id,
|
|
8
|
-
slug,
|
|
9
|
-
locale,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
if (redirect) {
|
|
13
|
-
input.redirect = redirect;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const {
|
|
17
|
-
changePageSlug: { errors, page },
|
|
18
|
-
} = await this.query(ChangePageSlugDocument, {
|
|
19
|
-
input,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
return { page, errors };
|
|
23
|
-
}
|
|
24
|
-
}
|
package/src/cloud/ClonePage.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import RaketaClient from "./RaketaClient";
|
|
2
|
-
import { ClonePageDocument } from "./documents/pagesDocuments";
|
|
3
|
-
|
|
4
|
-
export default class ClonePage extends RaketaClient {
|
|
5
|
-
async clone(id, locale) {
|
|
6
|
-
const {
|
|
7
|
-
clonePage: { errors, page },
|
|
8
|
-
} = await this.query(ClonePageDocument, {
|
|
9
|
-
input: { id: id, locale: locale },
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
return { page, errors };
|
|
13
|
-
}
|
|
14
|
-
}
|
package/src/cloud/DeletePage.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import RaketaClient from "./RaketaClient";
|
|
2
|
-
import {
|
|
3
|
-
DeletePageDocument,
|
|
4
|
-
PageByIdDocument,
|
|
5
|
-
} from "./documents/pagesDocuments";
|
|
6
|
-
|
|
7
|
-
export default class DeletePage extends RaketaClient {
|
|
8
|
-
async find(id, locale) {
|
|
9
|
-
const { page: item } = await this.query(PageByIdDocument, {
|
|
10
|
-
input: {
|
|
11
|
-
id,
|
|
12
|
-
locale,
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
return item;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async delete(id, locale, redirect) {
|
|
20
|
-
const input = {
|
|
21
|
-
id,
|
|
22
|
-
locale,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
if (redirect) {
|
|
26
|
-
input.redirect = redirect;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const {
|
|
30
|
-
deletePage: { errors, page },
|
|
31
|
-
} = await this.query(DeletePageDocument, { input });
|
|
32
|
-
|
|
33
|
-
return { page, errors };
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import RaketaClient from "./RaketaClient";
|
|
2
|
-
import { TranslatePageDocument } from "./documents/pagesDocuments";
|
|
3
|
-
|
|
4
|
-
export default class PageTranslations extends RaketaClient {
|
|
5
|
-
async create(locale, sourcePageId, params) {
|
|
6
|
-
console.log(params);
|
|
7
|
-
params.widgets = JSON.stringify(params.widgets);
|
|
8
|
-
params.settings = JSON.stringify(params.settings);
|
|
9
|
-
console.log(params);
|
|
10
|
-
const {
|
|
11
|
-
translatePage: { errors, page },
|
|
12
|
-
} = await this.query(TranslatePageDocument, {
|
|
13
|
-
input: {
|
|
14
|
-
locale,
|
|
15
|
-
sourcePageId,
|
|
16
|
-
page: params,
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return { page, errors };
|
|
21
|
-
}
|
|
22
|
-
}
|