diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json index cf32bb6f3a..fa2acd03a6 100644 --- a/api/swagger/swagger-dev.json +++ b/api/swagger/swagger-dev.json @@ -27881,6 +27881,11 @@ "type": "boolean", "title": "Alerting Tour", "x-order": 2 + }, + "snoozed_pmm_version": { + "type": "string", + "title": "Snoozed PMM version update", + "x-order": 3 } } } @@ -27944,6 +27949,12 @@ "title": "Alerting Tour", "x-nullable": true, "x-order": 1 + }, + "snoozed_pmm_version": { + "type": "string", + "title": "Snooze update alert for a PMM version", + "x-nullable": true, + "x-order": 2 } } } @@ -27970,6 +27981,11 @@ "type": "boolean", "title": "Alerting Tour", "x-order": 2 + }, + "snoozed_pmm_version": { + "type": "string", + "title": "Snooze update alert for a PMM version", + "x-order": 3 } } } diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index 53ea07bff3..1a8543e12f 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -26923,6 +26923,11 @@ "type": "boolean", "title": "Alerting Tour", "x-order": 2 + }, + "snoozed_pmm_version": { + "type": "string", + "title": "Snoozed PMM version update", + "x-order": 3 } } } @@ -26986,6 +26991,12 @@ "title": "Alerting Tour", "x-nullable": true, "x-order": 1 + }, + "snoozed_pmm_version": { + "type": "string", + "title": "Snooze update alert for a PMM version", + "x-nullable": true, + "x-order": 2 } } } @@ -27012,6 +27023,11 @@ "type": "boolean", "title": "Alerting Tour", "x-order": 2 + }, + "snoozed_pmm_version": { + "type": "string", + "title": "Snooze update alert for a PMM version", + "x-order": 3 } } } diff --git a/api/user/v1/json/client/user_service/get_user_responses.go b/api/user/v1/json/client/user_service/get_user_responses.go index 99186cdcee..184a1e66b3 100644 --- a/api/user/v1/json/client/user_service/get_user_responses.go +++ b/api/user/v1/json/client/user_service/get_user_responses.go @@ -272,6 +272,9 @@ type GetUserOKBody struct { // Alerting Tour AlertingTourCompleted bool `json:"alerting_tour_completed,omitempty"` + + // Snoozed PMM version update + SnoozedPMMVersion string `json:"snoozed_pmm_version,omitempty"` } // Validate validates this get user OK body diff --git a/api/user/v1/json/client/user_service/update_user_responses.go b/api/user/v1/json/client/user_service/update_user_responses.go index 0dc4d4c957..4a8b209032 100644 --- a/api/user/v1/json/client/user_service/update_user_responses.go +++ b/api/user/v1/json/client/user_service/update_user_responses.go @@ -128,6 +128,9 @@ type UpdateUserBody struct { // Alerting Tour AlertingTourCompleted *bool `json:"alerting_tour_completed,omitempty"` + + // Snooze update alert for a PMM version + SnoozedPMMVersion *string `json:"snoozed_pmm_version,omitempty"` } // Validate validates this update user body @@ -312,6 +315,9 @@ type UpdateUserOKBody struct { // Alerting Tour AlertingTourCompleted bool `json:"alerting_tour_completed,omitempty"` + + // Snooze update alert for a PMM version + SnoozedPMMVersion string `json:"snoozed_pmm_version,omitempty"` } // Validate validates this update user OK body diff --git a/api/user/v1/json/v1.json b/api/user/v1/json/v1.json index 755e1bab5f..b87d4f3a51 100644 --- a/api/user/v1/json/v1.json +++ b/api/user/v1/json/v1.json @@ -113,6 +113,11 @@ "title": "Product Tour", "x-order": 1 }, + "snoozed_pmm_version": { + "type": "string", + "title": "Snoozed PMM version update", + "x-order": 3 + }, "user_id": { "type": "integer", "format": "int64", @@ -181,6 +186,12 @@ "title": "Product Tour", "x-nullable": true, "x-order": 0 + }, + "snoozed_pmm_version": { + "type": "string", + "title": "Snooze update alert for a PMM version", + "x-nullable": true, + "x-order": 2 } } } @@ -202,6 +213,11 @@ "title": "Product Tour", "x-order": 1 }, + "snoozed_pmm_version": { + "type": "string", + "title": "Snooze update alert for a PMM version", + "x-order": 3 + }, "user_id": { "type": "integer", "format": "int64", diff --git a/api/user/v1/user.pb.go b/api/user/v1/user.pb.go index a96452105e..dbfb229876 100644 --- a/api/user/v1/user.pb.go +++ b/api/user/v1/user.pb.go @@ -72,6 +72,8 @@ type GetUserResponse struct { ProductTourCompleted bool `protobuf:"varint,2,opt,name=product_tour_completed,json=productTourCompleted,proto3" json:"product_tour_completed,omitempty"` // Alerting Tour AlertingTourCompleted bool `protobuf:"varint,3,opt,name=alerting_tour_completed,json=alertingTourCompleted,proto3" json:"alerting_tour_completed,omitempty"` + // Snoozed PMM version update + SnoozedPmmVersion string `protobuf:"bytes,4,opt,name=snoozed_pmm_version,json=snoozedPmmVersion,proto3" json:"snoozed_pmm_version,omitempty"` } func (x *GetUserResponse) Reset() { @@ -127,6 +129,13 @@ func (x *GetUserResponse) GetAlertingTourCompleted() bool { return false } +func (x *GetUserResponse) GetSnoozedPmmVersion() string { + if x != nil { + return x.SnoozedPmmVersion + } + return "" +} + type UpdateUserRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -136,6 +145,8 @@ type UpdateUserRequest struct { ProductTourCompleted *bool `protobuf:"varint,2,opt,name=product_tour_completed,json=productTourCompleted,proto3,oneof" json:"product_tour_completed,omitempty"` // Alerting Tour AlertingTourCompleted *bool `protobuf:"varint,3,opt,name=alerting_tour_completed,json=alertingTourCompleted,proto3,oneof" json:"alerting_tour_completed,omitempty"` + // Snooze update alert for a PMM version + SnoozedPmmVersion *string `protobuf:"bytes,4,opt,name=snoozed_pmm_version,json=snoozedPmmVersion,proto3,oneof" json:"snoozed_pmm_version,omitempty"` } func (x *UpdateUserRequest) Reset() { @@ -184,6 +195,13 @@ func (x *UpdateUserRequest) GetAlertingTourCompleted() bool { return false } +func (x *UpdateUserRequest) GetSnoozedPmmVersion() string { + if x != nil && x.SnoozedPmmVersion != nil { + return *x.SnoozedPmmVersion + } + return "" +} + type UpdateUserResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -195,6 +213,8 @@ type UpdateUserResponse struct { ProductTourCompleted bool `protobuf:"varint,2,opt,name=product_tour_completed,json=productTourCompleted,proto3" json:"product_tour_completed,omitempty"` // Alerting Tour AlertingTourCompleted bool `protobuf:"varint,3,opt,name=alerting_tour_completed,json=alertingTourCompleted,proto3" json:"alerting_tour_completed,omitempty"` + // Snooze update alert for a PMM version + SnoozedPmmVersion string `protobuf:"bytes,4,opt,name=snoozed_pmm_version,json=snoozedPmmVersion,proto3" json:"snoozed_pmm_version,omitempty"` } func (x *UpdateUserResponse) Reset() { @@ -250,6 +270,13 @@ func (x *UpdateUserResponse) GetAlertingTourCompleted() bool { return false } +func (x *UpdateUserResponse) GetSnoozedPmmVersion() string { + if x != nil { + return x.SnoozedPmmVersion + } + return "" +} + type ListUsersRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -401,7 +428,7 @@ var file_user_v1_user_proto_rawDesc = []byte{ 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x98, 0x01, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xc8, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x16, 0x70, 0x72, @@ -411,7 +438,10 @@ var file_user_v1_user_proto_rawDesc = []byte{ 0x12, 0x36, 0x0a, 0x17, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x75, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x75, 0x72, 0x43, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0xc2, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x73, 0x6e, 0x6f, 0x6f, + 0x7a, 0x65, 0x64, 0x5f, 0x70, 0x6d, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x64, 0x50, 0x6d, + 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8f, 0x02, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x16, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x74, 0x6f, 0x75, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, @@ -420,70 +450,78 @@ var file_user_v1_user_proto_rawDesc = []byte{ 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x75, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x15, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x75, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x74, 0x65, 0x64, 0x88, 0x01, 0x01, 0x42, 0x19, 0x0a, 0x17, 0x5f, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x5f, 0x74, 0x6f, 0x75, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, - 0x64, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, - 0x6f, 0x75, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x9b, 0x01, - 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x34, 0x0a, - 0x16, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x74, 0x6f, 0x75, 0x72, 0x5f, 0x63, 0x6f, - 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x70, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x54, 0x6f, 0x75, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, - 0x74, 0x6f, 0x75, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, - 0x75, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x12, 0x0a, 0x10, 0x4c, - 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x92, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x05, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x1a, 0x40, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x6f, 0x6c, - 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x07, 0x72, 0x6f, 0x6c, - 0x65, 0x49, 0x64, 0x73, 0x32, 0xd4, 0x03, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x8e, 0x01, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x39, 0x12, 0x10, 0x47, 0x65, 0x74, 0x20, 0x75, 0x73, - 0x65, 0x72, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a, 0x25, 0x52, 0x65, 0x74, 0x72, - 0x69, 0x65, 0x76, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x2f, 0x6d, 0x65, 0x12, 0x93, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4c, 0x92, - 0x41, 0x32, 0x12, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x75, 0x73, 0x65, - 0x72, 0x1a, 0x21, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a, 0x01, 0x2a, 0x1a, 0x0c, 0x2f, - 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x6d, 0x65, 0x12, 0x9d, 0x01, 0x0a, 0x09, - 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x59, 0x92, 0x41, 0x45, 0x12, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x1a, 0x33, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x20, - 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x66, 0x6f, 0x72, - 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x72, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, - 0x50, 0x4d, 0x4d, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, - 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x42, 0x8f, 0x01, 0x92, 0x41, - 0x0c, 0x12, 0x0a, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x20, 0x41, 0x50, 0x49, 0x0a, 0x0b, 0x63, - 0x6f, 0x6d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x55, 0x73, 0x65, 0x72, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, - 0x76, 0x31, 0xa2, 0x02, 0x03, 0x55, 0x58, 0x58, 0xaa, 0x02, 0x07, 0x55, 0x73, 0x65, 0x72, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x07, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x13, 0x55, - 0x73, 0x65, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x08, 0x55, 0x73, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x13, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, + 0x64, 0x5f, 0x70, 0x6d, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x11, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x64, 0x50, 0x6d, + 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x19, 0x0a, 0x17, 0x5f, + 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x74, 0x6f, 0x75, 0x72, 0x5f, 0x63, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, + 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x75, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, + 0x65, 0x64, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x64, 0x5f, 0x70, + 0x6d, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xcb, 0x01, 0x0a, 0x12, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x16, 0x70, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x74, 0x6f, 0x75, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x70, 0x72, 0x6f, 0x64, + 0x75, 0x63, 0x74, 0x54, 0x6f, 0x75, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, + 0x12, 0x36, 0x0a, 0x17, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x75, + 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x15, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x75, 0x72, 0x43, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x73, 0x6e, 0x6f, 0x6f, + 0x7a, 0x65, 0x64, 0x5f, 0x70, 0x6d, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x64, 0x50, 0x6d, + 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x92, 0x01, 0x0a, + 0x11, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x25, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x1a, + 0x40, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, + 0x73, 0x32, 0xd4, 0x03, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x8e, 0x01, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x50, 0x92, 0x41, 0x39, 0x12, 0x10, 0x47, 0x65, 0x74, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, + 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a, 0x25, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, + 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x66, + 0x72, 0x6f, 0x6d, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, + 0x6d, 0x65, 0x12, 0x93, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4c, 0x92, 0x41, 0x32, 0x12, + 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x21, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a, 0x01, 0x2a, 0x1a, 0x0c, 0x2f, 0x76, 0x31, 0x2f, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x6d, 0x65, 0x12, 0x9d, 0x01, 0x0a, 0x09, 0x4c, 0x69, 0x73, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x59, 0x92, + 0x41, 0x45, 0x12, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, + 0x72, 0x73, 0x1a, 0x33, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x20, 0x75, 0x73, 0x65, + 0x72, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, + 0x6c, 0x20, 0x75, 0x73, 0x65, 0x72, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x50, 0x4d, 0x4d, + 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, + 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x42, 0x8f, 0x01, 0x92, 0x41, 0x0c, 0x12, 0x0a, + 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x20, 0x41, 0x50, 0x49, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x55, 0x58, 0x58, 0xaa, 0x02, 0x07, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x07, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x13, 0x55, 0x73, 0x65, 0x72, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x08, 0x55, 0x73, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/api/user/v1/user.pb.validate.go b/api/user/v1/user.pb.validate.go index aacc93faf4..a35b0f3413 100644 --- a/api/user/v1/user.pb.validate.go +++ b/api/user/v1/user.pb.validate.go @@ -163,6 +163,8 @@ func (m *GetUserResponse) validate(all bool) error { // no validation rules for AlertingTourCompleted + // no validation rules for SnoozedPmmVersion + if len(errors) > 0 { return GetUserResponseMultiError(errors) } @@ -271,6 +273,10 @@ func (m *UpdateUserRequest) validate(all bool) error { // no validation rules for AlertingTourCompleted } + if m.SnoozedPmmVersion != nil { + // no validation rules for SnoozedPmmVersion + } + if len(errors) > 0 { return UpdateUserRequestMultiError(errors) } @@ -379,6 +385,8 @@ func (m *UpdateUserResponse) validate(all bool) error { // no validation rules for AlertingTourCompleted + // no validation rules for SnoozedPmmVersion + if len(errors) > 0 { return UpdateUserResponseMultiError(errors) } diff --git a/api/user/v1/user.proto b/api/user/v1/user.proto index a30b223075..0cbfc1509e 100644 --- a/api/user/v1/user.proto +++ b/api/user/v1/user.proto @@ -18,6 +18,8 @@ message GetUserResponse { bool product_tour_completed = 2; // Alerting Tour bool alerting_tour_completed = 3; + // Snoozed PMM version update + string snoozed_pmm_version = 4; } message UpdateUserRequest { @@ -25,6 +27,8 @@ message UpdateUserRequest { optional bool product_tour_completed = 2; // Alerting Tour optional bool alerting_tour_completed = 3; + // Snooze update alert for a PMM version + optional string snoozed_pmm_version = 4; } message UpdateUserResponse { @@ -34,6 +38,8 @@ message UpdateUserResponse { bool product_tour_completed = 2; // Alerting Tour bool alerting_tour_completed = 3; + // Snooze update alert for a PMM version + string snoozed_pmm_version = 4; } message ListUsersRequest {} diff --git a/managed/models/database.go b/managed/models/database.go index 90d1407a6d..2c2e9e1bef 100644 --- a/managed/models/database.go +++ b/managed/models/database.go @@ -1052,6 +1052,10 @@ var databaseSchema = [][]string{ `ALTER TABLE service_software_versions ADD CONSTRAINT service_software_versions_service_id_fkey FOREIGN KEY (service_id) REFERENCES services (service_id) ON DELETE CASCADE;`, `ALTER TABLE services ADD CONSTRAINT services_node_id_fkey FOREIGN KEY (node_id) REFERENCES nodes (node_id);`, }, + 106: { + `ALTER TABLE user_flags + ADD COLUMN snoozed_pmm_version VARCHAR NOT NULL DEFAULT ''`, + }, } // ^^^ Avoid default values in schema definition. ^^^ diff --git a/managed/models/user_flags_helpers.go b/managed/models/user_flags_helpers.go index 7909153b3d..38cfe3725a 100644 --- a/managed/models/user_flags_helpers.go +++ b/managed/models/user_flags_helpers.go @@ -31,9 +31,10 @@ type CreateUserParams struct { // UpdateUserParams has parameters to update existing user. type UpdateUserParams struct { - UserID int - Tour *bool - AlertingTour *bool + UserID int + Tour *bool + AlertingTour *bool + SnoozedPMMVersion *string } // GetOrCreateUser returns user and optionally creates it, if not in database yet. @@ -100,13 +101,15 @@ func UpdateUser(q *reform.Querier, params *UpdateUserParams) (*UserDetails, erro if err != nil { return nil, err } - if params.Tour != nil { row.Tour = *params.Tour } if params.AlertingTour != nil { row.AlertingTour = *params.AlertingTour } + if params.SnoozedPMMVersion != nil { + row.SnoozedPMMVersion = *params.SnoozedPMMVersion + } if err = q.Update(row); err != nil { return nil, errors.Wrap(err, "failed to update user") diff --git a/managed/models/user_flags_model.go b/managed/models/user_flags_model.go index 5f7e8cff1e..e1a8109006 100644 --- a/managed/models/user_flags_model.go +++ b/managed/models/user_flags_model.go @@ -27,9 +27,10 @@ import ( // //reform:user_flags type UserDetails struct { - ID int `reform:"id,pk"` - Tour bool `reform:"tour_done"` - AlertingTour bool `reform:"alerting_tour_done"` + ID int `reform:"id,pk"` + Tour bool `reform:"tour_done"` + AlertingTour bool `reform:"alerting_tour_done"` + SnoozedPMMVersion string `reform:"snoozed_pmm_version"` CreatedAt time.Time `reform:"created_at"` UpdatedAt time.Time `reform:"updated_at"` diff --git a/managed/models/user_flags_model_reform.go b/managed/models/user_flags_model_reform.go index 6a0d712dd3..940c242e1d 100644 --- a/managed/models/user_flags_model_reform.go +++ b/managed/models/user_flags_model_reform.go @@ -31,6 +31,7 @@ func (v *userDetailsTableType) Columns() []string { "id", "tour_done", "alerting_tour_done", + "snoozed_pmm_version", "created_at", "updated_at", } @@ -60,6 +61,7 @@ var UserDetailsTable = &userDetailsTableType{ {Name: "ID", Type: "int", Column: "id"}, {Name: "Tour", Type: "bool", Column: "tour_done"}, {Name: "AlertingTour", Type: "bool", Column: "alerting_tour_done"}, + {Name: "SnoozedPMMVersion", Type: "string", Column: "snoozed_pmm_version"}, {Name: "CreatedAt", Type: "time.Time", Column: "created_at"}, {Name: "UpdatedAt", Type: "time.Time", Column: "updated_at"}, }, @@ -70,12 +72,13 @@ var UserDetailsTable = &userDetailsTableType{ // String returns a string representation of this struct or record. func (s UserDetails) String() string { - res := make([]string, 5) + res := make([]string, 6) res[0] = "ID: " + reform.Inspect(s.ID, true) res[1] = "Tour: " + reform.Inspect(s.Tour, true) res[2] = "AlertingTour: " + reform.Inspect(s.AlertingTour, true) - res[3] = "CreatedAt: " + reform.Inspect(s.CreatedAt, true) - res[4] = "UpdatedAt: " + reform.Inspect(s.UpdatedAt, true) + res[3] = "SnoozedPMMVersion: " + reform.Inspect(s.SnoozedPMMVersion, true) + res[4] = "CreatedAt: " + reform.Inspect(s.CreatedAt, true) + res[5] = "UpdatedAt: " + reform.Inspect(s.UpdatedAt, true) return strings.Join(res, ", ") } @@ -86,6 +89,7 @@ func (s *UserDetails) Values() []interface{} { s.ID, s.Tour, s.AlertingTour, + s.SnoozedPMMVersion, s.CreatedAt, s.UpdatedAt, } @@ -98,6 +102,7 @@ func (s *UserDetails) Pointers() []interface{} { &s.ID, &s.Tour, &s.AlertingTour, + &s.SnoozedPMMVersion, &s.CreatedAt, &s.UpdatedAt, } diff --git a/managed/services/user/user.go b/managed/services/user/user.go index 14b210d84f..eb0443b90a 100644 --- a/managed/services/user/user.go +++ b/managed/services/user/user.go @@ -71,6 +71,7 @@ func (s *Service) GetUser(ctx context.Context, _ *userv1.GetUserRequest) (*userv UserId: uint32(userInfo.ID), ProductTourCompleted: userInfo.Tour, AlertingTourCompleted: userInfo.AlertingTour, + SnoozedPmmVersion: userInfo.SnoozedPMMVersion, } return resp, nil } @@ -98,6 +99,9 @@ func (s *Service) UpdateUser(ctx context.Context, req *userv1.UpdateUserRequest) Tour: req.ProductTourCompleted, AlertingTour: req.AlertingTourCompleted, } + if req.SnoozedPmmVersion != nil { + params.SnoozedPMMVersion = req.SnoozedPmmVersion + } userInfo, err = models.UpdateUser(tx.Querier, params) if err != nil { @@ -114,6 +118,7 @@ func (s *Service) UpdateUser(ctx context.Context, req *userv1.UpdateUserRequest) UserId: uint32(userInfo.ID), ProductTourCompleted: userInfo.Tour, AlertingTourCompleted: userInfo.AlertingTour, + SnoozedPmmVersion: userInfo.SnoozedPMMVersion, } return resp, nil }