Skip to content

Commit

Permalink
#780 Tags use name in subject
Browse files Browse the repository at this point in the history
  • Loading branch information
Polleps authored and joepio committed Jan 17, 2024
1 parent 2e1957b commit 74999e6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions browser/data-browser/src/components/Tag/CreateTagRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Resource, core, dataBrowser, useStore } from '@tomic/react';
import { useState, useCallback, Suspense, lazy } from 'react';
import { FaPlus } from 'react-icons/fa';
import { randomItem } from '../../helpers/randomItem';
import { randomString } from '../../helpers/randomString';
import { stringToSlug } from '../../helpers/stringToSlug';
import { Button } from '../Button';
import { Row } from '../Row';
Expand All @@ -23,8 +22,12 @@ export function CreateTagRow({ parent, onNewTag }: CreateTagRowProps) {
const [resetKey, setResetKey] = useState<number>(0);

const createNewTag = useCallback(async () => {
const subject = await store.buildUniqueSubjectFromParts(
['tag', tagName],
parent,
);
const tag = await store.newResource({
subject: `${parent}/${randomString()}`,
subject,
parent,
isA: dataBrowser.classes.tag,
propVals: {
Expand Down

0 comments on commit 74999e6

Please sign in to comment.