From 1f6f6bc132553ecd091f5fba547cfb1798f325f5 Mon Sep 17 00:00:00 2001 From: Ali Azmoodeh Date: Sat, 27 Aug 2022 21:15:54 +0430 Subject: [PATCH] new version 1.0.1 --- CHANGELOG/1.x/CHANGELOG.md | 12 ++++- .../components/tags/tagSection/boxSection.js | 8 ++- .../tags/tagSection/detailsForEvents.js | 2 +- .../tags/tagSection/itemInSection.js | 17 ++++--- lib/ui/public/style.css | 13 +++++ lib/util/Utilities.js | 4 +- lib/validation/index.js | 50 +++++++++---------- package-lock.json | 4 +- package.json | 2 +- src/obj/ObjectValidation.js | 2 +- 10 files changed, 69 insertions(+), 45 deletions(-) diff --git a/CHANGELOG/1.x/CHANGELOG.md b/CHANGELOG/1.x/CHANGELOG.md index dae0f19..3d86544 100644 --- a/CHANGELOG/1.x/CHANGELOG.md +++ b/CHANGELOG/1.x/CHANGELOG.md @@ -6,4 +6,14 @@ Change Log 2022-08-27 * remove publicRoute in arguments - * write openRTP docs for yaml file \ No newline at end of file + * write openRTP docs for yaml file + +## Version 1.0.1 + +2022-08-27 + + * Fix view bug in show different view + * Fix bug in disable to show empty events table + * Fix bug in default tag + * Refactor code + * Changed css file \ No newline at end of file diff --git a/lib/ui/components/tags/tagSection/boxSection.js b/lib/ui/components/tags/tagSection/boxSection.js index 3b07680..4a80849 100644 --- a/lib/ui/components/tags/tagSection/boxSection.js +++ b/lib/ui/components/tags/tagSection/boxSection.js @@ -12,9 +12,13 @@ module.exports.boxSection = (name, arrowId, haveDescription, isCommonAuth) => { if (haveDescription) baseDiv = ' \n'; - if (isCommonAuth) + if (isCommonAuth && !haveDescription) + return base + baseDiv + + ' \n \n'; + + if (isCommonAuth && haveDescription) return base + baseDiv + ' \n \n'; - return base+ baseDiv+ '\n'; + return base + baseDiv + '\n'; } \ No newline at end of file diff --git a/lib/ui/components/tags/tagSection/detailsForEvents.js b/lib/ui/components/tags/tagSection/detailsForEvents.js index b28f6b6..ad23170 100644 --- a/lib/ui/components/tags/tagSection/detailsForEvents.js +++ b/lib/ui/components/tags/tagSection/detailsForEvents.js @@ -5,7 +5,7 @@ let { module.exports.detailsForEvents = (data) => { - if (!isDefined(data)) + if (!isDefined(data)|| data === '') return ''; return '
\n' + diff --git a/lib/ui/components/tags/tagSection/itemInSection.js b/lib/ui/components/tags/tagSection/itemInSection.js index 4dfc6ea..941168d 100644 --- a/lib/ui/components/tags/tagSection/itemInSection.js +++ b/lib/ui/components/tags/tagSection/itemInSection.js @@ -6,16 +6,15 @@ let { module.exports.itemInSection = (name, isLastItem, id, isUsedAuth, details) => { - let base = '
\n'; + let base = ''; - if (isDefined(details) && !isUsedAuth) - base = '
'; + base = '
' + + '

ON

\n' + '

' + name + '

\n'; - base += '

ON

\n'; - if (isUsedAuth && isDefined(details)) - base += '
ON

\n' + '
' + '

' + name + '

\n'; @@ -26,7 +25,9 @@ module.exports.itemInSection = (name, isLastItem, id, isUsedAuth, details) => { if (isUsedAuth) base += '
\n'; - base += ' \n'; + + if (isUsedAuth) + base += ' \n'; base += '
\n'; diff --git a/lib/ui/public/style.css b/lib/ui/public/style.css index 39fedb5..bc73d23 100644 --- a/lib/ui/public/style.css +++ b/lib/ui/public/style.css @@ -310,6 +310,15 @@ p .p, .white { margin-top: 4%; } +.margin-bottom-4 { + margin-bottom: 4%; +} + +.img-auth { + margin-bottom: 3%; + margin-left: 75%; +} + .margin-bottom-3 { margin-bottom: 3%; } @@ -571,4 +580,8 @@ dialog { width: 82%; } + .img-auth { + margin-left: 83%; + } + } \ No newline at end of file diff --git a/lib/util/Utilities.js b/lib/util/Utilities.js index 2856b91..a95a3eb 100644 --- a/lib/util/Utilities.js +++ b/lib/util/Utilities.js @@ -50,7 +50,7 @@ module.exports = { return Math.floor(Math.random() * MAX_RANDOM_RANGE); }, - getObjectValidationForEvent(item){ + getObjectValidationForEvent(item) { let newObject = item, name = newObject?.name, description = newObject?.description; @@ -64,7 +64,7 @@ module.exports = { return newObject; }, - getObjectValidationForModels(item){ + getObjectValidationForModels(item) { let newObject = item, name = newObject?.name, type = newObject?.type, diff --git a/lib/validation/index.js b/lib/validation/index.js index 07df863..a2abbca 100644 --- a/lib/validation/index.js +++ b/lib/validation/index.js @@ -108,41 +108,37 @@ function validationPathObject() { let tags = object?.tags, isTagUsed = isDefined(tags), tagValidation = (tag) => { - tagsObjectInRootObject?.forEach(item => { - - let isValidTag = item?.name === tag, - description = item?.description, - initObject = () => { - let isInitDataObject = isDefined(groupOfObjectWithTagKey[tag]?.data); + let initObject = (description) => { + let isInitDataObject = isDefined(groupOfObjectWithTagKey[tag]?.data); - if (!isInitDataObject) { - groupOfObjectWithTagKey[tag] = {}; - groupOfObjectWithTagKey[tag].data = []; - } + if (!isInitDataObject) { + groupOfObjectWithTagKey[tag] = {}; + groupOfObjectWithTagKey[tag].data = []; + } - if (!isDefined(groupOfObjectWithTagKey[tag]?.description) && isDefined(description) && !isInitDataObject) - groupOfObjectWithTagKey[tag].description = description; + if (!isDefined(groupOfObjectWithTagKey[tag]?.description) && isDefined(description) && !isInitDataObject) + groupOfObjectWithTagKey[tag].description = description; - }, - isDefaultTag = 'Default' === tag; + }, + isDefaultTag = 'Default' === tag; + if (isDefaultTag) { + initObject(); object.route = route; + pushInObject(tag, object); + return; + } - if (isValidTag && !isDefaultTag) { - initObject(); - pushInObject(tag, object, description); - return; - } + tagsObjectInRootObject?.forEach(item => { - if (isDefaultTag && isValidTag) { - initObject(); - pushInObject(tag, object, description); - return; - } + let isValidTag = item?.name === tag, + description = item?.description; - if (isDefaultTag && !isValidTag) { - initObject(); - pushInObject(tag, object); + object.route = route; + + if (isValidTag) { + initObject(description); + pushInObject(tag, object, description); return; } diff --git a/package-lock.json b/package-lock.json index b89fc5d..0ba47c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "openrtp", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "openrtp", - "version": "1.0.0", + "version": "1.0.1", "license": "MIT", "dependencies": { "express": "^4.18.1", diff --git a/package.json b/package.json index 8c1e553..a9a226c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openrtp", - "version": "1.0.0", + "version": "1.0.1", "description": "Is a text-based software framework supported by an extensive ecosystem of tools that help developers design, build, document, and use programming relationships for socket.io.", "main": "index.js", "scripts": { diff --git a/src/obj/ObjectValidation.js b/src/obj/ObjectValidation.js index af06fc2..6391517 100644 --- a/src/obj/ObjectValidation.js +++ b/src/obj/ObjectValidation.js @@ -82,7 +82,7 @@ function paths() { let newParameterArr = []; - object?.parameters?.forEach((itemForParameter, index, arr) => { + object?.parameters?.forEach(itemForParameter => { let args = itemForParameter?.args; let isUsedArgs = args !== undefined;