Skip to content

Commit

Permalink
Fixes WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dschreij committed Feb 3, 2021
1 parent 5f4348d commit 432dd1b
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 18 deletions.
2 changes: 2 additions & 0 deletions resources/components/Studies/StudiesList/StudiesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ export default {
computed: {
studyOwners () {
return this.studies.reduce((result, study) => {
console.log(study.id, study.users)
result[study.id] = study?.users.find(user => user.pivot.is_owner)
return result
}, {})
}
},
methods: {
userIsOwner (studyID) {
console.log(this.studyOwners)
return this.$auth.user.id === this.studyOwners[studyID].id
}
}
Expand Down
2 changes: 1 addition & 1 deletion resources/components/Studies/page/JobsTable/JobsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default {
},
tableHeight () {
const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0)
return vh - 400
return vh - 450
}
},
methods: {
Expand Down
4 changes: 1 addition & 3 deletions resources/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@
</v-menu>
</v-app-bar>
<v-main>
<v-container fluid class="fill-height py-3">
<nuxt />
</v-container>
<nuxt />
</v-main>
<v-footer :fixed="false" app>
<span>&copy; 2019-2020 le Centre National de la Recherche</span>
Expand Down
2 changes: 1 addition & 1 deletion resources/models/StudyUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class StudyUser extends Model {
return {
study_id: this.attr(null),
user_id: this.attr(null),
is_owner: this.boolean(null),
is_owner: this.boolean(false),
access_permission_id: this.attr(null)
}
}
Expand Down
2 changes: 1 addition & 1 deletion resources/pages/dashboard/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-container class="fill-height py-0">
<v-container class="fill-height">
<v-row class="fill-height">
<v-col cols="12" class="d-flex flex-column fill-height">
<v-row style="max-height: 64px">
Expand Down
2 changes: 1 addition & 1 deletion resources/pages/dashboard/participants.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-container class="fill-height align-start">
<v-container class="fill-height">
<new-participant-dialog
ref="dialog"
v-model="dialog"
Expand Down
4 changes: 2 additions & 2 deletions resources/pages/dashboard/studies.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-row class="limit-height">
<v-row class="limit-height pt-3">
<v-col cols="12" md="4" lg="3">
<studies-tabs />
</v-col>
Expand Down Expand Up @@ -40,7 +40,7 @@ export default {

<style lang="scss">
.limit-height {
height: calc(100% + 24px);
height: calc(100% + 32px);
overflow: auto;
}
</style>
7 changes: 4 additions & 3 deletions resources/pages/dashboard/studies/_id/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,10 @@ export default {
async fetchStudy (studyID, options) {
try {
await this.Study.fetchById(studyID, {
persistOptions: {
create: ['users']
},
/* Below breaks the studies list, if studies are shared */
// persistOptions: {
// create: ['users']
// },
...options
})
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion resources/pages/dashboard/users.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-container class="fill-height align-start">
<v-container class="fill-height">
<new-user-dialog
ref="dialog"
v-model="dialog"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`JobsTable wrapper matches its snapshot 1`] = `
<div class="v-skeleton-loader theme--light">
<transition-stub name="fade-transition">
<div class="v-data-table v-data-table--dense v-data-table--fixed-header v-data-table--has-bottom theme--light">
<div class="v-data-table__wrapper" style="height: 368px;">
<div class="v-data-table__wrapper" style="height: 318px;">
<table>
<colgroup></colgroup>
<thead class="v-data-table-header">
Expand Down
2 changes: 1 addition & 1 deletion resources/test/__snapshots__/pages/dashboard/index.snap.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Dashboard Index matches its snapshot 1`] = `
<div class="container fill-height py-0">
<div class="container fill-height">
<div class="row fill-height">
<div class="d-flex flex-column fill-height col col-12">
<div class="row" style="max-height: 64px;">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Participants matches its snapshot 1`] = `
<div class="container fill-height align-start">
<div class="container fill-height">
<div class="row fill-height">
<div class="d-flex flex-column py-0 col-xl-8 offset-xl-2 col-12">
<div class="row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Studies matches its snapshot 1`] = `
<div class="row limit-height">
<div class="row limit-height pt-3">
<div class="col-md-4 col-lg-3 col-12">
</div>
<div class="col-md-8 col-lg-9 col-12">
Expand Down
2 changes: 1 addition & 1 deletion resources/test/__snapshots__/pages/dashboard/users.snap.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Users matches its snapshot 1`] = `
<div class="container fill-height align-start">
<div class="container fill-height">
<div class="row fill-height">
<div class="d-flex flex-column py-0 col-xl-8 offset-xl-2 col-12">
<div class="row align-self-start">
Expand Down

0 comments on commit 432dd1b

Please sign in to comment.