Skip to content

Commit 140ba4e

Browse files
committed
Fixed schema creation, fixed typos, fixed layout issues
1 parent bd710d7 commit 140ba4e

File tree

15 files changed

+55
-51
lines changed

15 files changed

+55
-51
lines changed

app/base-repo/components/DataResourceEditor/help/MetadataTabHelp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function MetadataTabHelp() {
1313
<AlertDescription>
1414
<span>Here you can edit the resource&apos;s metadata. Below, you&apos;ll find a form with a pre-selection of available metadata.
1515
Mandatory elements are marked with a <span className={"text-error"}>*</span> and must be filled in order to allow to
16-
<Badge variant="thumb_set" className={"text-ring"}>Commit</Badge> changes or initially store a resource. Information for
16+
<Badge variant="thumb_set" className={"text-ring"}>Create/Commit</Badge> changes or initially store a resource. Information for
1717
each element can be shown by hovering over the tooltip icon <a
1818
className="tooltips"></a>. Complex properties are collapsed
1919
and can be expanded by clicking the expand button <Badge variant="outline"><i

app/base-repo/components/DataResourceEditor/tabs/MetadataTab.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ interface MetadataTabProps {
2323
reloadCallback:Function;
2424
}
2525

26-
export function MetadataTab({createMode, resource, etag, schema, userPrefs, updateResourceCallback, reloadCallback}: MetadataTabProps) {
26+
export function MetadataTab({createMode,
27+
resource,
28+
etag,
29+
schema,
30+
userPrefs,
31+
updateResourceCallback,
32+
reloadCallback
33+
}: MetadataTabProps) {
2734
const [editorReady, setEditorReady] = useState(false);
2835
const [confirm, setConfirm] = useState(false);
2936
const {data, status} = useSession();
@@ -44,13 +51,13 @@ export function MetadataTab({createMode, resource, etag, schema, userPrefs, upda
4451
{!createMode ?
4552
<ConfirmCancelComponent confirmLabel={"Commit"}
4653
cancelLabel={"Cancel"}
47-
confirmAction={() => DoUpdateDataResource(resource, etag, reloadCallback, data?.accessToken)}
54+
confirmAction={() => (confirm ? DoUpdateDataResource(resource, etag, reloadCallback, data?.accessToken) : null)}
4855
cancelHref={`/base-repo/resources/${resource.id}`}
4956
confirm={confirm}
5057
/> :
5158
<ConfirmCancelComponent confirmLabel={"Create"}
5259
cancelLabel={"Cancel"}
53-
confirmAction={() => DoCreateDataResource(resource, router, data?.accessToken)}
60+
confirmAction={() => (confirm ? DoCreateDataResource(resource, router, data?.accessToken) : null)}
5461
cancelHref={`/base-repo/resources`}
5562
confirm={confirm}
5663
/>

app/metastore/components/Dashboard/LatestActivities.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export default async function LatestActivities() {
3838
latestActivities.map((activity, i) => {
3939
// @ts-ignore
4040
const Icon = iconMap[activity.type];
41-
// const id = activity.id;
4241
return (
4342
<div
4443
key={activity.id}

app/metastore/components/Dashboard/MetastoreStats.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ export default async function MetastoreStats() {
4141
]
4242

4343
return (
44-
<>
45-
{stats.map((stat, i) => {
44+
<div className="grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3">
45+
{stats.map((stat, i) => {
4646
const Icon = stat.icon;
4747
return (
4848
<InfoCard key={i} icon={stat.icon} value={stat.value} text={stat.text}/>
4949
);
5050
})}
51-
</>
51+
</div>
5252
);
5353
}

app/metastore/components/MetadataEditor/tabs/AccessTab.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import {Acl, DataResource, KeycloakUser, Permission} from "@/lib/definitions";
88
import {UserPrefsType} from "@/lib/hooks/useUserPrefs";
99
import type {Element} from "@/components/KanbanBoard/BoardCard";
1010
import {fetchUsers} from "@/lib/base-repo/client-data";
11+
import {AccessTabHelp} from "@/app/metastore/components/MetadataEditor/help/AccessTabHelp";
1112
import {useSession} from "next-auth/react";
1213
import {
1314
PermissionUpdateCheckDialog
1415
} from "@/app/base-repo/components/DataResourceEditor/dialogs/PermissionUpdateCheckDialog";
15-
import {AccessTabHelp} from "@/app/metastore/components/MetadataEditor/help/AccessTabHelp";
1616
import {DoUpdatePermissions} from "@/app/metastore/components/MetadataEditor/useMetadataEditor";
1717
import {capitalizeFirstLetter} from "@/lib/general/format-utils";
1818

@@ -133,7 +133,7 @@ export function AccessTab({resource, etag, userPrefs, reloadCallback}: AccessTab
133133
setElements(res);
134134
});
135135
setForceReload(false);
136-
}, [userFilter, data?.accessToken, data?.user.preferred_username, status, forceReload, resource.acls]);
136+
}, [userFilter, data?.accessToken, data?.user.preferred_username, resource.acls, status, forceReload]);
137137

138138
function updateUserFilter(val: string) {
139139
if (val && val.length > 2) {

app/metastore/components/MetadataEditor/tabs/MetadataTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function MetadataTab({
4343
onChange={(d: object) => DataChanged(d, setConfirm, updateResourceCallback)}/>
4444
<ConfirmCancelComponent confirmLabel={"Commit"}
4545
cancelLabel={"Cancel"}
46-
confirmAction={() => DoUpdateMetadata(resource, etag, reloadCallback, data?.accessToken)}
46+
confirmAction={() => (confirm ? DoUpdateMetadata(resource, etag, reloadCallback, data?.accessToken) : null)}
4747
cancelHref={`/metastore/metadata/`}
4848
confirm={confirm}
4949
/>

app/metastore/components/SchemaEditor/tabs/MetadataTab.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import JsonForm from "@/components/JsonForm/jsonform";
22
import {DataChanged} from "@/app/base-repo/components/DataResourceEditor/useDataResourceEditor";
3+
import {DoUpdateSchema} from "@/app/metastore/components/SchemaEditor/useSchemaEditor";
34
import ConfirmCancelComponent from "@/components/general/confirm-cancel-component";
45
import {TabsContent} from "@/components/ui/tabs";
56
import React, {useState} from "react";
67
import {DataResource} from "@/lib/definitions";
78
import {UserPrefsType} from "@/lib/hooks/useUserPrefs";
8-
import {DoUpdateSchema} from "@/app/metastore/components/SchemaEditor/useSchemaEditor";
99
import {useSession} from "next-auth/react";
1010
import {MetadataTabHelp} from "@/app/metastore/components/MetadataEditor/help/MetadataTabHelp";
1111

@@ -43,7 +43,7 @@ export function MetadataTab({
4343
onChange={(d: object) => DataChanged(d, setConfirm, updateResourceCallback)}/>
4444
<ConfirmCancelComponent confirmLabel={"Commit"}
4545
cancelLabel={"Cancel"}
46-
confirmAction={() => DoUpdateSchema(resource, etag, reloadCallback, data?.accessToken)}
46+
confirmAction={() => (confirm ? DoUpdateSchema(resource, etag, reloadCallback, data?.accessToken) : null)}
4747
cancelHref={`/metastore/schemas/`}
4848
confirm={confirm}
4949
/>

app/metastore/components/SchemaRecordFileUploader/SchemaRecordFileUploader.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,12 @@ export default function SchemaRecordFileUploader({
8686
* @param {object} data - The resource of undefined in case of validation errors.
8787
*/
8888
function updateData(data: object) {
89-
setMetadata(data as DataResource);
90-
setConfirm(data != undefined);
89+
if (!data) {
90+
setConfirm(false);
91+
} else {
92+
setMetadata(data as DataResource);
93+
setConfirm(true);
94+
}
9195
}
9296

9397
/**
@@ -117,7 +121,7 @@ export default function SchemaRecordFileUploader({
117121

118122
</div>
119123
<div className={"shrink"}>
120-
<Button variant={"contextual"} title={"Add Metadata to Upload"}
124+
<Button variant={confirm ? "success" : "destructive"} title={"Add Metadata to Upload"}
121125
className={"w-full xl:w-4/6 xl:h-full xl:ml-4 xl:mr-4"}
122126
disabled={!confirm} onClick={addMetadataToUppy}>
123127
<Icon className={"w-12 h-12 invisible xl:visible"} icon={"ic:outline-double-arrow"}/>

app/metastore/schemas/create/CreateHelp.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import React from "react";
77
export function CreateHelp() {
88
return (
99
<Alert>
10-
<ShieldCheck className="h-4 w-4"/>
11-
<AlertTitle>Access Permissions</AlertTitle>
10+
<Icon width={"16"} height={"16"} icon={"material-symbols-light:edit-square-outline"}
11+
className="h-4 w-4 mr-2"/>
12+
<AlertTitle>Schema Registration</AlertTitle>
1213
<AlertDescription>
1314
<span>Here you can register new metadata schemas. The creation process comprises two parts:
1415
<br/><br/>
15-
<ul className={"list-disc"}>
16+
<ul className={"list-disc ml-4"}>
1617
<li>Creation of administrative metadata to describe the schema.</li>
1718
<li>Providing the actual metadata schema.</li>
1819
</ul>
@@ -21,16 +22,16 @@ export function CreateHelp() {
2122
a unique identifier and a title has to be provided. Additional metadata can be added later. After entering
2223
identifier and title into the form, metadata has to be added to the list of file uploads. As soon as all mandatory
2324
metadata is provided, the transfer button&nbsp;
24-
<Badge variant="contextual_disabled">
25+
<Badge variant="destructive">
2526
<Icon icon={"ic:outline-double-arrow"}
26-
className="h-4 w-4"
27-
width={"24"}
28-
height={"24"}/></Badge> will change to <Badge
27+
className="h-4 w-4 bg-destructive"
28+
width={"16"}
29+
height={"16"}/></Badge> will change to <Badge
2930
variant="contextual">
3031
<Icon icon={"ic:outline-double-arrow"}
31-
className="h-4 w-4"
32-
width={"24"}
33-
height={"24"}/></Badge> and can be used to transfer the metadata document the the upload element on the right
32+
className="h-4 w-4 text-primary"
33+
width={"16"}
34+
height={"16"}/></Badge> and can be used to transfer the metadata document the the upload element on the right
3435
hand side and will appear as <i>record.json</i>. <br/>
3536
Now, the actual metadata schema must be provided. Therefor, click <span
3637
className={"text-sky-400"}>+ Add more</span> in the upper right corner of the upload element

components/OverviewPage/OverviewPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function OverviewPage({
3636
<section className="flex flex-col overflow-hidden">
3737
<SectionCaption caption="Actions" level="h2" />
3838

39-
<div className="grid gap-14 sm:grid-cols-2 lg:grid-cols-3 px-4 py-4 overflow-auto">
39+
<div className="grid gap-14 sm:grid-cols-2 lg:grid-cols-3 px-14 py-4 overflow-none">
4040
{actions.map(action => (
4141
<ActionCard
4242
key={action.title}
@@ -53,7 +53,7 @@ export function OverviewPage({
5353

5454

5555
{/* Bottom row: stats + activities */}
56-
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 max-h-[50vh]">
56+
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
5757
<section className="flex flex-col overflow-hidden">
5858
<SectionCaption caption="Usage Statistics" level="h2" />
5959
<div className="flex-1 overflow-auto px-4 py-4">

0 commit comments

Comments
 (0)