From b0d2cdc4a04a8a192fd150216e33b3b53b9544b3 Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Thu, 13 Apr 2023 11:17:17 +0800 Subject: [PATCH 01/18] add question operation --- docs/docs.go | 54 ++++++++++++++++++ docs/swagger.json | 54 ++++++++++++++++++ docs/swagger.yaml | 34 +++++++++++ internal/controller/question_controller.go | 39 +++++++++++++ internal/migrations/migrations.go | 1 + internal/migrations/v8.go | 56 +++++++++++++++++++ internal/router/answer_api_router.go | 1 + internal/schema/question_schema.go | 18 +++++- .../service/permission/permission_name.go | 2 + 9 files changed, 256 insertions(+), 3 deletions(-) create mode 100644 internal/migrations/v8.go diff --git a/docs/docs.go b/docs/docs.go index 4622228b..73ff9ecd 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -3168,6 +3168,45 @@ const docTemplate = `{ } } }, + "/answer/api/v1/question/operation": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Operation question \\n operation [pin unpin hide show]", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Question" + ], + "summary": "Operation question", + "parameters": [ + { + "description": "question", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.OperationQuestionReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/handler.RespBody" + } + } + } + } + }, "/answer/api/v1/question/page": { "get": { "description": "get questions by page", @@ -6739,6 +6778,21 @@ const docTemplate = `{ } } }, + "schema.OperationQuestionReq": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + }, + "operation": { + "description": "operation [pin unpin hide show]", + "type": "string" + } + } + }, "schema.PermissionMemberAction": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 240e543f..75078211 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -3156,6 +3156,45 @@ } } }, + "/answer/api/v1/question/operation": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Operation question \\n operation [pin unpin hide show]", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Question" + ], + "summary": "Operation question", + "parameters": [ + { + "description": "question", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.OperationQuestionReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/handler.RespBody" + } + } + } + } + }, "/answer/api/v1/question/page": { "get": { "description": "get questions by page", @@ -6727,6 +6766,21 @@ } } }, + "schema.OperationQuestionReq": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + }, + "operation": { + "description": "operation [pin unpin hide show]", + "type": "string" + } + } + }, "schema.PermissionMemberAction": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 7aa79508..200abf16 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -983,6 +983,16 @@ definitions: description: inbox achievement type: string type: object + schema.OperationQuestionReq: + properties: + id: + type: string + operation: + description: operation [pin unpin hide show] + type: string + required: + - id + type: object schema.PermissionMemberAction: properties: action: @@ -3888,6 +3898,30 @@ paths: summary: get question details tags: - Question + /answer/api/v1/question/operation: + put: + consumes: + - application/json + description: Operation question \n operation [pin unpin hide show] + parameters: + - description: question + in: body + name: data + required: true + schema: + $ref: '#/definitions/schema.OperationQuestionReq' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/handler.RespBody' + security: + - ApiKeyAuth: [] + summary: Operation question + tags: + - Question /answer/api/v1/question/page: get: consumes: diff --git a/internal/controller/question_controller.go b/internal/controller/question_controller.go index cefa075a..5ab5f613 100644 --- a/internal/controller/question_controller.go +++ b/internal/controller/question_controller.go @@ -70,6 +70,45 @@ func (qc *QuestionController) RemoveQuestion(ctx *gin.Context) { handler.HandleResponse(ctx, err, nil) } +// OperationQuestion Operation question +// @Summary Operation question +// @Description Operation question \n operation [pin unpin hide show] +// @Tags Question +// @Accept json +// @Produce json +// @Security ApiKeyAuth +// @Param data body schema.OperationQuestionReq true "question" +// @Success 200 {object} handler.RespBody +// @Router /answer/api/v1/question/operation [put] +func (qc *QuestionController) OperationQuestion(ctx *gin.Context) { + req := &schema.OperationQuestionReq{} + if handler.BindAndCheck(ctx, req) { + return + } + req.ID = uid.DeShortID(req.ID) + req.UserID = middleware.GetLoginUserIDFromContext(ctx) + canList, err := qc.rankService.CheckOperationPermissions(ctx, req.UserID, []string{ + permission.QuestionPin, + permission.QuestionHide, + }) + if err != nil { + handler.HandleResponse(ctx, err, nil) + return + } + req.CanPin = canList[0] + req.CanList = canList[1] + if (req.Operation == schema.QuestionOperationPin || req.Operation == schema.QuestionOperationUnPin) && !req.CanPin { + handler.HandleResponse(ctx, errors.Forbidden(reason.RankFailToMeetTheCondition), nil) + return + } + if (req.Operation == schema.QuestionOperationHide || req.Operation == schema.QuestionOperationShow) && !req.CanList { + handler.HandleResponse(ctx, errors.Forbidden(reason.RankFailToMeetTheCondition), nil) + return + } + + handler.HandleResponse(ctx, nil, nil) +} + // CloseQuestion Close question // @Summary Close question // @Description Close question diff --git a/internal/migrations/migrations.go b/internal/migrations/migrations.go index 7b53293e..00ae9bc0 100644 --- a/internal/migrations/migrations.go +++ b/internal/migrations/migrations.go @@ -56,6 +56,7 @@ var migrations = []Migration{ NewMigration("add user role", addRoleFeatures, false), NewMigration("add theme and private mode", addThemeAndPrivateMode, true), NewMigration("add new answer notification", addNewAnswerNotification, true), + NewMigration("add user pin hide features", addRolePinAndHideFeatures, true), } // GetCurrentDBVersion returns the current db version diff --git a/internal/migrations/v8.go b/internal/migrations/v8.go new file mode 100644 index 00000000..325738d0 --- /dev/null +++ b/internal/migrations/v8.go @@ -0,0 +1,56 @@ +package migrations + +import ( + "github.com/answerdev/answer/internal/entity" + "github.com/answerdev/answer/internal/service/permission" + "xorm.io/xorm" +) + +func addRolePinAndHideFeatures(x *xorm.Engine) error { + + powers := []*entity.Power{ + {ID: 34, Name: "question pin", PowerType: permission.QuestionPin, Description: "Top or untop the question"}, + {ID: 35, Name: "question hide", PowerType: permission.QuestionHide, Description: "hide or show the question"}, + } + // insert default powers + for _, power := range powers { + exist, err := x.Get(&entity.Power{ID: power.ID}) + if err != nil { + return err + } + if exist { + _, err = x.ID(power.ID).Update(power) + } else { + _, err = x.Insert(power) + } + if err != nil { + return err + } + } + + rolePowerRels := []*entity.RolePowerRel{ + + {RoleID: 2, PowerType: permission.QuestionPin}, + {RoleID: 2, PowerType: permission.QuestionHide}, + + {RoleID: 3, PowerType: permission.QuestionPin}, + {RoleID: 3, PowerType: permission.QuestionHide}, + } + + // insert default powers + for _, rel := range rolePowerRels { + exist, err := x.Get(&entity.RolePowerRel{RoleID: rel.RoleID, PowerType: rel.PowerType}) + if err != nil { + return err + } + if exist { + continue + } + _, err = x.Insert(rel) + if err != nil { + return err + } + } + + return nil +} diff --git a/internal/router/answer_api_router.go b/internal/router/answer_api_router.go index 3ff5f873..3f79d2f2 100644 --- a/internal/router/answer_api_router.go +++ b/internal/router/answer_api_router.go @@ -190,6 +190,7 @@ func (a *AnswerAPIRouter) RegisterAnswerAPIRouter(r *gin.RouterGroup) { r.PUT("/question", a.questionController.UpdateQuestion) r.DELETE("/question", a.questionController.RemoveQuestion) r.PUT("/question/status", a.questionController.CloseQuestion) + r.PUT("/question/operation", a.questionController.OperationQuestion) r.PUT("/question/reopen", a.questionController.ReopenQuestion) r.GET("/question/similar", a.questionController.SearchByTitleLike) diff --git a/internal/schema/question_schema.go b/internal/schema/question_schema.go index 19a2c3fd..d9bbf76f 100644 --- a/internal/schema/question_schema.go +++ b/internal/schema/question_schema.go @@ -8,9 +8,13 @@ import ( ) const ( - SitemapMaxSize = 50000 - SitemapCachekey = "answer@sitemap" - SitemapPageCachekey = "answer@sitemap@page%d" + SitemapMaxSize = 50000 + SitemapCachekey = "answer@sitemap" + SitemapPageCachekey = "answer@sitemap@page%d" + QuestionOperationPin = "pin" + QuestionOperationUnPin = "unpin" + QuestionOperationHide = "hide" + QuestionOperationShow = "show" ) // RemoveQuestionReq delete question request @@ -28,6 +32,14 @@ type CloseQuestionReq struct { UserID string `json:"-"` // user_id } +type OperationQuestionReq struct { + ID string `validate:"required" json:"id"` + Operation string `json:"operation"` // operation [pin unpin hide show] + UserID string `json:"-"` // user_id + CanPin bool `json:"-"` + CanList bool `json:"-"` +} + type CloseQuestionMeta struct { CloseType int `json:"close_type"` CloseMsg string `json:"close_msg"` diff --git a/internal/service/permission/permission_name.go b/internal/service/permission/permission_name.go index 4a62ec86..29509f84 100644 --- a/internal/service/permission/permission_name.go +++ b/internal/service/permission/permission_name.go @@ -10,6 +10,8 @@ const ( QuestionReopen = "question.reopen" QuestionVoteUp = "question.vote_up" QuestionVoteDown = "question.vote_down" + QuestionPin = "question.pin" //Top or untop the question + QuestionHide = "question.hide" //hide or show the question AnswerAdd = "answer.add" AnswerEdit = "answer.edit" AnswerEditWithoutReview = "answer.edit_without_review" From 990e7497431a0dfc03033550087db935f569e7a8 Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Thu, 13 Apr 2023 14:39:27 +0800 Subject: [PATCH 02/18] add question actions --- internal/controller/question_controller.go | 4 ++++ internal/schema/question_schema.go | 4 ++++ internal/service/permission/permission_name.go | 2 ++ .../service/permission/question_permission.go | 16 +++++++++++++++- internal/service/question_service.go | 2 +- 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/internal/controller/question_controller.go b/internal/controller/question_controller.go index 5ab5f613..97052183 100644 --- a/internal/controller/question_controller.go +++ b/internal/controller/question_controller.go @@ -191,6 +191,8 @@ func (qc *QuestionController) GetQuestion(ctx *gin.Context) { permission.QuestionDelete, permission.QuestionClose, permission.QuestionReopen, + permission.QuestionPin, + permission.QuestionHide, }) if err != nil { handler.HandleResponse(ctx, err, nil) @@ -202,6 +204,8 @@ func (qc *QuestionController) GetQuestion(ctx *gin.Context) { req.CanDelete = canList[1] req.CanClose = canList[2] req.CanReopen = canList[3] + req.CanPin = canList[4] + req.CanHide = canList[5] info, err := qc.questionService.GetQuestionAndAddPV(ctx, id, userID, req) if err != nil { diff --git a/internal/schema/question_schema.go b/internal/schema/question_schema.go index d9bbf76f..a051ab83 100644 --- a/internal/schema/question_schema.go +++ b/internal/schema/question_schema.go @@ -113,6 +113,10 @@ type QuestionPermission struct { CanClose bool `json:"-"` // whether user can reopen it CanReopen bool `json:"-"` + // whether user can pin it + CanPin bool `json:"-"` + // whether user can hide it + CanHide bool `json:"-"` // whether user can use reserved it CanUseReservedTag bool `json:"-"` } diff --git a/internal/service/permission/permission_name.go b/internal/service/permission/permission_name.go index 29509f84..783e3b49 100644 --- a/internal/service/permission/permission_name.go +++ b/internal/service/permission/permission_name.go @@ -45,4 +45,6 @@ const ( deleteActionName = "action.delete" closeActionName = "action.close" reopenActionName = "action.reopen" + pinActionName = "action.pin" + hideActionName = "action.hide" ) diff --git a/internal/service/permission/question_permission.go b/internal/service/permission/question_permission.go index 1321af45..a295f7ff 100644 --- a/internal/service/permission/question_permission.go +++ b/internal/service/permission/question_permission.go @@ -10,7 +10,7 @@ import ( // GetQuestionPermission get question permission func GetQuestionPermission(ctx context.Context, userID string, creatorUserID string, - canEdit, canDelete, canClose, canReopen bool) ( + canEdit, canDelete, canClose, canReopen, canPin, canHide bool) ( actions []*schema.PermissionMemberAction) { lang := handler.GetLangByCtx(ctx) actions = make([]*schema.PermissionMemberAction, 0) @@ -42,6 +42,20 @@ func GetQuestionPermission(ctx context.Context, userID string, creatorUserID str Type: "confirm", }) } + if canPin { + actions = append(actions, &schema.PermissionMemberAction{ + Action: "pin", + Name: translator.Tr(lang, pinActionName), + Type: "confirm", + }) + } + if canHide { + actions = append(actions, &schema.PermissionMemberAction{ + Action: "hide", + Name: translator.Tr(lang, hideActionName), + Type: "confirm", + }) + } if canDelete || userID == creatorUserID { actions = append(actions, &schema.PermissionMemberAction{ Action: "delete", diff --git a/internal/service/question_service.go b/internal/service/question_service.go index 5c4b2f3f..f3f8d546 100644 --- a/internal/service/question_service.go +++ b/internal/service/question_service.go @@ -641,7 +641,7 @@ func (qs *QuestionService) GetQuestion(ctx context.Context, questionID, userID s question.Description = htmltext.FetchExcerpt(question.HTML, "...", 240) question.MemberActions = permission.GetQuestionPermission(ctx, userID, question.UserID, - per.CanEdit, per.CanDelete, per.CanClose, per.CanReopen) + per.CanEdit, per.CanDelete, per.CanClose, per.CanReopen, per.CanPin, per.CanHide) return question, nil } From 13931e8da17a9f8ef8bc69d9f43166a8a57aa74e Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Thu, 13 Apr 2023 14:49:38 +0800 Subject: [PATCH 03/18] action i18n --- i18n/en_US.yaml | 4 ++++ i18n/zh_CN.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml index 3decada5..2171e55a 100644 --- a/i18n/en_US.yaml +++ b/i18n/en_US.yaml @@ -23,6 +23,10 @@ backend: other: Close reopen: other: Reopen + pin: + other: pin + hide: + other: hide role: name: user: diff --git a/i18n/zh_CN.yaml b/i18n/zh_CN.yaml index 3bfdef38..b47ced41 100644 --- a/i18n/zh_CN.yaml +++ b/i18n/zh_CN.yaml @@ -22,6 +22,10 @@ backend: other: 关闭 reopen: other: 重新打开 + pin: + other: 置顶 + hide: + other: 隐藏 role: name: user: From a038664fb403f97b76c81ef7b79cf9cc48460550 Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Thu, 13 Apr 2023 15:46:36 +0800 Subject: [PATCH 04/18] update question pin and show --- docs/docs.go | 8 ++++++ docs/swagger.json | 8 ++++++ docs/swagger.yaml | 6 ++++ internal/entity/question_entity.go | 6 ++++ internal/migrations/v8.go | 29 ++++++++++++++++++++ internal/repo/question/question_repo.go | 13 +++++---- internal/schema/question_schema.go | 2 ++ internal/service/question_common/question.go | 2 ++ 8 files changed, 69 insertions(+), 5 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 73ff9ecd..f0954b62 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -6948,6 +6948,14 @@ const docTemplate = `{ "operator": { "$ref": "#/definitions/schema.QuestionPageRespOperator" }, + "pin": { + "description": "1: unpin, 2: pin", + "type": "integer" + }, + "show": { + "description": "0: show, 1: hide", + "type": "integer" + }, "status": { "type": "integer" }, diff --git a/docs/swagger.json b/docs/swagger.json index 75078211..124e77ba 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -6936,6 +6936,14 @@ "operator": { "$ref": "#/definitions/schema.QuestionPageRespOperator" }, + "pin": { + "description": "1: unpin, 2: pin", + "type": "integer" + }, + "show": { + "description": "0: show, 1: hide", + "type": "integer" + }, "status": { "type": "integer" }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 200abf16..902d037f 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1105,6 +1105,12 @@ definitions: type: string operator: $ref: '#/definitions/schema.QuestionPageRespOperator' + pin: + description: '1: unpin, 2: pin' + type: integer + show: + description: '0: show, 1: hide' + type: integer status: type: integer tags: diff --git a/internal/entity/question_entity.go b/internal/entity/question_entity.go index 4b4f4923..41c9236b 100644 --- a/internal/entity/question_entity.go +++ b/internal/entity/question_entity.go @@ -8,6 +8,10 @@ const ( QuestionStatusAvailable = 1 QuestionStatusClosed = 2 QuestionStatusDeleted = 10 + QuestionUnPin = 1 + QuestionPin = 2 + QuestionShow = 1 + QuestionHide = 2 ) var AdminQuestionSearchStatus = map[string]int{ @@ -32,6 +36,8 @@ type Question struct { Title string `xorm:"not null default '' VARCHAR(150) title"` OriginalText string `xorm:"not null MEDIUMTEXT original_text"` ParsedText string `xorm:"not null MEDIUMTEXT parsed_text"` + Pin int `xorm:"not null default 1 INT(11) pin"` + Show int `xorm:"not null default 1 INT(11) show"` Status int `xorm:"not null default 1 INT(11) status"` ViewCount int `xorm:"not null default 0 INT(11) view_count"` UniqueViewCount int `xorm:"not null default 0 INT(11) unique_view_count"` diff --git a/internal/migrations/v8.go b/internal/migrations/v8.go index 325738d0..dd46a558 100644 --- a/internal/migrations/v8.go +++ b/internal/migrations/v8.go @@ -1,6 +1,8 @@ package migrations import ( + "time" + "github.com/answerdev/answer/internal/entity" "github.com/answerdev/answer/internal/service/permission" "xorm.io/xorm" @@ -51,6 +53,33 @@ func addRolePinAndHideFeatures(x *xorm.Engine) error { return err } } + type Question struct { + ID string `xorm:"not null pk BIGINT(20) id"` + CreatedAt time.Time `xorm:"not null default CURRENT_TIMESTAMP TIMESTAMP created_at"` + UpdatedAt time.Time `xorm:"updated_at TIMESTAMP"` + UserID string `xorm:"not null default 0 BIGINT(20) INDEX user_id"` + LastEditUserID string `xorm:"not null default 0 BIGINT(20) last_edit_user_id"` + Title string `xorm:"not null default '' VARCHAR(150) title"` + OriginalText string `xorm:"not null MEDIUMTEXT original_text"` + ParsedText string `xorm:"not null MEDIUMTEXT parsed_text"` + Status int `xorm:"not null default 1 INT(11) status"` + Pin int `xorm:"not null default 1 INT(11) pin"` + Show int `xorm:"not null default 1 INT(11) show"` + ViewCount int `xorm:"not null default 0 INT(11) view_count"` + UniqueViewCount int `xorm:"not null default 0 INT(11) unique_view_count"` + VoteCount int `xorm:"not null default 0 INT(11) vote_count"` + AnswerCount int `xorm:"not null default 0 INT(11) answer_count"` + CollectionCount int `xorm:"not null default 0 INT(11) collection_count"` + FollowCount int `xorm:"not null default 0 INT(11) follow_count"` + AcceptedAnswerID string `xorm:"not null default 0 BIGINT(20) accepted_answer_id"` + LastAnswerID string `xorm:"not null default 0 BIGINT(20) last_answer_id"` + PostUpdateTime time.Time `xorm:"post_update_time TIMESTAMP"` + RevisionID string `xorm:"not null default 0 BIGINT(20) revision_id"` + } + err := x.Sync(new(Question)) + if err != nil { + return err + } return nil } diff --git a/internal/repo/question/question_repo.go b/internal/repo/question/question_repo.go index 5b1ab705..5c05dd19 100644 --- a/internal/repo/question/question_repo.go +++ b/internal/repo/question/question_repo.go @@ -258,19 +258,22 @@ func (qr *questionRepo) GetQuestionPage(ctx context.Context, page, pageSize int, } if len(userID) > 0 { session.And("question.user_id = ?", userID) + } else { + session.And("question.show = ?", entity.QuestionShow) } + switch orderCond { case "newest": - session.OrderBy("question.created_at DESC") + session.OrderBy("question.pin desc,question.created_at DESC") case "active": - session.OrderBy("question.post_update_time DESC, question.updated_at DESC") + session.OrderBy("question.pin desc,question.post_update_time DESC, question.updated_at DESC") case "frequent": - session.OrderBy("question.view_count DESC") + session.OrderBy("question.pin desc,question.view_count DESC") case "score": - session.OrderBy("question.vote_count DESC, question.view_count DESC") + session.OrderBy("question.pin desc,question.vote_count DESC, question.view_count DESC") case "unanswered": session.Where("question.last_answer_id = 0") - session.OrderBy("question.created_at DESC") + session.OrderBy("question.pin desc,question.created_at DESC") } total, err = pager.Help(page, pageSize, &questionList, &entity.Question{}, session) diff --git a/internal/schema/question_schema.go b/internal/schema/question_schema.go index a051ab83..b5b523e8 100644 --- a/internal/schema/question_schema.go +++ b/internal/schema/question_schema.go @@ -311,6 +311,8 @@ type QuestionPageResp struct { Title string `json:"title"` UrlTitle string `json:"url_title"` Description string `json:"description"` + Pin int `json:"pin"` // 1: unpin, 2: pin + Show int `json:"show"` // 0: show, 1: hide Status int `json:"status"` Tags []*TagResp `json:"tags"` diff --git a/internal/service/question_common/question.go b/internal/service/question_common/question.go index a0d039fc..4b4f259b 100644 --- a/internal/service/question_common/question.go +++ b/internal/service/question_common/question.go @@ -271,6 +271,8 @@ func (qs *QuestionCommon) FormatQuestionsPage( FollowCount: questionInfo.FollowCount, AcceptedAnswerID: questionInfo.AcceptedAnswerID, LastAnswerID: questionInfo.LastAnswerID, + Pin: questionInfo.Pin, + Show: questionInfo.Show, } questionIDs = append(questionIDs, questionInfo.ID) From 766bf793c464ac291382011c5a04d14bc7889317 Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Thu, 13 Apr 2023 16:59:11 +0800 Subject: [PATCH 05/18] update question pin show --- internal/schema/question_schema.go | 2 ++ internal/service/question_common/question.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/internal/schema/question_schema.go b/internal/schema/question_schema.go index b5b523e8..9284ba9c 100644 --- a/internal/schema/question_schema.go +++ b/internal/schema/question_schema.go @@ -184,6 +184,8 @@ type QuestionInfo struct { UpdateTime int64 `json:"-"` // update_time PostUpdateTime int64 `json:"update_time"` QuestionUpdateTime int64 `json:"edit_time"` + Pin int `json:"pin"` // 1: unpin, 2: pin + Show int `json:"show"` // 0: show, 1: hide Status int `json:"status"` Operation *Operation `json:"operation,omitempty"` UserID string `json:"-" ` diff --git a/internal/service/question_common/question.go b/internal/service/question_common/question.go index 4b4f259b..38ae8a9d 100644 --- a/internal/service/question_common/question.go +++ b/internal/service/question_common/question.go @@ -528,6 +528,8 @@ func (qs *QuestionCommon) ShowFormat(ctx context.Context, data *entity.Question) info.QuestionUpdateTime = 0 } info.Status = data.Status + info.Pin = data.Pin + info.Show = data.Show info.UserID = data.UserID info.LastEditUserID = data.LastEditUserID if data.LastAnswerID != "0" { From 0de09c53050f830f3880e48b5cd43a041b5c050a Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Thu, 13 Apr 2023 17:34:02 +0800 Subject: [PATCH 06/18] update question pin show --- internal/base/constant/acticity.go | 4 ++ internal/controller/question_controller.go | 4 +- internal/repo/question/question_repo.go | 9 ++++ internal/service/question_common/question.go | 1 + internal/service/question_service.go | 53 ++++++++++++++++++++ 5 files changed, 69 insertions(+), 2 deletions(-) diff --git a/internal/base/constant/acticity.go b/internal/base/constant/acticity.go index 8300147b..b0db1f46 100644 --- a/internal/base/constant/acticity.go +++ b/internal/base/constant/acticity.go @@ -29,6 +29,10 @@ const ( ActQuestionRollback ActivityTypeKey = "question.rollback" ActQuestionDeleted ActivityTypeKey = "question.deleted" ActQuestionUndeleted ActivityTypeKey = "question.undeleted" + ActQuestionPin ActivityTypeKey = "question.pin" + ActQuestionUnPin ActivityTypeKey = "question.unpin" + ActQuestionHide ActivityTypeKey = "question.hide" + ActQuestionShow ActivityTypeKey = "question.show" ) const ( diff --git a/internal/controller/question_controller.go b/internal/controller/question_controller.go index 97052183..5c9d2e25 100644 --- a/internal/controller/question_controller.go +++ b/internal/controller/question_controller.go @@ -105,8 +105,8 @@ func (qc *QuestionController) OperationQuestion(ctx *gin.Context) { handler.HandleResponse(ctx, errors.Forbidden(reason.RankFailToMeetTheCondition), nil) return } - - handler.HandleResponse(ctx, nil, nil) + err = qc.questionService.OperationQuestion(ctx, req) + handler.HandleResponse(ctx, err, nil) } // CloseQuestion Close question diff --git a/internal/repo/question/question_repo.go b/internal/repo/question/question_repo.go index 5c05dd19..c22a97d6 100644 --- a/internal/repo/question/question_repo.go +++ b/internal/repo/question/question_repo.go @@ -125,6 +125,15 @@ func (qr *questionRepo) UpdateQuestionStatusWithOutUpdateTime(ctx context.Contex return nil } +func (qr *questionRepo) UpdateQuestionOperation(ctx context.Context, question *entity.Question) (err error) { + question.ID = uid.DeShortID(question.ID) + _, err = qr.data.DB.Where("id =?", question.ID).Cols("pin", "show").Update(question) + if err != nil { + return errors.InternalServer(reason.DatabaseError).WithError(err).WithStack() + } + return nil +} + func (qr *questionRepo) UpdateAccepted(ctx context.Context, question *entity.Question) (err error) { question.ID = uid.DeShortID(question.ID) _, err = qr.data.DB.Where("id =?", question.ID).Cols("accepted_answer_id").Update(question) diff --git a/internal/service/question_common/question.go b/internal/service/question_common/question.go index 38ae8a9d..842670f4 100644 --- a/internal/service/question_common/question.go +++ b/internal/service/question_common/question.go @@ -36,6 +36,7 @@ type QuestionRepo interface { questionList []*entity.Question, total int64, err error) UpdateQuestionStatus(ctx context.Context, question *entity.Question) (err error) UpdateQuestionStatusWithOutUpdateTime(ctx context.Context, question *entity.Question) (err error) + UpdateQuestionOperation(ctx context.Context, question *entity.Question) (err error) SearchByTitleLike(ctx context.Context, title string) (questionList []*entity.Question, err error) UpdatePvCount(ctx context.Context, questionID string) (err error) UpdateAnswerCount(ctx context.Context, questionID string, num int) (err error) diff --git a/internal/service/question_service.go b/internal/service/question_service.go index f3f8d546..b59e97d5 100644 --- a/internal/service/question_service.go +++ b/internal/service/question_service.go @@ -319,6 +319,59 @@ func (qs *QuestionService) AddQuestion(ctx context.Context, req *schema.Question return } +// OperationQuestion +func (qs *QuestionService) OperationQuestion(ctx context.Context, req *schema.OperationQuestionReq) (err error) { + questionInfo, has, err := qs.questionRepo.GetQuestion(ctx, req.ID) + if err != nil { + return err + } + if !has { + return nil + } + // Hidden question cannot be placed at the top + if questionInfo.Show == entity.QuestionHide && req.Operation == schema.QuestionOperationPin { + return nil + } + // Question cannot be hidden when they are at the top + if questionInfo.Pin == entity.QuestionPin && req.Operation == schema.QuestionOperationHide { + return nil + } + + switch req.Operation { + case schema.QuestionOperationHide: + questionInfo.Show = entity.QuestionHide + case schema.QuestionOperationShow: + questionInfo.Show = entity.QuestionShow + case schema.QuestionOperationPin: + questionInfo.Pin = entity.QuestionPin + case schema.QuestionOperationUnPin: + questionInfo.Pin = entity.QuestionUnPin + } + + err = qs.questionRepo.UpdateQuestionOperation(ctx, questionInfo) + if err != nil { + return err + } + + actMap := make(map[string]constant.ActivityTypeKey) + actMap[schema.QuestionOperationPin] = constant.ActQuestionPin + actMap[schema.QuestionOperationUnPin] = constant.ActQuestionUnPin + actMap[schema.QuestionOperationHide] = constant.ActQuestionHide + actMap[schema.QuestionOperationShow] = constant.ActQuestionShow + + _, ok := actMap[req.Operation] + if !ok { + activity_queue.AddActivity(&schema.ActivityMsg{ + UserID: req.UserID, + ObjectID: questionInfo.ID, + OriginalObjectID: questionInfo.ID, + ActivityTypeKey: actMap[req.Operation], + }) + } + + return nil +} + // RemoveQuestion delete question func (qs *QuestionService) RemoveQuestion(ctx context.Context, req *schema.RemoveQuestionReq) (err error) { questionInfo, has, err := qs.questionRepo.GetQuestion(ctx, req.ID) From 0c174599655e037b62a1f9d64bac3a2161585e4d Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Thu, 13 Apr 2023 18:20:26 +0800 Subject: [PATCH 07/18] update question --- i18n/en_US.yaml | 4 ++ i18n/zh_CN.yaml | 4 ++ internal/base/constant/acticity.go | 4 ++ internal/controller/question_controller.go | 8 +++- internal/migrations/v8.go | 37 ++++++++++++++++++- internal/schema/question_schema.go | 4 +- .../service/permission/permission_name.go | 8 +++- .../service/permission/question_permission.go | 18 ++++++++- internal/service/question_service.go | 16 +++++++- 9 files changed, 95 insertions(+), 8 deletions(-) diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml index 2171e55a..333e75fe 100644 --- a/i18n/en_US.yaml +++ b/i18n/en_US.yaml @@ -27,6 +27,10 @@ backend: other: pin hide: other: hide + unpin: + other: unpin + show: + other: show role: name: user: diff --git a/i18n/zh_CN.yaml b/i18n/zh_CN.yaml index b47ced41..5fd46710 100644 --- a/i18n/zh_CN.yaml +++ b/i18n/zh_CN.yaml @@ -26,6 +26,10 @@ backend: other: 置顶 hide: other: 隐藏 + unpin: + other: 取消置顶 + show: + other: 显示 role: name: user: diff --git a/internal/base/constant/acticity.go b/internal/base/constant/acticity.go index b0db1f46..334d8e6d 100644 --- a/internal/base/constant/acticity.go +++ b/internal/base/constant/acticity.go @@ -14,6 +14,10 @@ const ( ActFollow = "follow" ActAccepted = "accepted" ActAccept = "accept" + ActPin = "pin" + ActUnPin = "unpin" + ActShow = "show" + ActHide = "hide" ) const ( diff --git a/internal/controller/question_controller.go b/internal/controller/question_controller.go index 5c9d2e25..6b474670 100644 --- a/internal/controller/question_controller.go +++ b/internal/controller/question_controller.go @@ -89,7 +89,9 @@ func (qc *QuestionController) OperationQuestion(ctx *gin.Context) { req.UserID = middleware.GetLoginUserIDFromContext(ctx) canList, err := qc.rankService.CheckOperationPermissions(ctx, req.UserID, []string{ permission.QuestionPin, + permission.QuestionUnPin, permission.QuestionHide, + permission.QuestionShow, }) if err != nil { handler.HandleResponse(ctx, err, nil) @@ -192,7 +194,9 @@ func (qc *QuestionController) GetQuestion(ctx *gin.Context) { permission.QuestionClose, permission.QuestionReopen, permission.QuestionPin, + permission.QuestionUnPin, permission.QuestionHide, + permission.QuestionShow, }) if err != nil { handler.HandleResponse(ctx, err, nil) @@ -205,7 +209,9 @@ func (qc *QuestionController) GetQuestion(ctx *gin.Context) { req.CanClose = canList[2] req.CanReopen = canList[3] req.CanPin = canList[4] - req.CanHide = canList[5] + req.CanUnPin = canList[5] + req.CanHide = canList[6] + req.CanShow = canList[7] info, err := qc.questionService.GetQuestionAndAddPV(ctx, id, userID, req) if err != nil { diff --git a/internal/migrations/v8.go b/internal/migrations/v8.go index dd46a558..090651fa 100644 --- a/internal/migrations/v8.go +++ b/internal/migrations/v8.go @@ -1,18 +1,22 @@ package migrations import ( + "fmt" "time" "github.com/answerdev/answer/internal/entity" "github.com/answerdev/answer/internal/service/permission" + "github.com/segmentfault/pacman/log" "xorm.io/xorm" ) func addRolePinAndHideFeatures(x *xorm.Engine) error { powers := []*entity.Power{ - {ID: 34, Name: "question pin", PowerType: permission.QuestionPin, Description: "Top or untop the question"}, - {ID: 35, Name: "question hide", PowerType: permission.QuestionHide, Description: "hide or show the question"}, + {ID: 34, Name: "question pin", PowerType: permission.QuestionPin, Description: "top the question"}, + {ID: 35, Name: "question hide", PowerType: permission.QuestionHide, Description: "hide the question"}, + {ID: 36, Name: "question unpin", PowerType: permission.QuestionUnPin, Description: "untop the question"}, + {ID: 37, Name: "question show", PowerType: permission.QuestionShow, Description: "show the question"}, } // insert default powers for _, power := range powers { @@ -34,9 +38,13 @@ func addRolePinAndHideFeatures(x *xorm.Engine) error { {RoleID: 2, PowerType: permission.QuestionPin}, {RoleID: 2, PowerType: permission.QuestionHide}, + {RoleID: 2, PowerType: permission.QuestionUnPin}, + {RoleID: 2, PowerType: permission.QuestionShow}, {RoleID: 3, PowerType: permission.QuestionPin}, {RoleID: 3, PowerType: permission.QuestionHide}, + {RoleID: 3, PowerType: permission.QuestionUnPin}, + {RoleID: 3, PowerType: permission.QuestionShow}, } // insert default powers @@ -53,6 +61,31 @@ func addRolePinAndHideFeatures(x *xorm.Engine) error { return err } } + + defaultConfigTable := []*entity.Config{ + {ID: 119, Key: "question.pin", Value: `0`}, + {ID: 120, Key: "question.unpin", Value: `0`}, + {ID: 121, Key: "question.show", Value: `0`}, + {ID: 122, Key: "question.hide", Value: `0`}, + } + for _, c := range defaultConfigTable { + exist, err := x.Get(&entity.Config{ID: c.ID, Key: c.Key}) + if err != nil { + return fmt.Errorf("get config failed: %w", err) + } + if exist { + if _, err = x.Update(c, &entity.Config{ID: c.ID, Key: c.Key}); err != nil { + log.Errorf("update %+v config failed: %s", c, err) + return fmt.Errorf("update config failed: %w", err) + } + continue + } + if _, err = x.Insert(&entity.Config{ID: c.ID, Key: c.Key, Value: c.Value}); err != nil { + log.Errorf("insert %+v config failed: %s", c, err) + return fmt.Errorf("add config failed: %w", err) + } + } + type Question struct { ID string `xorm:"not null pk BIGINT(20) id"` CreatedAt time.Time `xorm:"not null default CURRENT_TIMESTAMP TIMESTAMP created_at"` diff --git a/internal/schema/question_schema.go b/internal/schema/question_schema.go index 9284ba9c..b86dcff9 100644 --- a/internal/schema/question_schema.go +++ b/internal/schema/question_schema.go @@ -114,9 +114,11 @@ type QuestionPermission struct { // whether user can reopen it CanReopen bool `json:"-"` // whether user can pin it - CanPin bool `json:"-"` + CanPin bool `json:"-"` + CanUnPin bool `json:"-"` // whether user can hide it CanHide bool `json:"-"` + CanShow bool `json:"-"` // whether user can use reserved it CanUseReservedTag bool `json:"-"` } diff --git a/internal/service/permission/permission_name.go b/internal/service/permission/permission_name.go index 783e3b49..1d49ce3f 100644 --- a/internal/service/permission/permission_name.go +++ b/internal/service/permission/permission_name.go @@ -10,8 +10,10 @@ const ( QuestionReopen = "question.reopen" QuestionVoteUp = "question.vote_up" QuestionVoteDown = "question.vote_down" - QuestionPin = "question.pin" //Top or untop the question - QuestionHide = "question.hide" //hide or show the question + QuestionPin = "question.pin" //Top the question + QuestionUnPin = "question.unpin" //untop the question + QuestionHide = "question.hide" //hide the question + QuestionShow = "question.show" //show the question AnswerAdd = "answer.add" AnswerEdit = "answer.edit" AnswerEditWithoutReview = "answer.edit_without_review" @@ -46,5 +48,7 @@ const ( closeActionName = "action.close" reopenActionName = "action.reopen" pinActionName = "action.pin" + unpinActionName = "action.unpin" hideActionName = "action.hide" + showActionName = "action.show" ) diff --git a/internal/service/permission/question_permission.go b/internal/service/permission/question_permission.go index a295f7ff..6f4d126f 100644 --- a/internal/service/permission/question_permission.go +++ b/internal/service/permission/question_permission.go @@ -10,7 +10,7 @@ import ( // GetQuestionPermission get question permission func GetQuestionPermission(ctx context.Context, userID string, creatorUserID string, - canEdit, canDelete, canClose, canReopen, canPin, canHide bool) ( + canEdit, canDelete, canClose, canReopen, canPin, canHide, CanUnPin, canShow bool) ( actions []*schema.PermissionMemberAction) { lang := handler.GetLangByCtx(ctx) actions = make([]*schema.PermissionMemberAction, 0) @@ -56,6 +56,22 @@ func GetQuestionPermission(ctx context.Context, userID string, creatorUserID str Type: "confirm", }) } + + if CanUnPin { + actions = append(actions, &schema.PermissionMemberAction{ + Action: "unpin", + Name: translator.Tr(lang, unpinActionName), + Type: "confirm", + }) + } + + if canShow { + actions = append(actions, &schema.PermissionMemberAction{ + Action: "show", + Name: translator.Tr(lang, showActionName), + Type: "confirm", + }) + } if canDelete || userID == creatorUserID { actions = append(actions, &schema.PermissionMemberAction{ Action: "delete", diff --git a/internal/service/question_service.go b/internal/service/question_service.go index b59e97d5..dfcdff3d 100644 --- a/internal/service/question_service.go +++ b/internal/service/question_service.go @@ -685,6 +685,20 @@ func (qs *QuestionService) GetQuestion(ctx context.Context, questionID, userID s if question.Status == entity.QuestionStatusClosed { per.CanClose = false } + if question.Pin == entity.QuestionPin { + per.CanPin = false + per.CanHide = false + } + if question.Pin == entity.QuestionUnPin { + per.CanUnPin = false + } + if question.Show == entity.QuestionShow { + per.CanShow = false + } + if question.Show == entity.QuestionHide { + per.CanHide = false + per.CanPin = false + } if question.Status == entity.QuestionStatusDeleted { operation := &schema.Operation{} operation.Msg = translator.Tr(handler.GetLangByCtx(ctx), reason.QuestionAlreadyDeleted) @@ -694,7 +708,7 @@ func (qs *QuestionService) GetQuestion(ctx context.Context, questionID, userID s question.Description = htmltext.FetchExcerpt(question.HTML, "...", 240) question.MemberActions = permission.GetQuestionPermission(ctx, userID, question.UserID, - per.CanEdit, per.CanDelete, per.CanClose, per.CanReopen, per.CanPin, per.CanHide) + per.CanEdit, per.CanDelete, per.CanClose, per.CanReopen, per.CanPin, per.CanHide, per.CanUnPin, per.CanShow) return question, nil } From 0124cfc435ad0d39343381fcc20468bd52164284 Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Thu, 13 Apr 2023 18:27:43 +0800 Subject: [PATCH 08/18] update question --- internal/service/question_service.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/service/question_service.go b/internal/service/question_service.go index dfcdff3d..c3271b6e 100644 --- a/internal/service/question_service.go +++ b/internal/service/question_service.go @@ -358,9 +358,8 @@ func (qs *QuestionService) OperationQuestion(ctx context.Context, req *schema.Op actMap[schema.QuestionOperationUnPin] = constant.ActQuestionUnPin actMap[schema.QuestionOperationHide] = constant.ActQuestionHide actMap[schema.QuestionOperationShow] = constant.ActQuestionShow - _, ok := actMap[req.Operation] - if !ok { + if ok { activity_queue.AddActivity(&schema.ActivityMsg{ UserID: req.UserID, ObjectID: questionInfo.ID, From 0c533e554dccbb5944c89adf79fc71ae1811db2f Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Thu, 13 Apr 2023 18:39:06 +0800 Subject: [PATCH 09/18] update question --- internal/service/question_service.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/service/question_service.go b/internal/service/question_service.go index c3271b6e..cea7af84 100644 --- a/internal/service/question_service.go +++ b/internal/service/question_service.go @@ -270,6 +270,8 @@ func (qs *QuestionService) AddQuestion(ctx context.Context, req *schema.Question question.Status = entity.QuestionStatusAvailable question.RevisionID = "0" question.CreatedAt = now + question.Pin = entity.QuestionUnPin + question.Show = entity.QuestionShow //question.UpdatedAt = nil err = qs.questionRepo.AddQuestion(ctx, question) if err != nil { @@ -698,6 +700,7 @@ func (qs *QuestionService) GetQuestion(ctx context.Context, questionID, userID s per.CanHide = false per.CanPin = false } + if question.Status == entity.QuestionStatusDeleted { operation := &schema.Operation{} operation.Msg = translator.Tr(handler.GetLangByCtx(ctx), reason.QuestionAlreadyDeleted) From 17b7e9c7b8537eda7e38715865b6902e9ec96739 Mon Sep 17 00:00:00 2001 From: shuai Date: Thu, 13 Apr 2023 18:43:48 +0800 Subject: [PATCH 10/18] feat: add top hide function --- i18n/en_US.yaml | 22 +++- ui/src/common/constants.ts | 4 + ui/src/common/interface.ts | 5 + .../Comment/components/Form/index.tsx | 2 +- .../Comment/components/Reply/index.tsx | 2 +- ui/src/components/Customize/index.tsx | 4 +- ui/src/components/Icon/index.tsx | 11 +- ui/src/components/Operate/index.tsx | 105 +++++++++++++++++- ui/src/components/QuestionList/index.tsx | 8 ++ ui/src/components/Share/index.tsx | 2 +- ui/src/components/TagSelector/index.tsx | 21 ++-- .../Detail/components/Question/index.tsx | 8 ++ ui/src/pages/Users/Settings/Profile/index.tsx | 2 +- ui/src/services/common.ts | 4 + 14 files changed, 172 insertions(+), 28 deletions(-) diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml index 3decada5..7c4d19d1 100644 --- a/i18n/en_US.yaml +++ b/i18n/en_US.yaml @@ -789,6 +789,7 @@ ui: btn: Add question answers: answers question_detail: + action: Action Asked: Asked asked: asked update: Modified @@ -827,13 +828,14 @@ ui: li1_2: Back up any statements you make with references or personal experience. header_2: But avoid ... li2_1: Asking for help, seeking clarification, or responding to other answers. - reopen: confirm_btn: Reopen title: Reopen this post content: Are you sure you want to reopen? - success: This post has been reopened - + pin: + title: Pin this post + content: Are you sure you wish to pinned globally? This post will appear at the top of all post lists. + confirm_btn: Pin delete: title: Delete this post question: >- @@ -847,7 +849,6 @@ ui: of accepted answers can result in your account being blocked from answering. Are you sure you wish to delete? other: Are you sure you wish to delete? - tip_question_deleted: This post has been deleted tip_answer_deleted: This answer has been deleted btns: confirm: Confirm @@ -863,6 +864,7 @@ ui: reject: Reject skip: Skip discard_draft: Discard draft + pinned: Pinned search: title: Search Results keywords: Keywords @@ -1434,6 +1436,10 @@ ui: closed: closed reopened: reopened created: created + pin: pinned + unpin: unpinned + show: listed + hide: unlisted title: "History for" tag_title: "Timeline for" show_votes: "Show votes" @@ -1459,5 +1465,9 @@ ui: draft: discard_confirm: Are you sure you want to discard your draft? messages: - post_deleted: This post has been deleted. - + post_deleted: This post has been deleted. + post_pin: This post has been pinned. + post_unpin: This post has been unpinned. + post_hide_list: This post has been hidden from list. + post_show_list: This post has been shown to list. + post_reopen: This post has been reopened. diff --git a/ui/src/common/constants.ts b/ui/src/common/constants.ts index b794ede3..705e74c1 100644 --- a/ui/src/common/constants.ts +++ b/ui/src/common/constants.ts @@ -594,6 +594,10 @@ export const TIMELINE_NORMAL_ACTIVITY_TYPE = [ 'upvote', 'reopened', 'closed', + 'pin', + 'unpin', + 'show', + 'hide', ]; export const SYSTEM_AVATAR_OPTIONS = [ diff --git a/ui/src/common/interface.ts b/ui/src/common/interface.ts index 640efcaa..7d51a3c8 100644 --- a/ui/src/common/interface.ts +++ b/ui/src/common/interface.ts @@ -526,3 +526,8 @@ export interface User { display_name: string; avatar: string; } + +export interface QuestionOperationReq { + id: string; + operation: 'pin' | 'unpin' | 'hide' | 'show'; +} diff --git a/ui/src/components/Comment/components/Form/index.tsx b/ui/src/components/Comment/components/Form/index.tsx index 66e6596f..5ca0753e 100644 --- a/ui/src/components/Comment/components/Form/index.tsx +++ b/ui/src/components/Comment/components/Form/index.tsx @@ -51,7 +51,7 @@ const Index = ({ 'd-flex align-items-start flex-column flex-md-row', className, )}> -
+
{ {t('reply_to')} {userName}
-
+
{ } scriptList?.forEach((so) => { const script = document.createElement('script'); - script.text = so.text; + script.text = `(() => { + ${so.text} + })();`; for (let i = 0; i < so.attributes.length; i += 1) { const attr = so.attributes[i]; script.setAttribute(attr.name, attr.value); diff --git a/ui/src/components/Icon/index.tsx b/ui/src/components/Icon/index.tsx index b1951b0e..ba973873 100644 --- a/ui/src/components/Icon/index.tsx +++ b/ui/src/components/Icon/index.tsx @@ -8,15 +8,24 @@ interface IProps { name: string; className?: string; size?: string; + title?: string; onClick?: () => void; } -const Icon: FC = ({ type = 'br', name, className, size, onClick }) => { +const Icon: FC = ({ + type = 'br', + name, + className, + size, + onClick, + title = '', +}) => { return ( ); }; diff --git a/ui/src/components/Operate/index.tsx b/ui/src/components/Operate/index.tsx index 06e9377e..96e94b7a 100644 --- a/ui/src/components/Operate/index.tsx +++ b/ui/src/components/Operate/index.tsx @@ -1,19 +1,22 @@ import { memo, FC } from 'react'; -import { Button } from 'react-bootstrap'; +import { Button, Dropdown } from 'react-bootstrap'; import { Link, useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Modal } from '@/components'; import { useReportModal, useToast } from '@/hooks'; +import { QuestionOperationReq } from '@/common/interface'; import Share from '../Share'; import { deleteQuestion, deleteAnswer, editCheck, reopenQuestion, + questionOpetation, } from '@/services'; import { tryNormalLogged } from '@/utils/guard'; import { floppyNavigation } from '@/utils'; +import { toastStore } from '@/stores'; interface IProps { type: 'answer' | 'question'; @@ -78,7 +81,7 @@ const Index: FC = ({ id: qid, }).then(() => { toast.onShow({ - msg: t('tip_question_deleted'), + msg: t('post_deleted', { keyPrefix: 'messages' }), variant: 'success', }); callback?.('delete_question'); @@ -134,7 +137,7 @@ const Index: FC = ({ question_id: qid, }).then(() => { toast.onShow({ - msg: t('success', { keyPrefix: 'question_detail.reopen' }), + msg: t('post_reopen', { keyPrefix: 'messages' }), variant: 'success', }); refreshQuestion(); @@ -143,6 +146,51 @@ const Index: FC = ({ }); }; + const handleCommon = async (params) => { + await questionOpetation(params); + let msg = ''; + if (params.operation === 'pin') { + msg = t('post_pin', { keyPrefix: 'messages' }); + } + if (params.operation === 'unpin') { + msg = t('post_unpin', { keyPrefix: 'messages' }); + } + if (params.operation === 'hide') { + msg = t('post_hide_list', { keyPrefix: 'messages' }); + } + if (params.operation === 'show') { + msg = t('post_show_list', { keyPrefix: 'messages' }); + } + toastStore.getState().show({ + msg, + variant: 'success', + }); + setTimeout(() => { + refreshQuestion(); + }, 100); + }; + + const handlOtherActions = (action) => { + const params: QuestionOperationReq = { + id: qid, + operation: action, + }; + + if (action === 'pin') { + Modal.confirm({ + title: t('title', { keyPrefix: 'question_detail.pin' }), + content: t('content', { keyPrefix: 'question_detail.pin' }), + cancelBtnVariant: 'link', + confirmText: t('confirm_btn', { keyPrefix: 'question_detail.pin' }), + onConfirm: () => { + handleCommon(params); + }, + }); + } else { + handleCommon(params); + } + }; + const handleAction = (action) => { if (!tryNormalLogged(true)) { return; @@ -162,8 +210,33 @@ const Index: FC = ({ if (action === 'reopen') { handleReopen(); } + + if ( + action === 'pin' || + action === 'unpin' || + action === 'hide' || + action === 'show' + ) { + handlOtherActions(action); + } }; + const firstAction = + memberActions?.filter( + (v) => + v.action === 'report' || v.action === 'edit' || v.action === 'delete', + ) || []; + const secondAction = + memberActions?.filter( + (v) => + v.action === 'close' || + v.action === 'reopen' || + v.action === 'pin' || + v.action === 'unpin' || + v.action === 'hide' || + v.action === 'show', + ) || []; + return (
= ({ title={title} slugTitle={slugTitle} /> - {memberActions?.map((item) => { + {firstAction?.map((item) => { if (item.action === 'edit') { return ( handleEdit(evt, editUrl)} style={{ lineHeight: '23px' }}> {item.name} @@ -190,12 +263,32 @@ const Index: FC = ({ ); })} + {secondAction.length > 0 && ( + + + {t('action', { keyPrefix: 'question_detail' })} + + + {secondAction.map((item) => { + return ( + handleAction(item.action)}> + {item.name} + + ); + })} + + + )}
); }; diff --git a/ui/src/components/QuestionList/index.tsx b/ui/src/components/QuestionList/index.tsx index 94377b18..26599c79 100644 --- a/ui/src/components/QuestionList/index.tsx +++ b/ui/src/components/QuestionList/index.tsx @@ -14,6 +14,7 @@ import { QueryGroup, QuestionListLoader, Counts, + Icon, } from '@/components'; const QuestionOrderKeys: Type.QuestionOrderBy[] = [ @@ -62,6 +63,13 @@ const QuestionList: FC = ({ source, data, isLoading = false }) => { key={li.id} className="bg-transparent py-3 px-0 border-start-0 border-end-0">
+ {li.pin === 2 && ( + + )} diff --git a/ui/src/components/Share/index.tsx b/ui/src/components/Share/index.tsx index 855b02cb..34c45fc3 100644 --- a/ui/src/components/Share/index.tsx +++ b/ui/src/components/Share/index.tsx @@ -71,7 +71,7 @@ const Index: FC = ({ type, qid, aid, title, slugTitle = '' }) => { setShow(true)} style={{ lineHeight: '23px' }}> {t('share.name')} diff --git a/ui/src/components/TagSelector/index.tsx b/ui/src/components/TagSelector/index.tsx index a8bb0a6c..01961ff5 100644 --- a/ui/src/components/TagSelector/index.tsx +++ b/ui/src/components/TagSelector/index.tsx @@ -38,7 +38,7 @@ const TagSelector: FC = ({ const [initialValue, setInitialValue] = useState([...value]); const [currentIndex, setCurrentIndex] = useState(0); const [repeatIndex, setRepeatIndex] = useState(-1); - const [tag, setTag] = useState(''); + const [searchValue, setSearchValue] = useState(''); const [tags, setTags] = useState(null); const { t } = useTranslation('translation', { keyPrefix: 'tag_selector' }); const [visibleMenu, setVisibleMenu] = useState(false); @@ -101,12 +101,12 @@ const TagSelector: FC = ({ const fetchTags = (str) => { queryTags(str).then((res) => { const tagArray: Type.Tag[] = filterTags(res || []); - setTags(tagArray); + setTags(tagArray?.length > 5 ? tagArray.slice(0, 5) : tagArray); }); }; useEffect(() => { - fetchTags(tag); + fetchTags(searchValue); }, [visibleMenu]); const handleClick = (val: Type.Tag) => { @@ -146,7 +146,7 @@ const TagSelector: FC = ({ const handleSearch = async (e: React.ChangeEvent) => { const searchStr = e.currentTarget.value.replace(';', ''); - setTag(searchStr); + setSearchValue(searchStr); fetchTags(searchStr); }; @@ -172,7 +172,7 @@ const TagSelector: FC = ({ e.preventDefault(); if (tags.length === 0) { - tagModal.onShow(tag); + tagModal.onShow(searchValue); return; } if (currentIndex <= tags.length - 1) { @@ -228,13 +228,14 @@ const TagSelector: FC = ({ )} - {showRequiredTagText && + {!searchValue && + showRequiredTagText && tags && tags.filter((v) => v.recommend)?.length > 0 && (
{t('tag_required_text')}
@@ -251,17 +252,17 @@ const TagSelector: FC = ({ ); })} - {tag && tags && tags.length === 0 && ( + {searchValue && tags && tags.length === 0 && ( {t('no_result')} )} - {!hiddenCreateBtn && tag && ( + {!hiddenCreateBtn && searchValue && ( diff --git a/ui/src/pages/Questions/Detail/components/Question/index.tsx b/ui/src/pages/Questions/Detail/components/Question/index.tsx index 94a42981..3cfb7de0 100644 --- a/ui/src/pages/Questions/Detail/components/Question/index.tsx +++ b/ui/src/pages/Questions/Detail/components/Question/index.tsx @@ -11,6 +11,7 @@ import { Comment, FormatTime, htmlRender, + Icon, } from '@/components'; import { formatCount, guard } from '@/utils'; import { following } from '@/services'; @@ -65,6 +66,13 @@ const Index: FC = ({ data, initPage, hasAnswer, isLogged }) => { return (

+ {data?.pin === 2 && ( + + )} { - + {t('avatar.label')}
{ export const saveQuestionWidthAnaser = (params: Type.QuestionWithAnswer) => { return request.post('/answer/api/v1/question/answer', params); }; + +export const questionOpetation = (params: Type.QuestionOperationReq) => { + return request.put('/answer/api/v1/question/operation', params); +}; From 78c3ef84c03f9520ad33fb1a2e7daa176dff4439 Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Mon, 17 Apr 2023 18:04:57 +0800 Subject: [PATCH 11/18] update user answer list --- internal/service/question_service.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/service/question_service.go b/internal/service/question_service.go index cea7af84..c66497be 100644 --- a/internal/service/question_service.go +++ b/internal/service/question_service.go @@ -804,14 +804,15 @@ func (qs *QuestionService) SearchUserAnswerList(ctx context.Context, userName, o if ok { item.QuestionInfo = questionMaps[item.QuestionID] } - } - for _, item := range answerlist { info := &schema.UserAnswerInfo{} _ = copier.Copy(info, item) info.AnswerID = item.ID info.QuestionID = item.QuestionID - userAnswerlist = append(userAnswerlist, info) + if item.QuestionInfo.Status != entity.QuestionStatusDeleted { + userAnswerlist = append(userAnswerlist, info) + } } + return userAnswerlist, count, nil } From c95af94cd0309decd0731081e0ec1c403afc3553 Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Tue, 18 Apr 2023 16:35:03 +0800 Subject: [PATCH 12/18] update i18n --- i18n/en_US.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml index 333e75fe..b2352547 100644 --- a/i18n/en_US.yaml +++ b/i18n/en_US.yaml @@ -24,13 +24,13 @@ backend: reopen: other: Reopen pin: - other: pin + other: Pin hide: - other: hide + other: Unlist unpin: - other: unpin + other: Unpin show: - other: show + other: List role: name: user: From bcc732d89c9919f66ea10b0cbfb46b47530aa34d Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Tue, 18 Apr 2023 17:11:38 +0800 Subject: [PATCH 13/18] update search --- internal/repo/question/question_repo.go | 1 + internal/repo/search_common/search_repo.go | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/internal/repo/question/question_repo.go b/internal/repo/question/question_repo.go index c22a97d6..da9d048f 100644 --- a/internal/repo/question/question_repo.go +++ b/internal/repo/question/question_repo.go @@ -233,6 +233,7 @@ func (qr *questionRepo) GetQuestionIDsPage(ctx context.Context, page, pageSize i offset := page * pageSize session := qr.data.DB.Table("question") session = session.In("question.status", []int{entity.QuestionStatusAvailable, entity.QuestionStatusClosed}) + session.And("question.show = ?", entity.QuestionShow) session = session.Limit(pageSize, offset) session = session.OrderBy("question.created_at asc") err = session.Select("id,title,created_at,post_update_time").Find(&rows) diff --git a/internal/repo/search_common/search_repo.go b/internal/repo/search_common/search_repo.go index 987fea5c..dc07e5ae 100644 --- a/internal/repo/search_common/search_repo.go +++ b/internal/repo/search_common/search_repo.go @@ -94,12 +94,14 @@ func (sr *searchRepo) SearchContents(ctx context.Context, words []string, tagIDs ub = builder.MySQL().Select(afs...).From("`answer`"). LeftJoin("`question`", "`question`.id = `answer`.question_id") - b.Where(builder.Lt{"`question`.`status`": entity.QuestionStatusDeleted}) + b.Where(builder.Lt{"`question`.`status`": entity.QuestionStatusDeleted}). + And(builder.Eq{"`question`.`show`": entity.QuestionShow}) ub.Where(builder.Lt{"`question`.`status`": entity.QuestionStatusDeleted}). - And(builder.Lt{"`answer`.`status`": entity.AnswerStatusDeleted}) + And(builder.Lt{"`answer`.`status`": entity.AnswerStatusDeleted}). + And(builder.Eq{"`question`.`show`": entity.QuestionShow}) - argsQ = append(argsQ, entity.QuestionStatusDeleted) - argsA = append(argsA, entity.QuestionStatusDeleted, entity.AnswerStatusDeleted) + argsQ = append(argsQ, entity.QuestionStatusDeleted, entity.QuestionShow) + argsA = append(argsA, entity.QuestionStatusDeleted, entity.AnswerStatusDeleted, entity.QuestionShow) for i, word := range words { if i == 0 { @@ -228,8 +230,8 @@ func (sr *searchRepo) SearchQuestions(ctx context.Context, words []string, tagID b := builder.MySQL().Select(qfs...).From("question") - b.Where(builder.Lt{"`question`.`status`": entity.QuestionStatusDeleted}) - args = append(args, entity.QuestionStatusDeleted) + b.Where(builder.Lt{"`question`.`status`": entity.QuestionStatusDeleted}).And(builder.Eq{"`question`.`show`": entity.QuestionShow}) + args = append(args, entity.QuestionStatusDeleted, entity.QuestionShow) for i, word := range words { if i == 0 { @@ -343,8 +345,8 @@ func (sr *searchRepo) SearchAnswers(ctx context.Context, words []string, tagIDs LeftJoin("`question`", "`question`.id = `answer`.question_id") b.Where(builder.Lt{"`question`.`status`": entity.QuestionStatusDeleted}). - And(builder.Lt{"`answer`.`status`": entity.AnswerStatusDeleted}) - args = append(args, entity.QuestionStatusDeleted, entity.AnswerStatusDeleted) + And(builder.Lt{"`answer`.`status`": entity.AnswerStatusDeleted}).And(builder.Eq{"`question`.`show`": entity.QuestionShow}) + args = append(args, entity.QuestionStatusDeleted, entity.AnswerStatusDeleted, entity.QuestionShow) for i, word := range words { if i == 0 { From 92cc1e6a5d55f233f788e2e9d6b65753b45d2c4d Mon Sep 17 00:00:00 2001 From: shuai Date: Tue, 18 Apr 2023 17:38:08 +0800 Subject: [PATCH 14/18] chore: split main.js --- ui/config-overrides.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/config-overrides.js b/ui/config-overrides.js index 60b66a51..4f7c3af0 100644 --- a/ui/config-overrides.js +++ b/ui/config-overrides.js @@ -1,6 +1,7 @@ const { addWebpackModuleRule, - addWebpackAlias + addWebpackAlias, + setWebpackOptimizationSplitChunks, } = require("customize-cra"); const path = require("path"); @@ -18,6 +19,13 @@ module.exports = { use: "yaml-loader" })(config); + setWebpackOptimizationSplitChunks({ + chunks: "all", + maxInitialRequests: 20, + maxAsyncRequests: 20, + minSize: 1024 * 5, + })(config); + // add i18n dir to ModuleScopePlugin allowedPaths const moduleScopePlugin = config.resolve.plugins.find(_ => _.constructor.name === "ModuleScopePlugin"); if (moduleScopePlugin) { From 56ece355177eb892da3e27f6af4607b9a479d2b9 Mon Sep 17 00:00:00 2001 From: shuai Date: Tue, 18 Apr 2023 17:49:31 +0800 Subject: [PATCH 15/18] fix: remove test split main.js --- ui/config-overrides.js | 16 ++-- ui/package.json | 2 +- ui/pnpm-lock.yaml | 167 +++++++++++++++++++++-------------------- 3 files changed, 96 insertions(+), 89 deletions(-) diff --git a/ui/config-overrides.js b/ui/config-overrides.js index 4f7c3af0..442469e6 100644 --- a/ui/config-overrides.js +++ b/ui/config-overrides.js @@ -1,7 +1,7 @@ const { addWebpackModuleRule, addWebpackAlias, - setWebpackOptimizationSplitChunks, + // setWebpackOptimizationSplitChunks, } = require("customize-cra"); const path = require("path"); @@ -19,12 +19,14 @@ module.exports = { use: "yaml-loader" })(config); - setWebpackOptimizationSplitChunks({ - chunks: "all", - maxInitialRequests: 20, - maxAsyncRequests: 20, - minSize: 1024 * 5, - })(config); + // if (process.env.NODE_ENV === "production") { + // setWebpackOptimizationSplitChunks({ + // chunks: "all", + // maxInitialRequests: 20, + // maxAsyncRequests: 20, + // minSize: 1024 * 5, + // })(config); + // } // add i18n dir to ModuleScopePlugin allowedPaths const moduleScopePlugin = config.resolve.plugins.find(_ => _.constructor.name === "ModuleScopePlugin"); diff --git a/ui/package.json b/ui/package.json index 57c2e634..ca16757b 100644 --- a/ui/package.json +++ b/ui/package.json @@ -82,7 +82,7 @@ "react-app-rewired": "^2.2.1", "react-scripts": "5.0.1", "sass": "^1.54.4", - "typescript": "^4.9.5", + "typescript": "4.8.3", "yaml-loader": "^0.8.0" }, "packageManager": "pnpm@7.9.5", diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml index 743e1f6e..0232dbca 100644 --- a/ui/pnpm-lock.yaml +++ b/ui/pnpm-lock.yaml @@ -66,7 +66,7 @@ specifiers: sass: ^1.54.4 semver: ^7.3.8 swr: ^1.3.0 - typescript: ^4.9.5 + typescript: 4.8.3 urlcat: ^3.0.0 yaml-loader: ^0.8.0 zustand: ^4.1.1 @@ -118,14 +118,14 @@ devDependencies: '@types/qs': 6.9.7 '@types/react': 18.0.20 '@types/react-dom': 18.0.6 - '@typescript-eslint/eslint-plugin': 5.38.0_j3kyhwzdxzxnwkyezapk4ib6dm - '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/eslint-plugin': 5.38.0_wsb62dxj2oqwgas4kadjymcmry + '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha customize-cra: 1.0.0 eslint: 8.23.1 eslint-config-airbnb: 19.0.4_4zstfqq5uopk5xuvotejlnl36y eslint-config-airbnb-typescript: 17.0.0_j57hrpt2hfp47otngkwtnuyxpa eslint-config-prettier: 8.5.0_eslint@8.23.1 - eslint-config-standard-with-typescript: 22.0.0_rgg5nvqzvmbqsu6p3s4ukwchpy + eslint-config-standard-with-typescript: 22.0.0_fsqc7gnfr7ufpr4slszrtm5abq eslint-plugin-import: 2.26.0_cxqatnnjiq7ozd2bkspxnuicdq eslint-plugin-jsx-a11y: 6.6.1_eslint@8.23.1 eslint-plugin-n: 15.2.5_eslint@8.23.1 @@ -139,9 +139,9 @@ devDependencies: prettier: 2.7.1 purgecss-webpack-plugin: 4.1.3_webpack@5.77.0 react-app-rewired: 2.2.1_react-scripts@5.0.1 - react-scripts: 5.0.1_z72bcl2gkg6v3fmxqtnfgirxda + react-scripts: 5.0.1_ap4oovoha3qweuydbugjyq3qqy sass: 1.54.9 - typescript: 4.9.5 + typescript: 4.8.3 yaml-loader: 0.8.0 packages: @@ -1682,7 +1682,7 @@ packages: cosmiconfig-typescript-loader: 4.1.0_2uclxasecupgvdn72amnhmyg7y lodash: 4.17.21 resolve-from: 5.0.0 - ts-node: 10.9.1_5bkdw6noa5sa7givrguqy7ejvm + ts-node: 10.9.1_ao52im6kiihokc7tdj7weudhra typescript: 4.9.5 transitivePeerDependencies: - '@swc/core' @@ -2077,7 +2077,7 @@ packages: collect-v8-coverage: 1.0.1 exit: 0.1.2 glob: 7.2.3 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 istanbul-lib-coverage: 3.2.0 istanbul-lib-instrument: 5.2.0 istanbul-lib-report: 3.0.0 @@ -2106,7 +2106,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: callsites: 3.1.0 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 source-map: 0.6.1 /@jest/test-result/27.5.1: @@ -2132,7 +2132,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/test-result': 27.5.1 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 jest-haste-map: 27.5.1 jest-runtime: 27.5.1 transitivePeerDependencies: @@ -2851,7 +2851,7 @@ packages: dependencies: '@types/yargs-parser': 21.0.0 - /@typescript-eslint/eslint-plugin/5.38.0_j3kyhwzdxzxnwkyezapk4ib6dm: + /@typescript-eslint/eslint-plugin/5.38.0_wsb62dxj2oqwgas4kadjymcmry: resolution: {integrity: sha512-GgHi/GNuUbTOeoJiEANi0oI6fF3gBQc3bGFYj40nnAPCbhrtEDf2rjBmefFadweBmO1Du1YovHeDP2h5JLhtTQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2862,33 +2862,33 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha '@typescript-eslint/scope-manager': 5.38.0 - '@typescript-eslint/type-utils': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy - '@typescript-eslint/utils': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/type-utils': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/utils': 5.38.0_irgkl5vooow2ydyo6aokmferha debug: 4.3.4 eslint: 8.23.1 ignore: 5.2.0 regexpp: 3.2.0 semver: 7.3.8 - tsutils: 3.21.0_typescript@4.9.5 - typescript: 4.9.5 + tsutils: 3.21.0_typescript@4.8.3 + typescript: 4.8.3 transitivePeerDependencies: - supports-color - /@typescript-eslint/experimental-utils/5.38.0_4dcepvmun56gjdctx7q2wwbdvy: + /@typescript-eslint/experimental-utils/5.38.0_irgkl5vooow2ydyo6aokmferha: resolution: {integrity: sha512-kzXBRfvGlicgGk4CYuRUqKvwc2s3wHXNssUWWJU18bhMRxriFm3BZWyQ6vEHBRpEIMKB6b7MIQHO+9lYlts19w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@typescript-eslint/utils': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/utils': 5.38.0_irgkl5vooow2ydyo6aokmferha eslint: 8.23.1 transitivePeerDependencies: - supports-color - typescript - /@typescript-eslint/parser/5.38.0_4dcepvmun56gjdctx7q2wwbdvy: + /@typescript-eslint/parser/5.38.0_irgkl5vooow2ydyo6aokmferha: resolution: {integrity: sha512-/F63giJGLDr0ms1Cr8utDAxP2SPiglaD6V+pCOcG35P2jCqdfR7uuEhz1GIC3oy4hkUF8xA1XSXmd9hOh/a5EA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2900,10 +2900,10 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.38.0 '@typescript-eslint/types': 5.38.0 - '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.9.5 + '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.8.3 debug: 4.3.4 eslint: 8.23.1 - typescript: 4.9.5 + typescript: 4.8.3 transitivePeerDependencies: - supports-color @@ -2914,7 +2914,7 @@ packages: '@typescript-eslint/types': 5.38.0 '@typescript-eslint/visitor-keys': 5.38.0 - /@typescript-eslint/type-utils/5.38.0_4dcepvmun56gjdctx7q2wwbdvy: + /@typescript-eslint/type-utils/5.38.0_irgkl5vooow2ydyo6aokmferha: resolution: {integrity: sha512-iZq5USgybUcj/lfnbuelJ0j3K9dbs1I3RICAJY9NZZpDgBYXmuUlYQGzftpQA9wC8cKgtS6DASTvF3HrXwwozA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2924,12 +2924,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.9.5 - '@typescript-eslint/utils': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.8.3 + '@typescript-eslint/utils': 5.38.0_irgkl5vooow2ydyo6aokmferha debug: 4.3.4 eslint: 8.23.1 - tsutils: 3.21.0_typescript@4.9.5 - typescript: 4.9.5 + tsutils: 3.21.0_typescript@4.8.3 + typescript: 4.8.3 transitivePeerDependencies: - supports-color @@ -2937,7 +2937,7 @@ packages: resolution: {integrity: sha512-HHu4yMjJ7i3Cb+8NUuRCdOGu2VMkfmKyIJsOr9PfkBVYLYrtMCK/Ap50Rpov+iKpxDTfnqvDbuPLgBE5FwUNfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - /@typescript-eslint/typescript-estree/5.38.0_typescript@4.9.5: + /@typescript-eslint/typescript-estree/5.38.0_typescript@4.8.3: resolution: {integrity: sha512-6P0RuphkR+UuV7Avv7MU3hFoWaGcrgOdi8eTe1NwhMp2/GjUJoODBTRWzlHpZh6lFOaPmSvgxGlROa0Sg5Zbyg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2952,12 +2952,12 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.8 - tsutils: 3.21.0_typescript@4.9.5 - typescript: 4.9.5 + tsutils: 3.21.0_typescript@4.8.3 + typescript: 4.8.3 transitivePeerDependencies: - supports-color - /@typescript-eslint/utils/5.38.0_4dcepvmun56gjdctx7q2wwbdvy: + /@typescript-eslint/utils/5.38.0_irgkl5vooow2ydyo6aokmferha: resolution: {integrity: sha512-6sdeYaBgk9Fh7N2unEXGz+D+som2QCQGPAf1SxrkEr+Z32gMreQ0rparXTNGRRfYUWk/JzbGdcM8NSSd6oqnTA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2966,7 +2966,7 @@ packages: '@types/json-schema': 7.0.11 '@typescript-eslint/scope-manager': 5.38.0 '@typescript-eslint/types': 5.38.0 - '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.9.5 + '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.8.3 eslint: 8.23.1 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@8.23.1 @@ -4078,7 +4078,7 @@ packages: dependencies: '@types/node': 14.18.29 cosmiconfig: 7.0.1 - ts-node: 10.9.1_5bkdw6noa5sa7givrguqy7ejvm + ts-node: 10.9.1_ao52im6kiihokc7tdj7weudhra typescript: 4.9.5 dev: true @@ -5129,7 +5129,7 @@ packages: resolution: {integrity: sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ==} engines: {node: '>=10.13.0'} dependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 tapable: 2.2.1 /enhanced-resolve/5.12.0: @@ -5251,8 +5251,8 @@ packages: eslint: ^7.32.0 || ^8.2.0 eslint-plugin-import: ^2.25.3 dependencies: - '@typescript-eslint/eslint-plugin': 5.38.0_j3kyhwzdxzxnwkyezapk4ib6dm - '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/eslint-plugin': 5.38.0_wsb62dxj2oqwgas4kadjymcmry + '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha eslint: 8.23.1 eslint-config-airbnb-base: 15.0.0_hdzsmr7kawaomymueo2tso6fjq eslint-plugin-import: 2.26.0_cxqatnnjiq7ozd2bkspxnuicdq @@ -5287,7 +5287,7 @@ packages: eslint: 8.23.1 dev: true - /eslint-config-react-app/7.0.1_3wjbtgciw64wc2xmhxyprqr3jm: + /eslint-config-react-app/7.0.1_e6xprixfjaakveus7rps5k34ce: resolution: {integrity: sha512-K6rNzvkIeHaTd8m/QEh1Zko0KI7BACWkkneSs6s9cKZC/J27X3eZR6Upt1jkmZ/4FK+XUOPPxMEN7+lbUXfSlA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -5300,19 +5300,19 @@ packages: '@babel/core': 7.19.1 '@babel/eslint-parser': 7.19.1_zdglor7vg7osicr5spasq6cc5a '@rushstack/eslint-patch': 1.2.0 - '@typescript-eslint/eslint-plugin': 5.38.0_j3kyhwzdxzxnwkyezapk4ib6dm - '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/eslint-plugin': 5.38.0_wsb62dxj2oqwgas4kadjymcmry + '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha babel-preset-react-app: 10.0.1 confusing-browser-globals: 1.0.11 eslint: 8.23.1 eslint-plugin-flowtype: 8.0.3_is75u4gug36f5e4hn2ov7dma7i eslint-plugin-import: 2.26.0_cxqatnnjiq7ozd2bkspxnuicdq - eslint-plugin-jest: 25.7.0_ysljusnkykxn4g7zog7cbtn2c4 + eslint-plugin-jest: 25.7.0_hpujes4m5fznz335nz2hgbshme eslint-plugin-jsx-a11y: 6.6.1_eslint@8.23.1 eslint-plugin-react: 7.31.8_eslint@8.23.1 eslint-plugin-react-hooks: 4.6.0_eslint@8.23.1 - eslint-plugin-testing-library: 5.6.4_4dcepvmun56gjdctx7q2wwbdvy - typescript: 4.9.5 + eslint-plugin-testing-library: 5.6.4_irgkl5vooow2ydyo6aokmferha + typescript: 4.8.3 transitivePeerDependencies: - '@babel/plugin-syntax-flow' - '@babel/plugin-transform-react-jsx' @@ -5321,7 +5321,7 @@ packages: - jest - supports-color - /eslint-config-standard-with-typescript/22.0.0_rgg5nvqzvmbqsu6p3s4ukwchpy: + /eslint-config-standard-with-typescript/22.0.0_fsqc7gnfr7ufpr4slszrtm5abq: resolution: {integrity: sha512-VA36U7UlFpwULvkdnh6MQj5GAV2Q+tT68ALLAwJP0ZuNXU2m0wX07uxX4qyLRdHgSzH4QJ73CveKBuSOYvh7vQ==} peerDependencies: '@typescript-eslint/eslint-plugin': ^5.0.0 @@ -5331,14 +5331,14 @@ packages: eslint-plugin-promise: ^6.0.0 typescript: '*' dependencies: - '@typescript-eslint/eslint-plugin': 5.38.0_j3kyhwzdxzxnwkyezapk4ib6dm - '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/eslint-plugin': 5.38.0_wsb62dxj2oqwgas4kadjymcmry + '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha eslint: 8.23.1 eslint-config-standard: 17.0.0_4nulviyjkaspo7v2xlghuwxbf4 eslint-plugin-import: 2.26.0_cxqatnnjiq7ozd2bkspxnuicdq eslint-plugin-n: 15.2.5_eslint@8.23.1 eslint-plugin-promise: 6.0.1_eslint@8.23.1 - typescript: 4.9.5 + typescript: 4.8.3 transitivePeerDependencies: - supports-color dev: true @@ -5386,7 +5386,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha debug: 3.2.7 eslint: 8.23.1 eslint-import-resolver-node: 0.3.6 @@ -5428,7 +5428,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha array-includes: 3.1.5 array.prototype.flat: 1.3.0 debug: 2.6.9 @@ -5448,7 +5448,7 @@ packages: - eslint-import-resolver-webpack - supports-color - /eslint-plugin-jest/25.7.0_ysljusnkykxn4g7zog7cbtn2c4: + /eslint-plugin-jest/25.7.0_hpujes4m5fznz335nz2hgbshme: resolution: {integrity: sha512-PWLUEXeeF7C9QGKqvdSbzLOiLTx+bno7/HC9eefePfEb257QFHg7ye3dh80AZVkaa/RQsBB1Q/ORQvg2X7F0NQ==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} peerDependencies: @@ -5461,8 +5461,8 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.38.0_j3kyhwzdxzxnwkyezapk4ib6dm - '@typescript-eslint/experimental-utils': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/eslint-plugin': 5.38.0_wsb62dxj2oqwgas4kadjymcmry + '@typescript-eslint/experimental-utils': 5.38.0_irgkl5vooow2ydyo6aokmferha eslint: 8.23.1 jest: 27.5.1_ts-node@10.9.1 transitivePeerDependencies: @@ -5563,13 +5563,13 @@ packages: semver: 6.3.0 string.prototype.matchall: 4.0.7 - /eslint-plugin-testing-library/5.6.4_4dcepvmun56gjdctx7q2wwbdvy: + /eslint-plugin-testing-library/5.6.4_irgkl5vooow2ydyo6aokmferha: resolution: {integrity: sha512-0oW3tC5NNT2WexmJ3848a/utawOymw4ibl3/NkwywndVAz2hT9+ab70imA7ccg3RaScQgMvJT60OL00hpmJvrg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6'} peerDependencies: eslint: ^7.5.0 || ^8.0.0 dependencies: - '@typescript-eslint/utils': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/utils': 5.38.0_irgkl5vooow2ydyo6aokmferha eslint: 8.23.1 transitivePeerDependencies: - supports-color @@ -5942,7 +5942,7 @@ packages: debug: optional: true - /fork-ts-checker-webpack-plugin/6.5.2_h33pxmj7ihkiaxhnzwyj3mdwbi: + /fork-ts-checker-webpack-plugin/6.5.2_npfwkgbcmgrbevrxnqgustqabe: resolution: {integrity: sha512-m5cUmF30xkZ7h4tWUgTAcEaKmUW7tfyUyTqNNOz7OxWJ0v1VWKTcOvH8FWHUwSjlW/356Ijc9vi3XfcPstpQKA==} engines: {node: '>=10', yarn: '>=1.0.0'} peerDependencies: @@ -5970,7 +5970,7 @@ packages: schema-utils: 2.7.0 semver: 7.3.8 tapable: 1.1.3 - typescript: 4.9.5 + typescript: 4.8.3 webpack: 5.74.0 /form-data/3.0.1: @@ -6014,7 +6014,7 @@ packages: engines: {node: '>=10'} dependencies: at-least-node: 1.0.0 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 jsonfile: 6.1.0 universalify: 2.0.0 @@ -6163,7 +6163,6 @@ packages: /graceful-fs/4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - dev: true /grapheme-splitter/1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} @@ -6805,7 +6804,7 @@ packages: ci-info: 3.4.0 deepmerge: 4.2.2 glob: 7.2.3 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 jest-circus: 27.5.1 jest-environment-jsdom: 27.5.1 jest-environment-node: 27.5.1 @@ -6821,7 +6820,7 @@ packages: pretty-format: 27.5.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_5bkdw6noa5sa7givrguqy7ejvm + ts-node: 10.9.1_ao52im6kiihokc7tdj7weudhra transitivePeerDependencies: - bufferutil - canvas @@ -6977,7 +6976,7 @@ packages: '@jest/types': 27.5.1 '@types/stack-utils': 2.0.1 chalk: 4.1.2 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 micromatch: 4.0.5 pretty-format: 27.5.1 slash: 3.0.0 @@ -6991,7 +6990,7 @@ packages: '@jest/types': 28.1.3 '@types/stack-utils': 2.0.1 chalk: 4.1.2 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 micromatch: 4.0.5 pretty-format: 28.1.3 slash: 3.0.0 @@ -7060,7 +7059,7 @@ packages: '@types/node': 16.11.59 chalk: 4.1.2 emittery: 0.8.1 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 jest-docblock: 27.5.1 jest-environment-jsdom: 27.5.1 jest-environment-node: 27.5.1 @@ -7095,7 +7094,7 @@ packages: collect-v8-coverage: 1.0.1 execa: 5.1.1 glob: 7.2.3 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 jest-haste-map: 27.5.1 jest-message-util: 27.5.1 jest-mock: 27.5.1 @@ -7113,7 +7112,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@types/node': 16.11.59 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 /jest-snapshot/27.5.1: resolution: {integrity: sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA==} @@ -7131,7 +7130,7 @@ packages: babel-preset-current-node-syntax: 1.0.1_@babel+core@7.19.1 chalk: 4.1.2 expect: 27.5.1 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 jest-diff: 27.5.1 jest-get-type: 27.5.1 jest-haste-map: 27.5.1 @@ -7163,7 +7162,7 @@ packages: '@types/node': 16.11.59 chalk: 4.1.2 ci-info: 3.4.0 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 picomatch: 2.3.1 /jest-validate/27.5.1: @@ -7366,7 +7365,7 @@ packages: dependencies: universalify: 2.0.0 optionalDependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 /jsonp/0.2.1: resolution: {integrity: sha512-pfog5gdDxPdV4eP7Kg87M8/bHgshlZ5pybl+yKxAnCZ5O7lCIn7Ixydj03wOlnDQesky2BPyA91SQ+5Y/mNwzw==} @@ -7821,7 +7820,7 @@ packages: jsonp: 0.2.1 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 - react-scripts: 5.0.1_z72bcl2gkg6v3fmxqtnfgirxda + react-scripts: 5.0.1_ap4oovoha3qweuydbugjyq3qqy transitivePeerDependencies: - supports-color dev: false @@ -8451,7 +8450,7 @@ packages: dependencies: lilconfig: 2.0.6 postcss: 8.4.16 - ts-node: 10.9.1_5bkdw6noa5sa7givrguqy7ejvm + ts-node: 10.9.1_ao52im6kiihokc7tdj7weudhra yaml: 1.10.2 /postcss-loader/6.2.1_qjv4cptcpse3y5hrjkrbb7drda: @@ -9076,7 +9075,7 @@ packages: peerDependencies: react-scripts: '>=2.1.3' dependencies: - react-scripts: 5.0.1_z72bcl2gkg6v3fmxqtnfgirxda + react-scripts: 5.0.1_ap4oovoha3qweuydbugjyq3qqy semver: 5.7.1 dev: true @@ -9107,7 +9106,7 @@ packages: warning: 4.0.3 dev: false - /react-dev-utils/12.0.1_h33pxmj7ihkiaxhnzwyj3mdwbi: + /react-dev-utils/12.0.1_npfwkgbcmgrbevrxnqgustqabe: resolution: {integrity: sha512-84Ivxmr17KjUupyqzFode6xKhjwuEJDROWKJy/BthkL7Wn6NJ8h4WE6k/exAv6ImS+0oZLRRW5j/aINMHyeGeQ==} engines: {node: '>=14'} peerDependencies: @@ -9126,7 +9125,7 @@ packages: escape-string-regexp: 4.0.0 filesize: 8.0.7 find-up: 5.0.0 - fork-ts-checker-webpack-plugin: 6.5.2_h33pxmj7ihkiaxhnzwyj3mdwbi + fork-ts-checker-webpack-plugin: 6.5.2_npfwkgbcmgrbevrxnqgustqabe global-modules: 2.0.0 globby: 11.1.0 gzip-size: 6.0.0 @@ -9141,7 +9140,7 @@ packages: shell-quote: 1.7.3 strip-ansi: 6.0.1 text-table: 0.2.0 - typescript: 4.9.5 + typescript: 4.8.3 webpack: 5.74.0 transitivePeerDependencies: - eslint @@ -9239,7 +9238,7 @@ packages: react: 18.2.0 dev: false - /react-scripts/5.0.1_z72bcl2gkg6v3fmxqtnfgirxda: + /react-scripts/5.0.1_ap4oovoha3qweuydbugjyq3qqy: resolution: {integrity: sha512-8VAmEm/ZAwQzJ+GOMLbBsTdDKOpuZh7RPs0UymvBR2vRk4iZWCskjbFnxqjrzoIvlNNRZ3QJFx6/qDSi6zSnaQ==} engines: {node: '>=14.0.0'} hasBin: true @@ -9267,7 +9266,7 @@ packages: dotenv: 10.0.0 dotenv-expand: 5.1.0 eslint: 8.23.1 - eslint-config-react-app: 7.0.1_3wjbtgciw64wc2xmhxyprqr3jm + eslint-config-react-app: 7.0.1_e6xprixfjaakveus7rps5k34ce eslint-webpack-plugin: 3.2.0_cnsurwdbw57xgwxuf5k544xt5e file-loader: 6.2.0_webpack@5.74.0 fs-extra: 10.1.0 @@ -9285,7 +9284,7 @@ packages: prompts: 2.4.2 react: 18.2.0 react-app-polyfill: 3.0.0 - react-dev-utils: 12.0.1_h33pxmj7ihkiaxhnzwyj3mdwbi + react-dev-utils: 12.0.1_npfwkgbcmgrbevrxnqgustqabe react-refresh: 0.11.0 resolve: 1.22.1 resolve-url-loader: 4.0.0 @@ -9295,7 +9294,7 @@ packages: style-loader: 3.3.1_webpack@5.74.0 tailwindcss: 3.1.8_57znarxsqwmnneadci5z5fd5gu terser-webpack-plugin: 5.3.6_webpack@5.74.0 - typescript: 4.9.5 + typescript: 4.8.3 webpack: 5.74.0 webpack-dev-server: 4.11.1_webpack@5.74.0 webpack-manifest-plugin: 4.1.1_webpack@5.74.0 @@ -10457,7 +10456,7 @@ packages: /tryer/1.0.1: resolution: {integrity: sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==} - /ts-node/10.9.1_5bkdw6noa5sa7givrguqy7ejvm: + /ts-node/10.9.1_ao52im6kiihokc7tdj7weudhra: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -10483,7 +10482,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.9.5 + typescript: 4.8.3 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 @@ -10501,14 +10500,14 @@ packages: /tslib/2.4.0: resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} - /tsutils/3.21.0_typescript@4.9.5: + /tsutils/3.21.0_typescript@4.8.3: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 4.9.5 + typescript: 4.8.3 /type-check/0.3.2: resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==} @@ -10565,10 +10564,16 @@ packages: dependencies: is-typedarray: 1.0.0 + /typescript/4.8.3: + resolution: {integrity: sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig==} + engines: {node: '>=4.2.0'} + hasBin: true + /typescript/4.9.5: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} hasBin: true + dev: true /unbox-primitive/1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} @@ -10760,7 +10765,7 @@ packages: engines: {node: '>=10.13.0'} dependencies: glob-to-regexp: 0.4.1 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 /wbuf/1.7.3: resolution: {integrity: sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==} From 6eca3848d80140da4301712a65bc595cb902be91 Mon Sep 17 00:00:00 2001 From: shuai Date: Tue, 18 Apr 2023 18:03:36 +0800 Subject: [PATCH 16/18] fix: remove unused code --- ui/config-overrides.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ui/config-overrides.js b/ui/config-overrides.js index 442469e6..a82d9822 100644 --- a/ui/config-overrides.js +++ b/ui/config-overrides.js @@ -1,7 +1,6 @@ const { addWebpackModuleRule, addWebpackAlias, - // setWebpackOptimizationSplitChunks, } = require("customize-cra"); const path = require("path"); @@ -19,15 +18,6 @@ module.exports = { use: "yaml-loader" })(config); - // if (process.env.NODE_ENV === "production") { - // setWebpackOptimizationSplitChunks({ - // chunks: "all", - // maxInitialRequests: 20, - // maxAsyncRequests: 20, - // minSize: 1024 * 5, - // })(config); - // } - // add i18n dir to ModuleScopePlugin allowedPaths const moduleScopePlugin = config.resolve.plugins.find(_ => _.constructor.name === "ModuleScopePlugin"); if (moduleScopePlugin) { From 2ce1c8852801d8e6596fe9956de8b6b96f3ae150 Mon Sep 17 00:00:00 2001 From: shuai Date: Tue, 18 Apr 2023 18:17:59 +0800 Subject: [PATCH 17/18] fix: typescript use v4.8.3 --- ui/package.json | 2 +- ui/pnpm-lock.yaml | 136 ++++++++++++++++++++++------------------------ 2 files changed, 66 insertions(+), 72 deletions(-) diff --git a/ui/package.json b/ui/package.json index ca16757b..772d2f14 100644 --- a/ui/package.json +++ b/ui/package.json @@ -82,7 +82,7 @@ "react-app-rewired": "^2.2.1", "react-scripts": "5.0.1", "sass": "^1.54.4", - "typescript": "4.8.3", + "typescript": "^4.8.3", "yaml-loader": "^0.8.0" }, "packageManager": "pnpm@7.9.5", diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml index 0232dbca..416bf92d 100644 --- a/ui/pnpm-lock.yaml +++ b/ui/pnpm-lock.yaml @@ -66,7 +66,7 @@ specifiers: sass: ^1.54.4 semver: ^7.3.8 swr: ^1.3.0 - typescript: 4.8.3 + typescript: ^4.8.3 urlcat: ^3.0.0 yaml-loader: ^0.8.0 zustand: ^4.1.1 @@ -118,14 +118,14 @@ devDependencies: '@types/qs': 6.9.7 '@types/react': 18.0.20 '@types/react-dom': 18.0.6 - '@typescript-eslint/eslint-plugin': 5.38.0_wsb62dxj2oqwgas4kadjymcmry - '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/eslint-plugin': 5.38.0_j3kyhwzdxzxnwkyezapk4ib6dm + '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy customize-cra: 1.0.0 eslint: 8.23.1 eslint-config-airbnb: 19.0.4_4zstfqq5uopk5xuvotejlnl36y eslint-config-airbnb-typescript: 17.0.0_j57hrpt2hfp47otngkwtnuyxpa eslint-config-prettier: 8.5.0_eslint@8.23.1 - eslint-config-standard-with-typescript: 22.0.0_fsqc7gnfr7ufpr4slszrtm5abq + eslint-config-standard-with-typescript: 22.0.0_rgg5nvqzvmbqsu6p3s4ukwchpy eslint-plugin-import: 2.26.0_cxqatnnjiq7ozd2bkspxnuicdq eslint-plugin-jsx-a11y: 6.6.1_eslint@8.23.1 eslint-plugin-n: 15.2.5_eslint@8.23.1 @@ -139,9 +139,9 @@ devDependencies: prettier: 2.7.1 purgecss-webpack-plugin: 4.1.3_webpack@5.77.0 react-app-rewired: 2.2.1_react-scripts@5.0.1 - react-scripts: 5.0.1_ap4oovoha3qweuydbugjyq3qqy + react-scripts: 5.0.1_z72bcl2gkg6v3fmxqtnfgirxda sass: 1.54.9 - typescript: 4.8.3 + typescript: 4.9.5 yaml-loader: 0.8.0 packages: @@ -1682,7 +1682,7 @@ packages: cosmiconfig-typescript-loader: 4.1.0_2uclxasecupgvdn72amnhmyg7y lodash: 4.17.21 resolve-from: 5.0.0 - ts-node: 10.9.1_ao52im6kiihokc7tdj7weudhra + ts-node: 10.9.1_5bkdw6noa5sa7givrguqy7ejvm typescript: 4.9.5 transitivePeerDependencies: - '@swc/core' @@ -2851,7 +2851,7 @@ packages: dependencies: '@types/yargs-parser': 21.0.0 - /@typescript-eslint/eslint-plugin/5.38.0_wsb62dxj2oqwgas4kadjymcmry: + /@typescript-eslint/eslint-plugin/5.38.0_j3kyhwzdxzxnwkyezapk4ib6dm: resolution: {integrity: sha512-GgHi/GNuUbTOeoJiEANi0oI6fF3gBQc3bGFYj40nnAPCbhrtEDf2rjBmefFadweBmO1Du1YovHeDP2h5JLhtTQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2862,33 +2862,33 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy '@typescript-eslint/scope-manager': 5.38.0 - '@typescript-eslint/type-utils': 5.38.0_irgkl5vooow2ydyo6aokmferha - '@typescript-eslint/utils': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/type-utils': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy + '@typescript-eslint/utils': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy debug: 4.3.4 eslint: 8.23.1 ignore: 5.2.0 regexpp: 3.2.0 semver: 7.3.8 - tsutils: 3.21.0_typescript@4.8.3 - typescript: 4.8.3 + tsutils: 3.21.0_typescript@4.9.5 + typescript: 4.9.5 transitivePeerDependencies: - supports-color - /@typescript-eslint/experimental-utils/5.38.0_irgkl5vooow2ydyo6aokmferha: + /@typescript-eslint/experimental-utils/5.38.0_4dcepvmun56gjdctx7q2wwbdvy: resolution: {integrity: sha512-kzXBRfvGlicgGk4CYuRUqKvwc2s3wHXNssUWWJU18bhMRxriFm3BZWyQ6vEHBRpEIMKB6b7MIQHO+9lYlts19w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@typescript-eslint/utils': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/utils': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy eslint: 8.23.1 transitivePeerDependencies: - supports-color - typescript - /@typescript-eslint/parser/5.38.0_irgkl5vooow2ydyo6aokmferha: + /@typescript-eslint/parser/5.38.0_4dcepvmun56gjdctx7q2wwbdvy: resolution: {integrity: sha512-/F63giJGLDr0ms1Cr8utDAxP2SPiglaD6V+pCOcG35P2jCqdfR7uuEhz1GIC3oy4hkUF8xA1XSXmd9hOh/a5EA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2900,10 +2900,10 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.38.0 '@typescript-eslint/types': 5.38.0 - '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.8.3 + '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.9.5 debug: 4.3.4 eslint: 8.23.1 - typescript: 4.8.3 + typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -2914,7 +2914,7 @@ packages: '@typescript-eslint/types': 5.38.0 '@typescript-eslint/visitor-keys': 5.38.0 - /@typescript-eslint/type-utils/5.38.0_irgkl5vooow2ydyo6aokmferha: + /@typescript-eslint/type-utils/5.38.0_4dcepvmun56gjdctx7q2wwbdvy: resolution: {integrity: sha512-iZq5USgybUcj/lfnbuelJ0j3K9dbs1I3RICAJY9NZZpDgBYXmuUlYQGzftpQA9wC8cKgtS6DASTvF3HrXwwozA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2924,12 +2924,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.8.3 - '@typescript-eslint/utils': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.9.5 + '@typescript-eslint/utils': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy debug: 4.3.4 eslint: 8.23.1 - tsutils: 3.21.0_typescript@4.8.3 - typescript: 4.8.3 + tsutils: 3.21.0_typescript@4.9.5 + typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -2937,7 +2937,7 @@ packages: resolution: {integrity: sha512-HHu4yMjJ7i3Cb+8NUuRCdOGu2VMkfmKyIJsOr9PfkBVYLYrtMCK/Ap50Rpov+iKpxDTfnqvDbuPLgBE5FwUNfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - /@typescript-eslint/typescript-estree/5.38.0_typescript@4.8.3: + /@typescript-eslint/typescript-estree/5.38.0_typescript@4.9.5: resolution: {integrity: sha512-6P0RuphkR+UuV7Avv7MU3hFoWaGcrgOdi8eTe1NwhMp2/GjUJoODBTRWzlHpZh6lFOaPmSvgxGlROa0Sg5Zbyg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2952,12 +2952,12 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.8 - tsutils: 3.21.0_typescript@4.8.3 - typescript: 4.8.3 + tsutils: 3.21.0_typescript@4.9.5 + typescript: 4.9.5 transitivePeerDependencies: - supports-color - /@typescript-eslint/utils/5.38.0_irgkl5vooow2ydyo6aokmferha: + /@typescript-eslint/utils/5.38.0_4dcepvmun56gjdctx7q2wwbdvy: resolution: {integrity: sha512-6sdeYaBgk9Fh7N2unEXGz+D+som2QCQGPAf1SxrkEr+Z32gMreQ0rparXTNGRRfYUWk/JzbGdcM8NSSd6oqnTA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2966,7 +2966,7 @@ packages: '@types/json-schema': 7.0.11 '@typescript-eslint/scope-manager': 5.38.0 '@typescript-eslint/types': 5.38.0 - '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.8.3 + '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.9.5 eslint: 8.23.1 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@8.23.1 @@ -4078,7 +4078,7 @@ packages: dependencies: '@types/node': 14.18.29 cosmiconfig: 7.0.1 - ts-node: 10.9.1_ao52im6kiihokc7tdj7weudhra + ts-node: 10.9.1_5bkdw6noa5sa7givrguqy7ejvm typescript: 4.9.5 dev: true @@ -5251,8 +5251,8 @@ packages: eslint: ^7.32.0 || ^8.2.0 eslint-plugin-import: ^2.25.3 dependencies: - '@typescript-eslint/eslint-plugin': 5.38.0_wsb62dxj2oqwgas4kadjymcmry - '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/eslint-plugin': 5.38.0_j3kyhwzdxzxnwkyezapk4ib6dm + '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy eslint: 8.23.1 eslint-config-airbnb-base: 15.0.0_hdzsmr7kawaomymueo2tso6fjq eslint-plugin-import: 2.26.0_cxqatnnjiq7ozd2bkspxnuicdq @@ -5287,7 +5287,7 @@ packages: eslint: 8.23.1 dev: true - /eslint-config-react-app/7.0.1_e6xprixfjaakveus7rps5k34ce: + /eslint-config-react-app/7.0.1_3wjbtgciw64wc2xmhxyprqr3jm: resolution: {integrity: sha512-K6rNzvkIeHaTd8m/QEh1Zko0KI7BACWkkneSs6s9cKZC/J27X3eZR6Upt1jkmZ/4FK+XUOPPxMEN7+lbUXfSlA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -5300,19 +5300,19 @@ packages: '@babel/core': 7.19.1 '@babel/eslint-parser': 7.19.1_zdglor7vg7osicr5spasq6cc5a '@rushstack/eslint-patch': 1.2.0 - '@typescript-eslint/eslint-plugin': 5.38.0_wsb62dxj2oqwgas4kadjymcmry - '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/eslint-plugin': 5.38.0_j3kyhwzdxzxnwkyezapk4ib6dm + '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy babel-preset-react-app: 10.0.1 confusing-browser-globals: 1.0.11 eslint: 8.23.1 eslint-plugin-flowtype: 8.0.3_is75u4gug36f5e4hn2ov7dma7i eslint-plugin-import: 2.26.0_cxqatnnjiq7ozd2bkspxnuicdq - eslint-plugin-jest: 25.7.0_hpujes4m5fznz335nz2hgbshme + eslint-plugin-jest: 25.7.0_ysljusnkykxn4g7zog7cbtn2c4 eslint-plugin-jsx-a11y: 6.6.1_eslint@8.23.1 eslint-plugin-react: 7.31.8_eslint@8.23.1 eslint-plugin-react-hooks: 4.6.0_eslint@8.23.1 - eslint-plugin-testing-library: 5.6.4_irgkl5vooow2ydyo6aokmferha - typescript: 4.8.3 + eslint-plugin-testing-library: 5.6.4_4dcepvmun56gjdctx7q2wwbdvy + typescript: 4.9.5 transitivePeerDependencies: - '@babel/plugin-syntax-flow' - '@babel/plugin-transform-react-jsx' @@ -5321,7 +5321,7 @@ packages: - jest - supports-color - /eslint-config-standard-with-typescript/22.0.0_fsqc7gnfr7ufpr4slszrtm5abq: + /eslint-config-standard-with-typescript/22.0.0_rgg5nvqzvmbqsu6p3s4ukwchpy: resolution: {integrity: sha512-VA36U7UlFpwULvkdnh6MQj5GAV2Q+tT68ALLAwJP0ZuNXU2m0wX07uxX4qyLRdHgSzH4QJ73CveKBuSOYvh7vQ==} peerDependencies: '@typescript-eslint/eslint-plugin': ^5.0.0 @@ -5331,14 +5331,14 @@ packages: eslint-plugin-promise: ^6.0.0 typescript: '*' dependencies: - '@typescript-eslint/eslint-plugin': 5.38.0_wsb62dxj2oqwgas4kadjymcmry - '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/eslint-plugin': 5.38.0_j3kyhwzdxzxnwkyezapk4ib6dm + '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy eslint: 8.23.1 eslint-config-standard: 17.0.0_4nulviyjkaspo7v2xlghuwxbf4 eslint-plugin-import: 2.26.0_cxqatnnjiq7ozd2bkspxnuicdq eslint-plugin-n: 15.2.5_eslint@8.23.1 eslint-plugin-promise: 6.0.1_eslint@8.23.1 - typescript: 4.8.3 + typescript: 4.9.5 transitivePeerDependencies: - supports-color dev: true @@ -5386,7 +5386,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy debug: 3.2.7 eslint: 8.23.1 eslint-import-resolver-node: 0.3.6 @@ -5428,7 +5428,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/parser': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy array-includes: 3.1.5 array.prototype.flat: 1.3.0 debug: 2.6.9 @@ -5448,7 +5448,7 @@ packages: - eslint-import-resolver-webpack - supports-color - /eslint-plugin-jest/25.7.0_hpujes4m5fznz335nz2hgbshme: + /eslint-plugin-jest/25.7.0_ysljusnkykxn4g7zog7cbtn2c4: resolution: {integrity: sha512-PWLUEXeeF7C9QGKqvdSbzLOiLTx+bno7/HC9eefePfEb257QFHg7ye3dh80AZVkaa/RQsBB1Q/ORQvg2X7F0NQ==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} peerDependencies: @@ -5461,8 +5461,8 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.38.0_wsb62dxj2oqwgas4kadjymcmry - '@typescript-eslint/experimental-utils': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/eslint-plugin': 5.38.0_j3kyhwzdxzxnwkyezapk4ib6dm + '@typescript-eslint/experimental-utils': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy eslint: 8.23.1 jest: 27.5.1_ts-node@10.9.1 transitivePeerDependencies: @@ -5563,13 +5563,13 @@ packages: semver: 6.3.0 string.prototype.matchall: 4.0.7 - /eslint-plugin-testing-library/5.6.4_irgkl5vooow2ydyo6aokmferha: + /eslint-plugin-testing-library/5.6.4_4dcepvmun56gjdctx7q2wwbdvy: resolution: {integrity: sha512-0oW3tC5NNT2WexmJ3848a/utawOymw4ibl3/NkwywndVAz2hT9+ab70imA7ccg3RaScQgMvJT60OL00hpmJvrg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6'} peerDependencies: eslint: ^7.5.0 || ^8.0.0 dependencies: - '@typescript-eslint/utils': 5.38.0_irgkl5vooow2ydyo6aokmferha + '@typescript-eslint/utils': 5.38.0_4dcepvmun56gjdctx7q2wwbdvy eslint: 8.23.1 transitivePeerDependencies: - supports-color @@ -5942,7 +5942,7 @@ packages: debug: optional: true - /fork-ts-checker-webpack-plugin/6.5.2_npfwkgbcmgrbevrxnqgustqabe: + /fork-ts-checker-webpack-plugin/6.5.2_h33pxmj7ihkiaxhnzwyj3mdwbi: resolution: {integrity: sha512-m5cUmF30xkZ7h4tWUgTAcEaKmUW7tfyUyTqNNOz7OxWJ0v1VWKTcOvH8FWHUwSjlW/356Ijc9vi3XfcPstpQKA==} engines: {node: '>=10', yarn: '>=1.0.0'} peerDependencies: @@ -5970,7 +5970,7 @@ packages: schema-utils: 2.7.0 semver: 7.3.8 tapable: 1.1.3 - typescript: 4.8.3 + typescript: 4.9.5 webpack: 5.74.0 /form-data/3.0.1: @@ -6820,7 +6820,7 @@ packages: pretty-format: 27.5.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_ao52im6kiihokc7tdj7weudhra + ts-node: 10.9.1_5bkdw6noa5sa7givrguqy7ejvm transitivePeerDependencies: - bufferutil - canvas @@ -7820,7 +7820,7 @@ packages: jsonp: 0.2.1 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 - react-scripts: 5.0.1_ap4oovoha3qweuydbugjyq3qqy + react-scripts: 5.0.1_z72bcl2gkg6v3fmxqtnfgirxda transitivePeerDependencies: - supports-color dev: false @@ -8450,7 +8450,7 @@ packages: dependencies: lilconfig: 2.0.6 postcss: 8.4.16 - ts-node: 10.9.1_ao52im6kiihokc7tdj7weudhra + ts-node: 10.9.1_5bkdw6noa5sa7givrguqy7ejvm yaml: 1.10.2 /postcss-loader/6.2.1_qjv4cptcpse3y5hrjkrbb7drda: @@ -9075,7 +9075,7 @@ packages: peerDependencies: react-scripts: '>=2.1.3' dependencies: - react-scripts: 5.0.1_ap4oovoha3qweuydbugjyq3qqy + react-scripts: 5.0.1_z72bcl2gkg6v3fmxqtnfgirxda semver: 5.7.1 dev: true @@ -9106,7 +9106,7 @@ packages: warning: 4.0.3 dev: false - /react-dev-utils/12.0.1_npfwkgbcmgrbevrxnqgustqabe: + /react-dev-utils/12.0.1_h33pxmj7ihkiaxhnzwyj3mdwbi: resolution: {integrity: sha512-84Ivxmr17KjUupyqzFode6xKhjwuEJDROWKJy/BthkL7Wn6NJ8h4WE6k/exAv6ImS+0oZLRRW5j/aINMHyeGeQ==} engines: {node: '>=14'} peerDependencies: @@ -9125,7 +9125,7 @@ packages: escape-string-regexp: 4.0.0 filesize: 8.0.7 find-up: 5.0.0 - fork-ts-checker-webpack-plugin: 6.5.2_npfwkgbcmgrbevrxnqgustqabe + fork-ts-checker-webpack-plugin: 6.5.2_h33pxmj7ihkiaxhnzwyj3mdwbi global-modules: 2.0.0 globby: 11.1.0 gzip-size: 6.0.0 @@ -9140,7 +9140,7 @@ packages: shell-quote: 1.7.3 strip-ansi: 6.0.1 text-table: 0.2.0 - typescript: 4.8.3 + typescript: 4.9.5 webpack: 5.74.0 transitivePeerDependencies: - eslint @@ -9238,7 +9238,7 @@ packages: react: 18.2.0 dev: false - /react-scripts/5.0.1_ap4oovoha3qweuydbugjyq3qqy: + /react-scripts/5.0.1_z72bcl2gkg6v3fmxqtnfgirxda: resolution: {integrity: sha512-8VAmEm/ZAwQzJ+GOMLbBsTdDKOpuZh7RPs0UymvBR2vRk4iZWCskjbFnxqjrzoIvlNNRZ3QJFx6/qDSi6zSnaQ==} engines: {node: '>=14.0.0'} hasBin: true @@ -9266,7 +9266,7 @@ packages: dotenv: 10.0.0 dotenv-expand: 5.1.0 eslint: 8.23.1 - eslint-config-react-app: 7.0.1_e6xprixfjaakveus7rps5k34ce + eslint-config-react-app: 7.0.1_3wjbtgciw64wc2xmhxyprqr3jm eslint-webpack-plugin: 3.2.0_cnsurwdbw57xgwxuf5k544xt5e file-loader: 6.2.0_webpack@5.74.0 fs-extra: 10.1.0 @@ -9284,7 +9284,7 @@ packages: prompts: 2.4.2 react: 18.2.0 react-app-polyfill: 3.0.0 - react-dev-utils: 12.0.1_npfwkgbcmgrbevrxnqgustqabe + react-dev-utils: 12.0.1_h33pxmj7ihkiaxhnzwyj3mdwbi react-refresh: 0.11.0 resolve: 1.22.1 resolve-url-loader: 4.0.0 @@ -9294,7 +9294,7 @@ packages: style-loader: 3.3.1_webpack@5.74.0 tailwindcss: 3.1.8_57znarxsqwmnneadci5z5fd5gu terser-webpack-plugin: 5.3.6_webpack@5.74.0 - typescript: 4.8.3 + typescript: 4.9.5 webpack: 5.74.0 webpack-dev-server: 4.11.1_webpack@5.74.0 webpack-manifest-plugin: 4.1.1_webpack@5.74.0 @@ -10456,7 +10456,7 @@ packages: /tryer/1.0.1: resolution: {integrity: sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==} - /ts-node/10.9.1_ao52im6kiihokc7tdj7weudhra: + /ts-node/10.9.1_5bkdw6noa5sa7givrguqy7ejvm: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -10482,7 +10482,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.8.3 + typescript: 4.9.5 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 @@ -10500,14 +10500,14 @@ packages: /tslib/2.4.0: resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} - /tsutils/3.21.0_typescript@4.8.3: + /tsutils/3.21.0_typescript@4.9.5: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 4.8.3 + typescript: 4.9.5 /type-check/0.3.2: resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==} @@ -10564,16 +10564,10 @@ packages: dependencies: is-typedarray: 1.0.0 - /typescript/4.8.3: - resolution: {integrity: sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig==} - engines: {node: '>=4.2.0'} - hasBin: true - /typescript/4.9.5: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} hasBin: true - dev: true /unbox-primitive/1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} From 3158b8b093639866eb58d190426aaa9d87f4f43c Mon Sep 17 00:00:00 2001 From: LinkinStars Date: Wed, 19 Apr 2023 16:48:42 +0800 Subject: [PATCH 18/18] docs(makefile): upgrade 1.0.9 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5fb96f68..3c69030e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: build clean ui -VERSION=1.0.8 +VERSION=1.0.9 BIN=answer DIR_SRC=./cmd/answer DOCKER_CMD=docker