Skip to content
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

remove all genome_browser code #119

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:

- You are about to drop the column `browser_enabled` on the `project` table. All the data in the column will be lost.

*/
-- AlterTable
ALTER TABLE "project" DROP COLUMN "browser_enabled";
1 change: 0 additions & 1 deletion api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ model project {
slug String @unique
name String
description String?
browser_enabled Boolean @default(false)
funding String?
metadata Json?
created_at DateTime @default(now()) @db.Timestamp(6)
Expand Down
6 changes: 0 additions & 6 deletions api/prisma/seed_data/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ const _datasets = [
archive_path: 'archive/2023/PCM230203.tar',
workflows: ['6ca07614-bc84-4e5d-8808-71d0ebaef98b'],
metadata: {
num_genome_files: 60,
report_id: 'a577cb75-bb5c-4b1b-94ed-c4bd96de1188',
stage_alias: 'ea497ac769f2236b6cd9ae70f288a008',
},
Expand All @@ -97,7 +96,6 @@ const _datasets = [
archive_path: 'archive/2023/PCM230327PL.tar',
workflows: ['874a4b40-0534-44e3-b4ff-ae029cca5109'],
metadata: {
num_genome_files: 12,
report_id: '9b0b3fba-ccfd-4918-a5ff-ac93fa1a19ae',
},
},
Expand All @@ -114,7 +112,6 @@ const _datasets = [
archive_path: 'archive/2023/PCM230215_657496842_Aborted_WF.tar',
workflows: ['8afb902b-2ed3-47cd-9390-a262672d2d64'],
metadata: {
num_genome_files: 0,
report_id: null,
},
is_deleted: true,
Expand All @@ -133,7 +130,6 @@ const _datasets = [
archive_path: 'archive/2023/PCM230306PL.tar',
workflows: ['970e13dd-1905-493e-aa3a-13645bd439d9'],
metadata: {
num_genome_files: 68,
report_id: 'fa7d41f5-3813-43f6-9a72-5440ed6eac2b',
},
},
Expand All @@ -150,7 +146,6 @@ const _datasets = [
origin_path: '/N/project/DG_Multiple_Myeloma/share/bcl_fastq',
archive_path: 'archive/2023/bcl_fastq.tar',
metadata: {
num_genome_files: 636,
},
workflows: ['63339ae0-9643-4d8b-aa3a-303434f6bdcd'],
},
Expand All @@ -166,7 +161,6 @@ const _datasets = [
origin_path: '/N/project/DG_Multiple_Myeloma/share/PCM221205',
archive_path: 'archive/2023/PCM221205.tar',
metadata: {
num_genome_files: 93,
},
workflows: ['02fc5cba-d4b8-4e74-8e0c-4e187c8e7f68'],
},
Expand Down
18 changes: 2 additions & 16 deletions api/src/routes/datasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,7 @@ router.get(
if (req.query.type) {
result = await prisma.$queryRaw`
select count(*) as "count",
sum(du_size) as total_size,
SUM(
CASE
WHEN metadata -> 'num_genome_files' IS NOT NULL
THEN (metadata ->> 'num_genome_files')::int
ELSE 0
END
) AS total_num_genome_files
sum(du_size) as total_size
from dataset
where is_deleted = false and type = ${req.query.type};
`;
Expand All @@ -63,14 +56,7 @@ router.get(
result = await prisma.$queryRaw`
select
count(*) as "count",
sum(du_size) as total_size,
SUM(
CASE
WHEN metadata -> 'num_genome_files' IS NOT NULL
THEN (metadata ->> 'num_genome_files')::int
ELSE 0
END
) AS total_num_genome_files
sum(du_size) as total_size
from dataset
where is_deleted = false;
`;
Expand Down
6 changes: 2 additions & 4 deletions api/src/routes/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ router.post(
isPermittedTo('create'),
validate([
body('name').isLength({ min: 5 }),
body('browser_enabled').optional().toBoolean(),
]),
asyncHandler(async (req, res, next) => {
// #swagger.tags = ['Projects']
Expand All @@ -217,7 +216,7 @@ router.post(
*/
const { user_ids, dataset_ids, ...projectData } = req.body;
const data = _.flow([
_.pick(['name', 'description', 'browser_enabled', 'funding', 'metadata']),
_.pick(['name', 'description', 'funding', 'metadata']),
_.omitBy(_.isNil),
])(projectData);
data.slug = await projectService.generate_slug({ name: data.name });
Expand Down Expand Up @@ -462,7 +461,6 @@ router.patch(
isPermittedTo('update'),
validate([
body('name').optional().isLength({ min: 5 }),
body('browser_enabled').optional().toBoolean(),
]),
asyncHandler(async (req, res, next) => {
// #swagger.tags = ['Projects']
Expand All @@ -471,7 +469,7 @@ router.patch(
*/

const data = _.flow([
_.pick(['name', 'description', 'browser_enabled', 'funding', 'metadata']),
_.pick(['name', 'description', 'funding', 'metadata']),
_.omitBy(_.isNil),
])(req.body);

Expand Down
2 changes: 1 addition & 1 deletion ui/docs/util_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Show data if it is neither null or undefined, else show default (provided it is

```html
<template>
<Maybe :data="rowData?.metadata?.num_genome_files" />
<Maybe :data="rowData?.metadata?.num_files" />
</template
```

Expand Down
22 changes: 1 addition & 21 deletions ui/src/components/dashboard/Stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
<span class="text-xl"> {{ props.title }} </span>
</va-card-title>
<va-card-content>
<div
class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-2 gap-3 gap-y-5"
>
<div class="grid grid-cols-3 gap-3 gap-y-5">
<div class="flex flex-col items-center justify-end">
<h2
v-if="props.data?.count != undefined"
Expand Down Expand Up @@ -44,24 +42,6 @@
<p class="va-text-center no-wrap">Total Size</p>
</div>

<div class="flex flex-col items-center justify-end">
<h2
v-if="props.data?.total_num_genome_files != undefined"
class="va-h3 ma-0 va-text-center"
:style="{ color: colors.success }"
>
{{ number_formatter.format(props.data.total_num_genome_files) }}
</h2>
<VaSkeleton
v-else
variant="rounded"
inline
width="64px"
height="32px"
/>
<p class="va-text-center">Data Files</p>
</div>

<div class="flex flex-col items-center justify-end">
<h2
v-if="props.data?.workflows != undefined"
Expand Down
12 changes: 1 addition & 11 deletions ui/src/components/dataset/AssocDatasetList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
</router-link>
</template>

<template #cell(num_genome_files)="{ rowData }">
<Maybe :data="rowData?.metadata?.num_genome_files" />
</template>

<template #cell(du_size)="{ source }">
<span>{{ source != null ? formatBytes(source) : "" }}</span>
</template>
Expand All @@ -21,9 +17,9 @@
</template>

<script setup>
import { formatBytes } from "@/services/utils";
import DatasetService from "@/services/dataset";
import * as datetime from "@/services/datetime";
import { formatBytes } from "@/services/utils";
import { useToastStore } from "@/stores/toast";
const toast = useToastStore();

Expand All @@ -46,12 +42,6 @@ const columns = ref([
sortable: true,
sortingOptions: ["desc", "asc", null],
},
{
key: "num_genome_files",
label: "data files",
sortable: true,
sortingOptions: ["desc", "asc", null],
},
{
key: "du_size",
label: "size",
Expand Down
8 changes: 2 additions & 6 deletions ui/src/components/dataset/Dataset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@
<i-mdi-harddisk class="text-xl" />
<span> {{ formatBytes(dataset.du_size) }} </span>
</div>
<div class="flex items-center gap-1">
<i-mdi-file-multiple class="text-xl" />
<span> {{ dataset.metadata?.num_genome_files }} </span>
</div>
</div>
</div>

Expand Down Expand Up @@ -300,10 +296,10 @@
</template>

<script setup>
import DatasetService from "@/services/dataset";
import workflowService from "@/services/workflow";
import config from "@/config";
import DatasetService from "@/services/dataset";
import { formatBytes } from "@/services/utils";
import workflowService from "@/services/workflow";
import { useToastStore } from "@/stores/toast";
const toast = useToastStore();
const router = useRouter();
Expand Down
7 changes: 2 additions & 5 deletions ui/src/components/dataset/DatasetInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@
<td>Files</td>
<td>{{ props.dataset.num_files }}</td>
</tr>
<tr>
<td>Genome Files</td>
<td>{{ props.dataset.metadata?.num_genome_files }}</td>
</tr>

<tr>
<td>Directories</td>
<td>{{ props.dataset.num_directories }}</td>
Expand All @@ -65,8 +62,8 @@
</template>

<script setup>
import { formatBytes } from "@/services/utils";
import * as datetime from "@/services/datetime";
import { formatBytes } from "@/services/utils";

const props = defineProps({ dataset: Object });

Expand Down
13 changes: 2 additions & 11 deletions ui/src/components/dataset/DatasetList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@
</span>
</template>

<template #cell(num_genome_files)="{ rowData }">
<Maybe :data="rowData?.metadata?.num_genome_files" />
</template>

<template #cell(updated_at)="{ value }">
<span>{{ datetime.fromNow(value) }}</span>
</template>
Expand Down Expand Up @@ -202,10 +198,10 @@
</template>

<script setup>
import useSearchKeyShortcut from "@/composables/useSearchKeyShortcut";
import DatasetService from "@/services/dataset";
import { formatBytes } from "@/services/utils";
import * as datetime from "@/services/datetime";
import useSearchKeyShortcut from "@/composables/useSearchKeyShortcut";
import { formatBytes } from "@/services/utils";
import { useToastStore } from "@/stores/toast";
import _ from "lodash";

Expand Down Expand Up @@ -289,11 +285,6 @@ const columns = [
width: "150px",
},
// { key: "status", sortable: false },
{
key: "num_genome_files",
label: "data files",
width: "80px",
},
{
key: "du_size",
label: "size",
Expand Down
11 changes: 1 addition & 10 deletions ui/src/components/project/CreateProjectStepper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,6 @@
<td>Funding</td>
<td>{{ projectFormStore.project_info.funding }}</td>
</tr>

<tr>
<td>Genome Browser</td>
<td>
<BinaryStatusChip
:status="projectFormStore.project_info.browser_enabled"
/>
</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -120,8 +111,8 @@
</template>

<script setup>
import { useProjectFormStore } from "@/stores/projects/projectForm";
import projectService from "@/services/projects";
import { useProjectFormStore } from "@/stores/projects/projectForm";

const emit = defineEmits(["update"]);

Expand Down
19 changes: 4 additions & 15 deletions ui/src/components/project/datasets/ProjectDatasetsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@
</div>
</template> -->

<template #cell(metadata)="{ rowData }">
<maybe :data="rowData?.metadata?.num_genome_files" />
</template>

<template #cell(du_size)="{ source }">
<span>{{ source != null ? formatBytes(source) : "" }}</span>
</template>
Expand All @@ -107,14 +103,14 @@
</template>

<script setup>
import config from "@/config";
import DatasetService from "@/services/dataset";
import * as datetime from "@/services/datetime";
import { formatBytes, cmp } from "@/services/utils";
import { formatBytes } from "@/services/utils";
import wfService from "@/services/workflow";
import DatasetService from "@/services/dataset";
import config from "@/config";
import { useAuthStore } from "@/stores/auth";
import { HalfCircleSpinner } from "epic-spinners";
import { useColors } from "vuestic-ui";
import { useAuthStore } from "@/stores/auth";

const { colors } = useColors();
const auth = useAuthStore();
Expand Down Expand Up @@ -208,13 +204,6 @@ const columns = [
label: "last updated",
sortable: true,
},
{
key: "metadata",
label: "data files",
sortable: true,

sortingFn: (a, b) => cmp(a?.num_genome_files, b?.num_genome_files),
},
{
key: "du_size",
label: "size",
Expand Down
6 changes: 0 additions & 6 deletions ui/src/components/project/info/ProjectInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
</span>
</td>
</tr>
<tr>
<td>Genome Browser</td>
<td>
<BinaryStatusChip :status="props.project.browser_enabled" />
</td>
</tr>
<tr>
<td>Description</td>
<td>
Expand Down
Loading