Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c33a1314
Commit
c33a1314
authored
Oct 22, 2020
by
Magdalena Frankiewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add availability to user status
To enable setting user availability, for now only one value possible: busy
parent
403da044
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
96 additions
and
1 deletion
+96
-1
app/graphql/types/availability_enum.rb
app/graphql/types/availability_enum.rb
+10
-0
app/graphql/types/user_status_type.rb
app/graphql/types/user_status_type.rb
+2
-0
app/models/user_status.rb
app/models/user_status.rb
+2
-0
changelogs/unreleased/set-user-availability-be.yml
changelogs/unreleased/set-user-availability-be.yml
+5
-0
db/migrate/20201022103304_add_availability_to_user_statuses.rb
...grate/20201022103304_add_availability_to_user_statuses.rb
+9
-0
db/schema_migrations/20201022103304
db/schema_migrations/20201022103304
+1
-0
db/structure.sql
db/structure.sql
+2
-1
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+12
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+31
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+9
-0
lib/api/entities/user_status.rb
lib/api/entities/user_status.rb
+1
-0
spec/graphql/types/availability_enum_spec.rb
spec/graphql/types/availability_enum_spec.rb
+11
-0
spec/graphql/types/user_status_type_spec.rb
spec/graphql/types/user_status_type_spec.rb
+1
-0
No files found.
app/graphql/types/availability_enum.rb
0 → 100644
View file @
c33a1314
# frozen_string_literal: true
module
Types
class
AvailabilityEnum
<
BaseEnum
graphql_name
'AvailabilityEnum'
description
'User availability status'
value
'BUSY'
,
value: :busy
end
end
app/graphql/types/user_status_type.rb
View file @
c33a1314
...
...
@@ -11,5 +11,7 @@ module Types
description:
'User status message'
field
:emoji
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'String representation of emoji'
field
:availability
,
Types
::
AvailabilityEnum
,
null:
true
,
description:
'User availability status'
end
end
app/models/user_status.rb
View file @
c33a1314
...
...
@@ -9,6 +9,8 @@ class UserStatus < ApplicationRecord
belongs_to
:user
enum
availability:
{
busy:
0
}
validates
:user
,
presence:
true
validates
:emoji
,
inclusion:
{
in:
Gitlab
::
Emoji
.
emojis_names
}
validates
:message
,
length:
{
maximum:
100
},
allow_blank:
true
...
...
changelogs/unreleased/set-user-availability-be.yml
0 → 100644
View file @
c33a1314
---
title
:
Add availability to user status
merge_request
:
45888
author
:
type
:
added
db/migrate/20201022103304_add_availability_to_user_statuses.rb
0 → 100644
View file @
c33a1314
# frozen_string_literal: true
class
AddAvailabilityToUserStatuses
<
ActiveRecord
::
Migration
[
6.0
]
DOWNTIME
=
false
def
change
add_column
:user_statuses
,
:availability
,
:integer
,
limit:
2
end
end
db/schema_migrations/20201022103304
0 → 100644
View file @
c33a1314
aa15aad0b51f313f3cd59e1065023146fe53c6bd50319656ae992f8f43e1525e
\ No newline at end of file
db/structure.sql
View file @
c33a1314
...
...
@@ -16782,7 +16782,8 @@ CREATE TABLE user_statuses (
cached_markdown_version
integer
,
emoji
character
varying
DEFAULT
'speech_balloon'
::
character
varying
NOT
NULL
,
message
character
varying
(
100
),
message_html
character
varying
message_html
character
varying
,
availability
smallint
);
CREATE
SEQUENCE
user_statuses_user_id_seq
...
...
doc/api/graphql/reference/gitlab_schema.graphql
View file @
c33a1314
...
...
@@ -927,6 +927,13 @@ type AlertTodoCreatePayload {
todo
:
Todo
}
"""
User availability status
"""
enum
AvailabilityEnum
{
BUSY
}
"""
An emoji awarded by a user
"""
...
...
@@ -21359,6 +21366,11 @@ enum UserState {
}
type
UserStatus
{
"""
User
availability
status
"""
availability
:
AvailabilityEnum
"""
String
representation
of
emoji
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
c33a1314
...
...
@@ -2391,6 +2391,23 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "ENUM",
"name": "AvailabilityEnum",
"description": "User availability status",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": [
{
"name": "BUSY",
"description": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "AwardEmoji",
...
...
@@ -61776,6 +61793,20 @@
"name": "UserStatus",
"description": null,
"fields": [
{
"name": "availability",
"description": "User availability status",
"args": [
],
"type": {
"kind": "ENUM",
"name": "AvailabilityEnum",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "emoji",
"description": "String representation of emoji",
doc/api/graphql/reference/index.md
View file @
c33a1314
...
...
@@ -2979,6 +2979,7 @@ Autogenerated return type of UpdateSnippet.
| Field | Type | Description |
| ----- | ---- | ----------- |
|
`availability`
| AvailabilityEnum | User availability status |
|
`emoji`
| String | String representation of emoji |
|
`message`
| String | User status message |
|
`messageHtml`
| String | HTML of the user status message |
...
...
@@ -3307,6 +3308,14 @@ Alert status values.
|
`RESOLVED`
| Resolved status |
|
`TRIGGERED`
| Triggered status |
### AvailabilityEnum
User availability status.
| Value | Description |
| ----- | ----------- |
|
`BUSY`
| |
### BlobViewersType
Types of blob viewers.
...
...
lib/api/entities/user_status.rb
View file @
c33a1314
...
...
@@ -5,6 +5,7 @@ module API
class
UserStatus
<
Grape
::
Entity
expose
:emoji
expose
:message
expose
:availability
expose
:message_html
do
|
entity
|
MarkupHelper
.
markdown_field
(
entity
,
:message
)
end
...
...
spec/graphql/types/availability_enum_spec.rb
0 → 100644
View file @
c33a1314
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
GitlabSchema
.
types
[
'AvailabilityEnum'
]
do
specify
{
expect
(
described_class
.
graphql_name
).
to
eq
(
'AvailabilityEnum'
)
}
it
'exposes all the existing access levels'
do
expect
(
described_class
.
values
.
keys
).
to
match_array
(
%w[BUSY]
)
end
end
spec/graphql/types/user_status_type_spec.rb
View file @
c33a1314
...
...
@@ -10,6 +10,7 @@ RSpec.describe Types::UserStatusType do
emoji
message
message_html
availability
]
expect
(
described_class
).
to
have_graphql_fields
(
*
expected_fields
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment