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

(FE) Apply URL Spec #98

Merged
merged 37 commits into from
Jan 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4b9dd23
Change login page url
devleejb Jan 24, 2024
567740f
Add new index page
devleejb Jan 24, 2024
d504137
Add login button to main header
devleejb Jan 24, 2024
5fdb840
Change height of main layout
devleejb Jan 24, 2024
b6d274e
Change workspace url spec
devleejb Jan 24, 2024
68f1ee1
Change redirect url after login
devleejb Jan 24, 2024
d59de65
Change url of workspace
devleejb Jan 24, 2024
b8f0856
Change component name from `Editor` to `Document`
devleejb Jan 24, 2024
275e550
Change `injectProtectedRoute` implementation to support protecting ch…
devleejb Jan 24, 2024
09c348c
Change documentSlug to documentId in URL
devleejb Jan 24, 2024
2bc2378
Delete share mode in `DocumentIndex`
devleejb Jan 24, 2024
280bfbc
Change API path for document
devleejb Jan 24, 2024
e9c7b66
Change document page url
devleejb Jan 24, 2024
c1cb700
Change cleanup code for docs
devleejb Jan 24, 2024
1138b53
Remove share mode in share modal
devleejb Jan 24, 2024
7858790
Add document share page
devleejb Jan 24, 2024
0119317
Componentize DocumentView
devleejb Jan 24, 2024
1b2e9d2
Add share mode
devleejb Jan 24, 2024
03c23da
Fix mode button background padding
devleejb Jan 24, 2024
de88e93
Change document page to use `useYorkieDocument`
devleejb Jan 24, 2024
4399da0
Add tooltip to avatar
devleejb Jan 24, 2024
0856e70
Add back button to DocumentHeader
devleejb Jan 24, 2024
98376ab
Remove slug in document db
devleejb Jan 24, 2024
0b9bea3
Fix lint
devleejb Jan 24, 2024
aad2ff7
Add check path to API
devleejb Jan 24, 2024
f6cee41
Fix formatting
devleejb Jan 24, 2024
ce61e09
Add name conflict checking API
devleejb Jan 24, 2024
d9762ea
Fix formatting
devleejb Jan 24, 2024
e7472e5
Remove default nickname
devleejb Jan 24, 2024
fd81ffc
Add API for changing nickname
devleejb Jan 24, 2024
108d260
Change findOptions for user workspaces
devleejb Jan 24, 2024
a14d554
Fix lint
devleejb Jan 24, 2024
2a65fbf
Add Change nickname modal
devleejb Jan 24, 2024
0eabbb5
Add name conflict checking on workspace
devleejb Jan 24, 2024
d208591
Add conflict checking to CreateModal
devleejb Jan 24, 2024
e2c980e
Add queryInvalidation on creating workspace
devleejb Jan 24, 2024
a6d9ed8
Move to the note page when created
devleejb Jan 24, 2024
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
Prev Previous commit
Next Next commit
Remove slug in document db
devleejb committed Jan 24, 2024
commit 98376abdf6e8c3534bad80aae2e91168faf9b936
1 change: 0 additions & 1 deletion backend/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -52,7 +52,6 @@ model Document {
id String @id @default(auto()) @map("_id") @db.ObjectId
yorkieDocumentId String @map("yorkie_document_id")
title String
slug String
content String?
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
2 changes: 0 additions & 2 deletions backend/src/documents/types/document-domain.type.ts
Original file line number Diff line number Diff line change
@@ -7,8 +7,6 @@ export class DocumentDomain {
yorkieDocumentId: string;
@ApiProperty({ type: String, description: "Title of the document" })
title: string;
@ApiProperty({ type: String, description: "Slug of the document" })
slug: string;
@ApiProperty({ type: String, description: "Content of the document", required: false })
content?: string;
@ApiProperty({ type: Date, description: "Created date of the document" })
2 changes: 1 addition & 1 deletion backend/src/users/users.service.ts
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ export class UsersService {
});

const title = `${user.nickname}'s Workspace`;
let slug = slugify(title);
let slug = slugify(title, { lower: true });

const duplicatedWorkspaceList = await this.prismaService.workspace.findMany({
where: {
15 changes: 0 additions & 15 deletions backend/src/workspace-documents/workspace-documents.service.ts
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
import { FindWorkspaceDocumentsResponse } from "./types/find-workspace-documents-response.type";
import { CreateWorkspaceDocumentShareTokenResponse } from "./types/create-workspace-document-share-token-response.type";
import { ShareRole } from "src/utils/types/share-role.type";
import slugify from "slugify";

Check failure on line 7 in backend/src/workspace-documents/workspace-documents.service.ts

GitHub Actions / Check the source code (18.x)

'slugify' is defined but never used
import { generateRandomKey } from "src/utils/functions/random-string";

@Injectable()
@@ -23,24 +23,9 @@
throw new NotFoundException();
}

let slug = slugify(title);

const duplicatedDocumentList = await this.prismaService.document.findMany({
where: {
slug: {
startsWith: slug,
},
},
});

if (duplicatedDocumentList.length) {
slug += `-${duplicatedDocumentList.length + 1}`;
}

return this.prismaService.document.create({
data: {
title,
slug,
workspaceId,
yorkieDocumentId: Math.random().toString(36).substring(7),
},
1 change: 0 additions & 1 deletion frontend/src/hooks/api/types/document.d.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ export class Document {
workspaceId: string;
yorkieDocumentId: string;
title: string;
slug: string;
content?: string;
createdAt: Date;
updatedAt: Date;

Unchanged files with check annotations Beta

import { Controller, Get, Param, Query, Req } from "@nestjs/common";

Check failure on line 1 in backend/src/documents/documents.controller.ts

GitHub Actions / Check the source code (18.x)

'Param' is defined but never used

Check failure on line 1 in backend/src/documents/documents.controller.ts

GitHub Actions / Check the source code (18.x)

'Req' is defined but never used
import { DocumentsService } from "./documents.service";
import { Public } from "src/utils/decorators/auth.decorator";
import {
ApiFoundResponse,

Check failure on line 5 in backend/src/documents/documents.controller.ts

GitHub Actions / Check the source code (18.x)

'ApiFoundResponse' is defined but never used
ApiNotFoundResponse,
ApiOkResponse,
ApiOperation,