diff --git a/database/seeders/collection_seeder.ts b/database/seeders/collection_seeder.ts
index 8204cb5..6398fd2 100644
--- a/database/seeders/collection_seeder.ts
+++ b/database/seeders/collection_seeder.ts
@@ -2,6 +2,7 @@ import Collection from '#models/collection';
import User from '#models/user';
import { BaseSeeder } from '@adonisjs/lucid/seeders';
import { faker } from '@faker-js/faker';
+import { Visibility } from '../../app/enums/visibility.js';
export default class extends BaseSeeder {
static environment = ['development', 'testing'];
@@ -10,9 +11,12 @@ export default class extends BaseSeeder {
// eslint-disable-next-line unicorn/no-await-expression-member
const users = await getUserIds();
- const collections = faker.helpers.multiple(() => createRandomCollection(users), {
- count: 50,
- });
+ const collections = faker.helpers.multiple(
+ () => createRandomCollection(users),
+ {
+ count: 50,
+ }
+ );
await Collection.createMany(collections);
}
}
@@ -28,7 +32,8 @@ function createRandomCollection(userIds: User['id'][]) {
id: faker.string.uuid(),
name: faker.string.alphanumeric({ length: { min: 5, max: 25 } }),
description: faker.string.alphanumeric({ length: { min: 0, max: 254 } }),
- nextId: faker.string.uuid(),
+ visibility: Visibility.PRIVATE,
+ nextId: undefined,
authorId,
};
}
diff --git a/inertia/components/common/text_ellipsis.tsx b/inertia/components/common/text_ellipsis.tsx
index 6bae510..c3cea08 100644
--- a/inertia/components/common/text_ellipsis.tsx
+++ b/inertia/components/common/text_ellipsis.tsx
@@ -1,9 +1,20 @@
import styled from '@emotion/styled';
-const TextEllipsis = styled.p({
- textOverflow: 'ellipsis',
- whiteSpace: 'nowrap',
- overflow: 'hidden',
+const TextEllipsis = styled.p<{ lines?: number }>(({ lines = 1 }) => {
+ if (lines > 1) {
+ return {
+ overflow: 'hidden',
+ display: '-webkit-box',
+ WebkitLineClamp: lines,
+ WebkitBoxOrient: 'vertical',
+ };
+ }
+
+ return {
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap',
+ overflow: 'hidden',
+ };
});
export default TextEllipsis;
diff --git a/inertia/components/dashboard/collection/header/collection_description.tsx b/inertia/components/dashboard/collection/header/collection_description.tsx
index 68286a8..d2bdf7b 100644
--- a/inertia/components/dashboard/collection/header/collection_description.tsx
+++ b/inertia/components/dashboard/collection/header/collection_description.tsx
@@ -1,7 +1,9 @@
import styled from '@emotion/styled';
+import TextEllipsis from '~/components/common/text_ellipsis';
import useActiveCollection from '~/hooks/use_active_collection';
-const CollectionDescriptionStyle = styled.p({
+const CollectionDescriptionStyle = styled.div({
+ width: '100%',
fontSize: '0.85rem',
marginBottom: '0.5rem',
});
@@ -11,7 +13,7 @@ export default function CollectionDescription() {
return (
activeCollection && (