Skip to content

Commit

Permalink
Reviews Implementation. Adding, Deleting, Searching, etc. reviews.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis-Fernando-Molina committed Jan 15, 2021
1 parent e4f2539 commit 4dba376
Show file tree
Hide file tree
Showing 14 changed files with 503 additions and 41 deletions.
4 changes: 2 additions & 2 deletions Client/WebServer/css/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ width: 100%;

.docs-search-results-header-tabs-container {
display: table;
padding-left: 240px;
padding-left: 180px;
margin-top: 20px;
}

Expand Down Expand Up @@ -848,7 +848,7 @@ width: 100%;
/* Search Results Page Content */
.docs-search-result-content {
border-top: 1px solid #0295aa;
margin-left: -240px;
margin-left: -180px;
}

.docs-search-result-content > div {
Expand Down
39 changes: 39 additions & 0 deletions Client/httpInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,36 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
}
break
}
case 'Save-Review-Schema': {
getBody(processRequest)

async function processRequest(body) {
try {
let docsSchema = JSON.parse(body)
let project = requestParameters[3]
let filePath = global.env.PATH_TO_PROJECTS + '/' + project + '/Schemas/Docs-Reviews'

if (checkAllSchmemaDocuments('Review', docsSchema, filePath) === true) {
respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse)
} else {
respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), httpResponse)
}

} catch (err) {
console.log('[ERROR] httpInterface -> Docs -> Save-Review-Schema -> Method call produced an error.')
console.log('[ERROR] httpInterface -> Docs -> Save-Review-Schema -> err.stack = ' + err.stack)
console.log('[ERROR] httpInterface -> Docs -> Save-Review-Schema -> Params Received = ' + body)

let error = {
result: 'Fail Because',
message: err.message,
stack: err.stack
}
respondWithContent(JSON.stringify(error), httpResponse)
}
}
break
}
case 'Save-Book-Schema': {
getBody(processRequest)

Expand Down Expand Up @@ -479,6 +509,11 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
fileName = cleanFileName(fileName)
break
}
case 'Review': {
fileName = schemaDocument.review.toLowerCase() + '-' + pageNumber.substring(pageNumber.length - 3, pageNumber.length) + '-' + schemaDocument.type.toLowerCase()
fileName = cleanFileName(fileName)
break
}
}
fileName = fileName + '.json'

Expand Down Expand Up @@ -1370,6 +1405,10 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
folder = 'Docs-Tutorials'
break
}
case 'DocsReviewSchema': {
folder = 'Docs-Reviews'
break
}
case 'DocsBookSchema': {
folder = 'Docs-Books'
break
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"review": "Superalgos Project Review",
"pageNumber": "1",
"type": "Superalgos Review - Leave Your Feedback!",
"definition": {
"text": "This is the place where you can leave your feedback and impressions about the project, for others to find and read.",
"updated": 1610701752995
},
"paragraphs": [
{
"style": "Success",
"text": "After you create your own review page as part of this collection, you will be able to edit it over time, and add more info as your experience evolves with the system. So, don't worry is right now you can just write your first impressions. You will allways be able to come back and extend your page.",
"updated": 1610701884353
},
{
"style": "Title",
"text": "How to add your own Review",
"updated": 1610702480960
},
{
"style": "Text",
"text": "In order to add your own review page of the Superalgos Project, copy and paste the following code at the search bar:"
},
{
"style": "Json",
"text": "docs.add Review to Superalgos: Superalgos Project Review->Superalgos Review - YOUR REVIEW TITLE",
"updated": 1610702550459
},
{
"style": "List",
"text": "YOUR REVIEW TITLE: Replace this placeholder text for a short title for your Review Page."
},
{
"style": "Important",
"text": "You need to sign your Review Page. At the en of the text, type your Github.com username. This needs to be present in order for the Review to be added to the next release of Superalgos.",
"updated": 1610702866522
},
{
"style": "Text",
"text": "Your review will be merged into the main repository once you send it as a contribution. For that you need to execute:"
},
{
"style": "Json",
"text": "docs.save"
},
{
"style": "Json",
"text": "app.contribute"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@
"updated": 1609150474236
},
{
"style": "Text",
"style": "Subtitle",
"text": "Option 1: ",
"updated": 1609149432117
},
{
"style": "Javascript",
"style": "Json",
"text": "docs.add Node to Project: Docs Page Name",
"updated": 1609149799453
},
{
"style": "Text",
"style": "Subtitle",
"text": "Example: ",
"updated": 1609149442319
},
{
"style": "Javascript",
"style": "Json",
"text": "docs.add Node to Superalgos"
},
{
"style": "Text",
"style": "Subtitle",
"text": "Option 2: ",
"updated": 1609149450546
},
Expand All @@ -42,7 +42,7 @@
"updated": 1609149807897
},
{
"style": "Text",
"style": "Subtitle",
"text": "Example: ",
"updated": 1609149457691
},
Expand All @@ -51,7 +51,7 @@
"text": "docs.add Concept to Superalgos"
},
{
"style": "Text",
"style": "Subtitle",
"text": "Option 3: ",
"updated": 1609149464103
},
Expand All @@ -61,7 +61,7 @@
"updated": 1609149846658
},
{
"style": "Text",
"style": "Subtitle",
"text": "Example: ",
"updated": 1609149471266
},
Expand All @@ -70,32 +70,69 @@
"text": "docs.add Topic to Superalgos: Docs Styles->Docs Text Style->1",
"updated": 1609149878993
},
{
"style": "Subtitle",
"text": "Option 4:",
"updated": 1610706520317
},
{
"style": "Json",
"text": "docs.add Topic to Project: Docs Tutorial Name->Docs Page Name->Docs Page Number",
"updated": 1610706514194
},
{
"style": "Subtitle",
"text": "Example:"
},
{
"style": "Json",
"text": "docs.add Tutorial to Superalgos: How to Build Indicators->Intro",
"updated": 1610706570716
},
{
"style": "Subtitle",
"text": "Option 5:",
"updated": 1610706652124
},
{
"style": "Json",
"text": "docs.add Review to Project: Docs Review Name->Docs Page Name->Docs Page Number",
"updated": 1610706722998
},
{
"style": "Subtitle",
"text": "Example:"
},
{
"style": "Json",
"text": "docs.add Review to Project: Superalgos Project Review->Superalgos Review - Great Project!",
"updated": 1610706675495
},
{
"style": "Title",
"text": "Parameters",
"updated": 1609150484701
"text": "Parameters"
},
{
"style": "Text",
"style": "List",
"text": "Project : Is the project where the Node, Concept or Topic is defined."
},
{
"style": "Text",
"style": "List",
"text": "Docs Page Category : Node, Concept or Topic."
},
{
"style": "Text",
"style": "List",
"text": "Docs Topic Name: The name of the topic which the new page will belong to.",
"updated": 1609149944222
},
{
"style": "Text",
"style": "List",
"text": "Docs Page Name : For Nodes it is the type of node, for Concepts, the concept name, for topics, the topic's page name."
},
{
"style": "Text",
"text": "Docs Page Numer: A page number that you would like to assing the new page. This will impact only at the position of the Topic Index.",
"updated": 1609149987475
"style": "List",
"text": "Docs Page Numer: Optional. A page number that you would like to assing the new page. This will impact only at the position of the Topic Index. If you don't provide one, it will be automatically assigned the last page number in the collection plus 1.",
"updated": 1610706305834
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"updated": 1609152160707
},
{
"style": "Text",
"style": "Subtitle",
"text": "Option 1:",
"updated": 1609152344322
},
Expand All @@ -23,7 +23,7 @@
"updated": 1609152359725
},
{
"style": "Text",
"style": "Subtitle",
"text": "Example:"
},
{
Expand All @@ -32,16 +32,16 @@
"updated": 1609152405379
},
{
"style": "Text",
"style": "Subtitle",
"text": "Option 2:"
},
{
"style": "Javascript",
"style": "Json",
"text": "docs.delete Concept from Project: Docs Page Name",
"updated": 1609152445366
},
{
"style": "Text",
"style": "Subtitle",
"text": "Example:"
},
{
Expand All @@ -50,7 +50,7 @@
"updated": 1609152464312
},
{
"style": "Text",
"style": "Subtitle",
"text": "Option 3:"
},
{
Expand All @@ -59,28 +59,66 @@
"updated": 1609152484236
},
{
"style": "Text",
"style": "Subtitle",
"text": "Example:"
},
{
"style": "Json",
"text": "docs.delete Topic from Superalgos: Docs Styles->Docs Text Style->1",
"updated": 1609152521245
},
{
"style": "Subtitle",
"text": "Option 4:",
"updated": 1610706965604
},
{
"style": "Json",
"text": "docs.delete Tutorial from Project: Docs Tutorial Name->Docs Page Name->Docs Page Number",
"updated": 1610706951438
},
{
"style": "Subtitle",
"text": "Example:"
},
{
"style": "Json",
"text": "docs.delete Tutorial from Superalgos: How to Build Indicatiors->Intro->1",
"updated": 1610707006603
},
{
"style": "Subtitle",
"text": "Option 5:",
"updated": 1610707021714
},
{
"style": "Json",
"text": "docs.delete Review from Project: Docs Review Name->Docs Page Name->Docs Page Number",
"updated": 1610707068615
},
{
"style": "Subtitle",
"text": "Example:"
},
{
"style": "Json",
"text": "docs.delete Review from Project: Superalgos Project Review->Awasome!->2",
"updated": 1610707101903
},
{
"style": "Title",
"text": "Parameters"
},
{
"style": "Text",
"style": "List",
"text": "Project : Is the project where the Node, Concept or Topic is defined."
},
{
"style": "Text",
"style": "List",
"text": "Docs Page Category : Node, Concept or Topic."
},
{
"style": "Text",
"style": "List",
"text": "Docs Page Name : For Nodes it is the type of node, for Concepts, the concept name, for topics, the topic's page name."
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"topic": "Docs Commands Errors",
"pageNumber": "17",
"type": "No Matching Topic Or Tutorial Found",
"type": "No Matching Topic, Tutorial or Review Found",
"definition": {
"text": "The Topic or Tutorial you specified did not produce any match of pages within that Topic or Tutorial.",
"updated": 1610398888306
Expand Down
Loading

0 comments on commit 4dba376

Please sign in to comment.