Skip to content

Commit

Permalink
Merge pull request #265 from AyshaHakeem/feat-markdown-editor
Browse files Browse the repository at this point in the history
feat(wiki): markdown editor
  • Loading branch information
shariquerik authored Sep 19, 2024
2 parents e1f3521 + a7cf1ca commit f210ca3
Show file tree
Hide file tree
Showing 17 changed files with 2,154 additions and 2,355 deletions.
12 changes: 5 additions & 7 deletions cypress/e2e/wiki.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ context("Wiki", () => {
cy.get(".edit-wiki-btn").click();

cy.get(".doc-sidebar .sidebar-group:first-child .add-sidebar-page").click();
cy.get(".wiki-editor .ProseMirror")
.clear()
.type("Test Wiki Page{enter}New Wiki Page");
cy.get(".wiki-editor .wiki-title-input").clear().type("Test Wiki Page");
cy.get(".ace_text-input").first().focus().type("New Wiki Page");
cy.get('.btn:contains("Save"):visible').click();

cy.intercept("*/test-wiki-page").as("testWikiPage");
Expand All @@ -28,17 +27,16 @@ context("Wiki", () => {
cy.get(".dropdown-toggle.wiki-options").click();
cy.get(".edit-wiki-btn").click();

cy.get(".wiki-editor .ProseMirror")
.clear()
.type("Old Wiki Page{enter}Old Wiki Page");
cy.get(".wiki-editor .wiki-title-input").clear().type("Old Wiki Page");
cy.get(".ace_text-input").first().focus().type("Old wiki page");
cy.get('.btn:contains("Save"):visible').click();

cy.intercept("*/test-wiki-page").as("testWikiPage");
cy.wait("@testWikiPage");

cy.get(".sidebar-item.active").should("contain", "Old Wiki Page");
cy.get(".from-markdown h1").should("contain", "Old Wiki Page");
cy.get(".from-markdown p").should("contain", "Old Wiki Page");
cy.get(".from-markdown p").should("contain", "Old wiki page");
});

it("deletes a wiki page", () => {
Expand Down
5 changes: 2 additions & 3 deletions cypress/e2e/wiki_sidebar.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ context("Wiki Sidebar", () => {
cy.contains("Submit").click();

cy.get(".doc-sidebar .sidebar-group:last-child .add-sidebar-page").click();
cy.get(".wiki-editor .ProseMirror")
.clear()
.type("Test Wiki Page{enter}New Wiki Page");
cy.get(".wiki-editor .wiki-title-input").clear().type("Test Wiki Page");
cy.get(".ace_text-input").first().focus().type("New Wiki Page");
cy.get('.btn:contains("Save"):visible').click();

cy.get(".sidebar-group").should("contain", "Test Wiki Sidebar");
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@tiptap/extension-text-align": "^2.0.2",
"@tiptap/pm": "^2.0.2",
"@tiptap/starter-kit": "^2.0.2",
"ace-builds": "^1.36.2",
"htmldiff-js": "^1.0.5",
"lowlight": "^2.8.1",
"pre-commit": "^1.2.2"
Expand Down
1 change: 1 addition & 0 deletions wiki/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ wiki.wiki.doctype.wiki_feedback.patches.delete_wiki_feedback_item
[post_model_sync]
wiki.wiki.doctype.wiki_space.patches.wiki_sidebar_migration
wiki.wiki.doctype.wiki_settings.patches.wiki_navbar_item_migration
wiki.wiki.doctype.wiki_page.patches.convert_wiki_content_to_markdown
Loading

0 comments on commit f210ca3

Please sign in to comment.