-
Notifications
You must be signed in to change notification settings - Fork 3
[#114] Refactor and cleaning of some entities and other minor changes #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
0a15cd5
feat: add json schemas for DB
nicodr97 455e0f7
Merge remote-tracking branch 'origin/master' into feature/add-json-sc…
nicodr97 2c812f8
chore: keep same dir structure for sample data
nicodr97 a25ad3c
fix: warning on deprecated
nicodr97 8bd2f7f
chore: delete countries collection
nicodr97 9148ef0
chore: delete crypPassword user attribute
nicodr97 0dbb052
chore: remove unused function
nicodr97 9e9fdaf
chore: remove unused code
nicodr97 b11b119
chore: ignore token on mongo db
nicodr97 8b6f9de
chore: ignore token info on mongo db
nicodr97 8a78531
chore: ignore Vault and mug token attributes in mongo db
nicodr97 4e5732e
refactor: use enum for user type
nicodr97 dab2406
chore: remove unused function
nicodr97 33b4850
refactor: use enum for use status
nicodr97 a55699a
chore: remove unused attribute "DataSample"
nicodr97 8b5cb28
refactor: reorder function parameters
nicodr97 31ba6e6
fix: import classes and functions before starting session
nicodr97 d99bb91
fix: user creation and update
nicodr97 005fb25
chore: remove debugs
nicodr97 b5c8202
refactor: User class
nicodr97 2ac307f
chore: remove debug
nicodr97 5e6be65
refactor: rename sample data variables
nicodr97 ecc7811
refactor: use session to save Vault user info
nicodr97 82aff14
refactor: add getters and setters for User class
nicodr97 a666e1a
chore: autoformat
nicodr97 7809094
refactor: admin users
nicodr97 fe36af0
chore: autoformat
nicodr97 9557756
refactor: use array to avoid mongodb Cursor exception
nicodr97 ede32a7
refactor: dashboard
nicodr97 1b8eb54
refactor: centralize user queries to database
nicodr97 2f77e53
refactor: remove old eush project files
nicodr97 b0f6edc
chore: clean useless lines
nicodr97 637f076
refactor: class attributes
nicodr97 4c900f4
chore: autoformat
nicodr97 6f21184
refactor: also remove some old code
nicodr97 8efe796
chore: autoformat
nicodr97 a013033
chore: remove useless code
nicodr97 82ad040
chore: avoid warnings
nicodr97 4ce1176
chore: autoformat
nicodr97 6ba21f2
chore: remove EGA form defaults
nicodr97 8554ce8
chore: remove old comments and code
nicodr97 2d3350f
feat: check EGA credentials and some refactor
nicodr97 2f2056f
feat: add private key field to ega form
nicodr97 5e8f53f
chore: remove old key pair
nicodr97 86c4d07
Merge remote-tracking branch 'origin/feature/add-json-schemas' into f…
nicodr97 1faac6d
chore: remove log
nicodr97 ff5183e
chore: remove comments
nicodr97 1370852
chore: remove comment
nicodr97 d752b9e
chore: update error message
nicodr97 54470ce
chore: remove old comment
nicodr97 664cd9f
fix: redirect to form on credentials clean
nicodr97 9c8988b
refactor: always show empty EGA form at each access
nicodr97 d71ebe1
chore: remove log including credentials
nicodr97 011e2c6
fix: check username and password are provided for EGA account
nicodr97 275737f
chore: add missing TODO to comment
nicodr97 cc7c894
fix: do not display useless button
nicodr97 467af70
chore: update error message on unknown action
nicodr97 e88ee89
refactor: desearilze BSON on query
nicodr97 8b1d69d
Merge pull request #10 from inab/feature/ega-auth
nicodr97 d3530b8
Merge branch 'master' into feature/add-json-schemas
nicodr97 637ff61
fix: EGA linked account update and vault connection
nicodr97 6f7ce91
Merge branch 'master' into feature/add-json-schemas
nicodr97 ce004e7
feat: add some logs on EGA linked account
nicodr97 6ce9267
chore: remove json schemas
nicodr97 57ada99
chore: remove commented echo
nicodr97 d6a993c
refactor: change variable name
nicodr97 e644220
chore: remove typemap attribute from mongo queries, already default
nicodr97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,147 +1,146 @@ | ||
| <?php | ||
|
|
||
| require __DIR__."/../../config/bootstrap.php"; | ||
| require __DIR__ . "/../../config/bootstrap.php"; | ||
|
|
||
| redirectToolDevOutside(); | ||
|
|
||
| if(!isset($_REQUEST['id'])) { | ||
| if (!isset($_REQUEST['id'])) { | ||
|
|
||
| $_SESSION['errorData']['Error'][] = "Please provide a tool id."; | ||
| redirect($GLOBALS['BASEURL'].'admin/myNewTools.php'); | ||
|
|
||
| redirect($GLOBALS['BASEURL'] . 'admin/myNewTools.php'); | ||
| } | ||
|
|
||
| $toolDevJSON = $GLOBALS['toolsDevMetaCol']->findOne(array('_id' => $_REQUEST['id'])); | ||
|
|
||
| if(!isset($toolDevJSON)) { | ||
| $_SESSION['errorData']['Error'][] = "The tool id <strong>".$_REQUEST['toolid']."</strong> doesn't exist in our database."; | ||
| redirect($GLOBALS['BASEURL'].'admin/myNewTools.php'); | ||
| if (!isset($toolDevJSON)) { | ||
| $_SESSION['errorData']['Error'][] = "The tool id <strong>" . $_REQUEST['toolid'] . "</strong> doesn't exist in our database."; | ||
| redirect($GLOBALS['BASEURL'] . 'admin/myNewTools.php'); | ||
| } | ||
|
|
||
| $toolDevMetaJSON = $GLOBALS['toolsDevMetaCol']->findOne(array('_id' => $_REQUEST['id'], 'user_id' => $_SESSION['User']['id'])); | ||
|
|
||
| if(!isset($toolDevMetaJSON) && ($_SESSION['User']['Type'] != 0)) { | ||
| $_SESSION['errorData']['Error'][] = "The tool id <strong>".$_REQUEST['toolid']."</strong> you are trying to edit doesn't belong to you."; | ||
| redirect($GLOBALS['BASEURL'].'admin/myNewTools.php'); | ||
| if (!isset($toolDevMetaJSON) && ($_SESSION['User']['Type'] != UserType::Admin->value)) { | ||
| $_SESSION['errorData']['Error'][] = "The tool id <strong>" . $_REQUEST['toolid'] . "</strong> you are trying to edit doesn't belong to you."; | ||
| redirect($GLOBALS['BASEURL'] . 'admin/myNewTools.php'); | ||
| } | ||
|
|
||
| ?> | ||
|
|
||
| <?php require "../htmlib/header.inc.php"; ?> | ||
|
|
||
| <body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white page-container-bg-solid page-sidebar-fixed"> | ||
| <div class="page-wrapper"> | ||
|
|
||
| <?php require "../htmlib/top.inc.php"; ?> | ||
| <?php require "../htmlib/menu.inc.php"; ?> | ||
|
|
||
|
|
||
| <!-- BEGIN CONTENT --> | ||
| <div class="page-content-wrapper"> | ||
| <!-- BEGIN CONTENT BODY --> | ||
| <div class="page-content"> | ||
| <!-- BEGIN PAGE HEADER--> | ||
| <!-- BEGIN PAGE BAR --> | ||
| <div class="page-bar"> | ||
| <ul class="page-breadcrumb"> | ||
| <li> | ||
| <span>Admin</span> | ||
| <i class="fa fa-circle"></i> | ||
| </li> | ||
| <li> | ||
| <a href="admin/myNewTools.php">My new tools</a> | ||
| <i class="fa fa-circle"></i> | ||
| </li> | ||
| <li> | ||
| <span>Tool specification</span> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| <!-- END PAGE BAR --> | ||
| <!-- BEGIN PAGE TITLE--> | ||
| <h1 class="page-title"> Tool specification | ||
| </h1> | ||
| <!-- END PAGE TITLE--> | ||
| <!-- END PAGE HEADER--> | ||
|
|
||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <?php | ||
| $error_data = false; | ||
| if ($_SESSION['errorData']){ | ||
| $error_data = true; | ||
| ?> | ||
| <?php if ($_SESSION['errorData']['Info']) { ?> | ||
| <div class="alert alert-info"> | ||
| <?php } else { ?> | ||
| <div class="alert alert-danger"> | ||
| <?php } ?> | ||
|
|
||
| <?php | ||
| foreach($_SESSION['errorData'] as $subTitle=>$txts){ | ||
| print "<strong>$subTitle</strong><br/>"; | ||
| foreach($txts as $txt){ | ||
| print "<div>$txt</div>"; | ||
| } | ||
| } | ||
| unset($_SESSION['errorData']); | ||
| ?> | ||
| </div> | ||
| <?php } ?> | ||
| </div> | ||
| </div> | ||
|
|
||
| <form name="new-tool" id="new-tool" action="applib/updateToolDevSpec.php" method="post" > | ||
|
|
||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <p style="margin-top:0;">Paste or write your JSON code in the text area below. Once the JSON is correct, | ||
| you can validate it against our <a href="https://raw.githubusercontent.com/Multiscale-Genomics/VRE_tool_jsons/dev/tool_specification/tool_schema.json" target="_blank">JSON Schema</a>. Click the buttons below for further information:</p> | ||
| <p> | ||
| <a class="btn btn-xs green" href="http://multiscalegenomics.eu/MuGVRE/tool-specification-attributes/" target="_blank"><i class="fa fa-tag" aria-hidden="true"></i> Attribute's help</a> | ||
| <a class="btn btn-xs green" href="http://multiscalegenomics.eu/MuGVRE/file-types/" target="_blank"><i class="fa fa-list" aria-hidden="true"></i> Available File Types</a> | ||
| <a class="btn btn-xs green" href="http://multiscalegenomics.eu/MuGVRE/data-types/" target="_blank"><i class="fa fa-list" aria-hidden="true"></i> Available Data Type</a> | ||
| <a class="btn btn-xs green" href="javascript:;" target="_blank"><i class="fa fa-list" aria-hidden="true"></i> List of keywords</a> | ||
| </p> | ||
| <!-- BEGIN EXAMPLE TABLE PORTLET--> | ||
| <div class="portlet light portlet-fit bordered"> | ||
| <div class="portlet-body form" id="portlet-json"> | ||
| <input type="hidden" name="toolid" value="<?php echo $_REQUEST['id']; ?>" /> | ||
| <textarea id="code_editor" name="json_tool" placeholder="Please, paste or write your JSON code here..."><?php echo json_encode($toolDevJSON["step3"]["tool_spec"], JSON_PRETTY_PRINT); ?></textarea> | ||
| <div class="page-wrapper"> | ||
|
|
||
| <?php require "../htmlib/top.inc.php"; ?> | ||
| <?php require "../htmlib/menu.inc.php"; ?> | ||
|
|
||
|
|
||
| <!-- BEGIN CONTENT --> | ||
| <div class="page-content-wrapper"> | ||
| <!-- BEGIN CONTENT BODY --> | ||
| <div class="page-content"> | ||
| <!-- BEGIN PAGE HEADER--> | ||
| <!-- BEGIN PAGE BAR --> | ||
| <div class="page-bar"> | ||
| <ul class="page-breadcrumb"> | ||
| <li> | ||
| <span>Admin</span> | ||
| <i class="fa fa-circle"></i> | ||
| </li> | ||
| <li> | ||
| <a href="admin/myNewTools.php">My new tools</a> | ||
| <i class="fa fa-circle"></i> | ||
| </li> | ||
| <li> | ||
| <span>Tool specification</span> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| <!-- END PAGE BAR --> | ||
| <!-- BEGIN PAGE TITLE--> | ||
| <h1 class="page-title"> Tool specification | ||
| </h1> | ||
| <!-- END PAGE TITLE--> | ||
| <!-- END PAGE HEADER--> | ||
|
|
||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <?php | ||
| $error_data = false; | ||
| if ($_SESSION['errorData']) { | ||
| $error_data = true; | ||
| ?> | ||
| <?php if ($_SESSION['errorData']['Info']) { ?> | ||
| <div class="alert alert-info"> | ||
| <?php } else { ?> | ||
| <div class="alert alert-danger"> | ||
| <?php } ?> | ||
|
|
||
| <?php | ||
| foreach ($_SESSION['errorData'] as $subTitle => $txts) { | ||
| print "<strong>$subTitle</strong><br/>"; | ||
| foreach ($txts as $txt) { | ||
| print "<div>$txt</div>"; | ||
| } | ||
| } | ||
| unset($_SESSION['errorData']); | ||
| ?> | ||
| </div> | ||
| <?php } ?> | ||
| </div> | ||
| </div> | ||
|
|
||
| <form name="new-tool" id="new-tool" action="applib/updateToolDevSpec.php" method="post"> | ||
|
|
||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <p style="margin-top:0;">Paste or write your JSON code in the text area below. Once the JSON is correct, | ||
| you can validate it against our <a href="https://raw.githubusercontent.com/Multiscale-Genomics/VRE_tool_jsons/dev/tool_specification/tool_schema.json" target="_blank">JSON Schema</a>. Click the buttons below for further information:</p> | ||
| <p> | ||
| <a class="btn btn-xs green" href="http://multiscalegenomics.eu/MuGVRE/tool-specification-attributes/" target="_blank"><i class="fa fa-tag" aria-hidden="true"></i> Attribute's help</a> | ||
| <a class="btn btn-xs green" href="http://multiscalegenomics.eu/MuGVRE/file-types/" target="_blank"><i class="fa fa-list" aria-hidden="true"></i> Available File Types</a> | ||
| <a class="btn btn-xs green" href="http://multiscalegenomics.eu/MuGVRE/data-types/" target="_blank"><i class="fa fa-list" aria-hidden="true"></i> Available Data Type</a> | ||
| <a class="btn btn-xs green" href="javascript:;" target="_blank"><i class="fa fa-list" aria-hidden="true"></i> List of keywords</a> | ||
| </p> | ||
| <!-- BEGIN EXAMPLE TABLE PORTLET--> | ||
| <div class="portlet light portlet-fit bordered"> | ||
| <div class="portlet-body form" id="portlet-json"> | ||
| <input type="hidden" name="toolid" value="<?php echo $_REQUEST['id']; ?>" /> | ||
| <textarea id="code_editor" name="json_tool" placeholder="Please, paste or write your JSON code here..."><?php echo json_encode($toolDevJSON["step3"]["tool_spec"], JSON_PRETTY_PRINT); ?></textarea> | ||
| </div> | ||
| </div> | ||
| <!-- END EXAMPLE TABLE PORTLET--> | ||
| <input type="hidden" id="base-url" value="<?php echo $GLOBALS['BASEURL']; ?>" /> | ||
| <div class="form-actions"> | ||
| <a href="admin/myNewTools.php" class="btn btn-default">BACK</a> | ||
| <input type="submit" class="btn green " id="json-val-subm" value="SUBMIT" style="float:right;"> | ||
| <input type="button" class="btn green snd-metadata-btn" id="json-val-but" value="VALIDATE JSON" style="float:right;margin-right:5px;"> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </form> | ||
| <!-- END CONTENT BODY --> | ||
| </div> | ||
| <!-- END CONTENT --> | ||
|
|
||
| <div class="modal fade bs-modal" id="modalJSONSchema" tabindex="-1" role="basic" aria-hidden="true"> | ||
| <div class="modal-dialog modal-lg"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | ||
| <h4 class="modal-title">JSON Schema Validation</h4> | ||
| </div> | ||
| <div class="modal-body"></div> | ||
| <div class="modal-footer"> | ||
| <button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <!-- END EXAMPLE TABLE PORTLET--> | ||
| <input type="hidden" id="base-url" value="<?php echo $GLOBALS['BASEURL']; ?>" /> | ||
| <div class="form-actions"> | ||
| <a href="admin/myNewTools.php" class="btn btn-default">BACK</a> | ||
| <input type="submit" class="btn green " id="json-val-subm" value="SUBMIT" style="float:right;"> | ||
| <input type="button" class="btn green snd-metadata-btn" id="json-val-but" value="VALIDATE JSON" style="float:right;margin-right:5px;"> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </form> | ||
| <!-- END CONTENT BODY --> | ||
| </div> | ||
| <!-- END CONTENT --> | ||
|
|
||
| <div class="modal fade bs-modal" id="modalJSONSchema" tabindex="-1" role="basic" aria-hidden="true"> | ||
| <div class="modal-dialog modal-lg"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | ||
| <h4 class="modal-title">JSON Schema Validation</h4> | ||
| </div> | ||
| <div class="modal-body"></div> | ||
| <div class="modal-footer"> | ||
| <button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <?php | ||
|
|
||
| require "../htmlib/footer.inc.php"; | ||
| require "../htmlib/js.inc.php"; | ||
|
|
||
| ?> | ||
| <?php | ||
|
|
||
| require "../htmlib/footer.inc.php"; | ||
| require "../htmlib/js.inc.php"; | ||
|
|
||
| ?> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.