Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/NFDI4Chem/nmrxiv into prod-…
Browse files Browse the repository at this point in the history
…helm-deploy
  • Loading branch information
NishaSharma14 committed Feb 6, 2024
2 parents 823db90 + 0d9819d commit 063af92
Show file tree
Hide file tree
Showing 14 changed files with 160 additions and 64 deletions.
1 change: 1 addition & 0 deletions .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":{"Tests\\Feature\\ApiTokenPermissionsTest::test_api_token_permissions_can_be_updated":5,"Tests\\Feature\\DeleteAccountTest::test_user_accounts_can_be_deleted":1,"Tests\\Feature\\DeleteAccountTest::test_correct_password_must_be_provided_before_account_can_be_deleted":1,"Tests\\Feature\\RegistrationTest::test_registration_screen_cannot_be_rendered_if_support_is_disabled":1},"times":{"Tests\\Unit\\ExampleTest::test_example":0.039,"Tests\\Feature\\ApiTokenPermissionsTest::test_api_token_permissions_can_be_updated":0.3,"Tests\\Feature\\AuthenticationTest::test_login_screen_can_be_rendered":0.225,"Tests\\Feature\\AuthenticationTest::test_users_can_authenticate_using_the_login_screen":0.182,"Tests\\Feature\\AuthenticationTest::test_users_can_not_authenticate_with_invalid_password":0.097,"Tests\\Feature\\BrowserSessionsTest::test_other_browser_sessions_can_be_logged_out":0.16,"Tests\\Feature\\CreateApiTokenTest::test_api_tokens_can_be_created":0.039,"Tests\\Feature\\CreateTeamTest::test_teams_can_be_created":0.048,"Tests\\Feature\\DeleteAccountTest::test_user_accounts_can_be_deleted":0.006,"Tests\\Feature\\DeleteAccountTest::test_correct_password_must_be_provided_before_account_can_be_deleted":0.001,"Tests\\Feature\\DeleteApiTokenTest::test_api_tokens_can_be_deleted":0.024,"Tests\\Feature\\DeleteTeamTest::test_teams_can_be_deleted":0.143,"Tests\\Feature\\DeleteTeamTest::test_personal_teams_cant_be_deleted":0.256,"Tests\\Feature\\EmailVerificationTest::test_email_verification_screen_can_be_rendered":0.055,"Tests\\Feature\\EmailVerificationTest::test_email_can_be_verified":0.024,"Tests\\Feature\\EmailVerificationTest::test_email_can_not_verified_with_invalid_hash":0.038,"Tests\\Feature\\ExampleTest::test_example":0.055,"Tests\\Feature\\InviteTeamMemberTest::test_team_members_can_be_invited_to_team":0.089,"Tests\\Feature\\InviteTeamMemberTest::test_team_member_invitations_can_be_cancelled":0.032,"Tests\\Feature\\LeaveTeamTest::test_users_can_leave_teams":0.058,"Tests\\Feature\\LeaveTeamTest::test_team_owners_cant_leave_their_own_team":0.035,"Tests\\Feature\\ManageAnnouncementTest::test_announcement_can_be_created":0.157,"Tests\\Feature\\ManageAnnouncementTest::test_announcement_can_be_updated":0.134,"Tests\\Feature\\ManageAnnouncementTest::test_announcement_can_be_deleted":0.136,"Tests\\Feature\\ManageAnnouncementTest::test_announcement_can_be_managed_only_by_admins":0.265,"Tests\\Feature\\ManageAuthorsTest::test_author_can_be_created_and_updated":0.892,"Tests\\Feature\\ManageAuthorsTest::test_author_can_be_detached":0.642,"Tests\\Feature\\ManageAuthorsTest::test_author_cannot_be_updated_or_deleted_by_reviewer":0.655,"Tests\\Feature\\ManageAuthorsTest::test_author_cannot_be_updated_or_detached_if_project_is_public":0.682,"Tests\\Feature\\ManageAuthorsTest::test_role_of_an_author_can_be_updated":0.707,"Tests\\Feature\\ManageCitationsTest::test_citation_can_be_added_and_updated":0.653,"Tests\\Feature\\ManageCitationsTest::test_citation_can_be_detached":0.653,"Tests\\Feature\\ManageCitationsTest::test_citation_cannot_be_updated_or_deleted_by_reviewer":0.638,"Tests\\Feature\\ManageCitationsTest::test_citation_cannot_be_updated_or_detached_if_project_is_public":0.65,"Tests\\Feature\\ManageLicenseTest::test_get_licenses":0.022,"Tests\\Feature\\ManageLicenseTest::test_add_license_to_project":1.249,"Tests\\Feature\\ManageLicenseTest::test_license_cannot_be_added_by_reviewer":0.674,"Tests\\Feature\\PasswordConfirmationTest::test_confirm_password_screen_can_be_rendered":0.044,"Tests\\Feature\\PasswordConfirmationTest::test_password_can_be_confirmed":0.086,"Tests\\Feature\\PasswordConfirmationTest::test_password_is_not_confirmed_with_invalid_password":0.241,"Tests\\Feature\\PasswordResetTest::test_reset_password_link_screen_can_be_rendered":0.028,"Tests\\Feature\\PasswordResetTest::test_reset_password_link_can_be_requested":0.042,"Tests\\Feature\\PasswordResetTest::test_reset_password_screen_can_be_rendered":0.045,"Tests\\Feature\\PasswordResetTest::test_password_can_be_reset_with_valid_token":0.049,"Tests\\Feature\\ProfileInformationTest::test_profile_information_can_be_updated":0.319,"Tests\\Feature\\RegistrationTest::test_registration_screen_can_be_rendered":0.026,"Tests\\Feature\\RegistrationTest::test_registration_screen_cannot_be_rendered_if_support_is_disabled":0.001,"Tests\\Feature\\RegistrationTest::test_new_users_can_register":0.06,"Tests\\Feature\\RemoveTeamMemberTest::test_team_members_can_be_removed_from_teams":0.03,"Tests\\Feature\\RemoveTeamMemberTest::test_only_team_owner_can_remove_team_members":0.054,"Tests\\Feature\\TwoFactorAuthenticationSettingsTest::test_two_factor_authentication_can_be_enabled":0.032,"Tests\\Feature\\TwoFactorAuthenticationSettingsTest::test_recovery_codes_can_be_regenerated":0.039,"Tests\\Feature\\TwoFactorAuthenticationSettingsTest::test_two_factor_authentication_can_be_disabled":0.031,"Tests\\Feature\\UpdatePasswordTest::test_password_can_be_updated":0.093,"Tests\\Feature\\UpdatePasswordTest::test_current_password_must_be_correct":0.16,"Tests\\Feature\\UpdatePasswordTest::test_new_passwords_must_match":0.161,"Tests\\Feature\\UpdateTeamMemberRoleTest::test_team_member_roles_can_be_updated":0.037,"Tests\\Feature\\UpdateTeamMemberRoleTest::test_only_team_owner_can_update_team_member_roles":1.766,"Tests\\Feature\\UpdateTeamNameTest::test_team_names_can_be_updated":0.032}}
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [1.0.2](https://github.com/NFDI4Chem/nmrxiv/compare/v1.0.1...v1.0.2) (2024-02-06)


### Bug Fixes

* added download links to the public files tab ([f788f74](https://github.com/NFDI4Chem/nmrxiv/commit/f788f74c4fdb62d848525fb67ea172db22d2db74))
* remove team member test fix ([485c06d](https://github.com/NFDI4Chem/nmrxiv/commit/485c06d1bbf3d08c5a934e415dd34dc3c0692020))
* resolved [#1073](https://github.com/NFDI4Chem/nmrxiv/issues/1073) ([b081cb8](https://github.com/NFDI4Chem/nmrxiv/commit/b081cb86890d858b34cc09153e00d06d1983a1a2))
* resolves [#1066](https://github.com/NFDI4Chem/nmrxiv/issues/1066) ([f3ab2aa](https://github.com/NFDI4Chem/nmrxiv/commit/f3ab2aa3877cef1f34a2f7d3c3170795c90c5636))
* tests cache ([3c2c143](https://github.com/NFDI4Chem/nmrxiv/commit/3c2c143024d4308ab28a9ec8d0b3706125e8aa05))

## [1.0.1](https://github.com/NFDI4Chem/nmrxiv/compare/v1.0.0...v1.0.1) (2024-01-31)


Expand Down
19 changes: 19 additions & 0 deletions app/Models/FileSystemObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ class FileSystemObject extends Model
'has_children',
];

/**
* The accessors to append to the model's array form.
*
* @var array
*/
protected $appends = ['download_url'];

/**
* Get the download URL to the file system object.
*
* @return string
*/
public function getDownloadUrlAttribute()
{
if ($this->model_type == 'study') {
return $this->study->download_url;
}
}

public function children()
{
return $this->hasMany(FileSystemObject::class, 'parent_id', 'id');
Expand Down
2 changes: 1 addition & 1 deletion app/Policies/TeamPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function updateTeamMember(User $user, Team $team)
*/
public function removeTeamMember(User $user, Team $team)
{
if ($user->hasTeamRole($user->currentTeam->fresh(), 'owner') || $user->ownsTeam($team)) {
if ($user->hasTeamRole($team, 'owner') || $user->ownsTeam($team)) {
return true;
} else {
return false;
Expand Down
2 changes: 1 addition & 1 deletion database/factories/CitationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function definition()
$author = $author1.', '.$author2;

return [
'doi' => "10.102X/acs.jnatprod.1c01SS",
'doi' => '10.102X/acs.jnatprod.1c01SS',
'title' => $this->faker->title(),
'authors' => $author,
'citation_text' => $this->faker->text(),
Expand Down
55 changes: 26 additions & 29 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<env name="DB_CONNECTION" value="pgsql"/>
<env name="DB_DATABASE" value="nmrxiv"/>
<server name="MAIL_MAILER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="TELESCOPE_ENABLED" value="false"/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage/>
<php>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<env name="DB_CONNECTION" value="pgsql"/>
<env name="DB_DATABASE" value="nmrxiv"/>
<server name="MAIL_MAILER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="TELESCOPE_ENABLED" value="false"/>
</php>
<source>
<include>
<directory suffix=".php">./app</directory>
</include>
</source>
</phpunit>
6 changes: 3 additions & 3 deletions resources/js/App/StructureSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</button>
<button
@click="openDialog(true)"
class="flex items-center justify-center px-4 py-3 border border-1 text-base font-medium rounded-md shadow-sm text-white bg-teal-500 sm:px-8"
class="flex items-center justify-center px-4 py-3 border border-1 text-base font-medium rounded-full shadow-sm text-white bg-teal-500 sm:px-8"
v-if="mode == 'button'"
>
<svg
Expand All @@ -40,7 +40,7 @@
stroke-linejoin="round"
d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
/></svg
>&nbsp; Search Database
>&nbsp; Search Structure
</button>
<TransitionRoot
:show="open"
Expand Down Expand Up @@ -84,7 +84,7 @@
<h3
class="text-lg font-medium leading-6 text-gray-900"
>
Structure Search
Search Structure
</h3>
<!-- <p class="mt-1 text-sm text-gray-500">
Lorem ipsum dolor sit amet consectetur adipisicing elit quam corrupti
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Mixins/Global.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export default {
extractQueryParam(query) {
if (query.indexOf("http") > -1) {
var url = new URL(query);
if(query.indexOf("dois") > -1){
if (query.indexOf("dois") > -1) {
query = url.pathname.replace("/dois/", "");
} else {
query = url.pathname.replace("/", "");
Expand Down Expand Up @@ -328,7 +328,7 @@ export default {
extractQueryParam(query) {
if (query.indexOf("http") > -1) {
var url = new URL(query);
if(query.indexOf("dois") > -1){
if (query.indexOf("dois") > -1) {
query = url.pathname.replace("/dois/", "");
} else {
query = url.pathname.replace("/", "");
Expand Down
1 change: 1 addition & 0 deletions resources/js/Pages/Public/Project/Files.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
ref="fsbRef"
:readonly="true"
:height="'h-[calc(100vh-385px)]'"
:project="project.data"
></file-system-browser>
</div>
</div>
Expand Down
8 changes: 5 additions & 3 deletions resources/js/Pages/Public/Project/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@
:key="$index"
class="bg-gray-100 text-gray-800 mb-0.5 inline-flex truncate break-words items-center px-3 py-2 rounded-full text-sm font-medium mr-1"
>
<ontology-term-annotation
:annotation="species"
></ontology-term-annotation>
<i
><ontology-term-annotation
:annotation="species"
></ontology-term-annotation
></i>
</div>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion resources/js/Pages/Study/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@
preview
? route(
'project.preview',
[project.obfuscationcode]
[
project.obfuscationcode,
]
)
: route(
'dashboard.projects',
Expand Down
38 changes: 25 additions & 13 deletions resources/js/Pages/Welcome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,21 +226,37 @@
class="mt-10 max-w-sm mx-auto sm:max-w-none sm:flex sm:justify-center"
>
<div
class="space-y-4 sm:space-y-0 sm:mx-auto sm:inline-grid sm:grid-cols-2 sm:gap-5"
class="space-y-4 sm:space-y-0 sm:mx-auto sm:inline-grid sm:grid-cols-3 sm:gap-5"
>
<Link
href="/register"
class="flex items-center justify-center px-4 py-3 border border-1 text-base font-medium rounded-md shadow-sm text-teal-700 bg-white hover:bg-teal-50 sm:px-8"
href="/projects"
class="flex items-center justify-center px-4 py-3 border border-1 text-base font-medium rounded-full shadow-sm bg-slate-900 text-white hover:bg-slate-700 sm:px-8"
>
Submit data
<ToolTip
text="To submit data you will need an account with nmrXiv, so you will be redirected to our register page and once registered you can then go ahead and submit data. For more information please checkout our <a target='_blank' href='//docs.nmrxiv.org' class='text-gray-400' target='_blank'>documentation</a>."
></ToolTip>
Browse data&nbsp;
<span
aria-hidden="true"
class="hidden text-slate-400 sm:inline"
>→</span
>
</Link>
<StructureSearch
mode="button"
ref="structure-search"
></StructureSearch>
<a
class="group inline-flex ring-1 items-center justify-center rounded-full py-2 px-4 focus:outline-none ring-slate-200 text-slate-700 hover:text-slate-900 hover:ring-slate-300 active:bg-slate-100 active:text-slate-600 focus-visible:outline-blue-600 focus-visible:ring-slate-300"
variant="outline"
color="slate"
href="/register"
><span class="ml-3">Submit data</span>
<ToolTip
text="To submit data you will need an account with nmrXiv, so you will be redirected to our register page and once registered you can then go ahead and submit data. For more information please checkout our <a target='_blank' href='//docs.nmrxiv.org' class='text-gray-400' target='_blank'>documentation</a>."
></ToolTip>
</a>
<Link
class="items-center justify-center px-4 py-3 text-base font-medium rounded-md text-teal-700 sm:px-8"
>
</Link>
</div>
</div>
<div class="flex justify-center">
Expand Down Expand Up @@ -365,9 +381,7 @@
/>
</div>
<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
<div
class="relative pt-12 sm:p-24 xl:col-start-1"
>
<div class="relative pt-12 sm:p-24 xl:col-start-1">
<h2
class="text-sm font-semibold tracking-wide uppercase"
>
Expand Down Expand Up @@ -565,9 +579,7 @@
</div>
</div>
<div class="mt-12 sm:mt-16 lg:mt-0">
<div
class="lg:relative lg:h-full"
>
<div class="lg:relative lg:h-full">
<img
class="w-full lg:absolute lg:left-0 lg:h-full lg:w-auto lg:max-w-none"
src="/img/api.png"
Expand Down
Loading

0 comments on commit 063af92

Please sign in to comment.