mirror of
https://github.com/gitlabhq/gitlabhq.git
synced 2025-08-16 17:13:01 +00:00
Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
@ -27,6 +27,9 @@ module Types
|
|||||||
description: 'Global ID of the work item.'
|
description: 'Global ID of the work item.'
|
||||||
field :iid, GraphQL::Types::String, null: false,
|
field :iid, GraphQL::Types::String, null: false,
|
||||||
description: 'Internal ID of the work item.'
|
description: 'Internal ID of the work item.'
|
||||||
|
field :imported, GraphQL::Types::Boolean, null: false,
|
||||||
|
method: :imported?,
|
||||||
|
description: 'Indicates whether the work item was imported.'
|
||||||
field :lock_version,
|
field :lock_version,
|
||||||
GraphQL::Types::Int,
|
GraphQL::Types::Int,
|
||||||
null: false,
|
null: false,
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
class WorkItem < Issue
|
class WorkItem < Issue
|
||||||
include Gitlab::Utils::StrongMemoize
|
include Gitlab::Utils::StrongMemoize
|
||||||
|
include Import::HasImportSource
|
||||||
|
|
||||||
COMMON_QUICK_ACTIONS_COMMANDS = [
|
COMMON_QUICK_ACTIONS_COMMANDS = [
|
||||||
:title, :reopen, :close, :cc, :tableflip, :shrug, :type, :promote_to, :checkin_reminder,
|
:title, :reopen, :close, :cc, :tableflip, :shrug, :type, :promote_to, :checkin_reminder,
|
||||||
|
@ -113,7 +113,8 @@ module SystemNotes
|
|||||||
|
|
||||||
def formatted_spent_at(spent_at)
|
def formatted_spent_at(spent_at)
|
||||||
spent_at ||= DateTime.current
|
spent_at ||= DateTime.current
|
||||||
timezone = author.timezone || Time.zone.name
|
timezone = author.timezone
|
||||||
|
timezone = Time.zone.name if timezone.blank? || ActiveSupport::TimeZone[timezone].nil?
|
||||||
spent_at.in_time_zone(timezone)
|
spent_at.in_time_zone(timezone)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -41656,6 +41656,7 @@ four standard [pagination arguments](#pagination-arguments):
|
|||||||
| <a id="workitemhidden"></a>`hidden` | [`Boolean`](#boolean) | Indicates the work item is hidden because the author has been banned. |
|
| <a id="workitemhidden"></a>`hidden` | [`Boolean`](#boolean) | Indicates the work item is hidden because the author has been banned. |
|
||||||
| <a id="workitemid"></a>`id` | [`WorkItemID!`](#workitemid) | Global ID of the work item. |
|
| <a id="workitemid"></a>`id` | [`WorkItemID!`](#workitemid) | Global ID of the work item. |
|
||||||
| <a id="workitemiid"></a>`iid` | [`String!`](#string) | Internal ID of the work item. |
|
| <a id="workitemiid"></a>`iid` | [`String!`](#string) | Internal ID of the work item. |
|
||||||
|
| <a id="workitemimported"></a>`imported` | [`Boolean!`](#boolean) | Indicates whether the work item was imported. |
|
||||||
| <a id="workitemlockversion"></a>`lockVersion` | [`Int!`](#int) | Lock version of the work item. Incremented each time the work item is updated. |
|
| <a id="workitemlockversion"></a>`lockVersion` | [`Int!`](#int) | Lock version of the work item. Incremented each time the work item is updated. |
|
||||||
| <a id="workitemmovedtoworkitemurl"></a>`movedToWorkItemUrl` | [`String`](#string) | URL of the work item that the work item was moved to. |
|
| <a id="workitemmovedtoworkitemurl"></a>`movedToWorkItemUrl` | [`String`](#string) | URL of the work item that the work item was moved to. |
|
||||||
| <a id="workitemname"></a>`name` | [`String`](#string) | Name or title of the object. |
|
| <a id="workitemname"></a>`name` | [`String`](#string) | Name or title of the object. |
|
||||||
|
@ -19,6 +19,7 @@ RSpec.describe GitlabSchema.types['WorkItem'], feature_category: :team_planning
|
|||||||
description_html
|
description_html
|
||||||
id
|
id
|
||||||
iid
|
iid
|
||||||
|
imported
|
||||||
lock_version
|
lock_version
|
||||||
namespace
|
namespace
|
||||||
project
|
project
|
||||||
|
@ -383,6 +383,26 @@ RSpec.describe ::SystemNotes::TimeTrackingService, feature_category: :team_plann
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when author timezone is blank' do
|
||||||
|
let(:author) { create(:user, timezone: '') }
|
||||||
|
|
||||||
|
it 'sets the note text using default timezone' do
|
||||||
|
spend_time!(277200)
|
||||||
|
|
||||||
|
expect(subject.note).to eq "added 1w 4d 5h of time spent at 2019-12-30 14:05:12 UTC"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when author timezone is invalid' do
|
||||||
|
let(:author) { create(:user, timezone: 'GitLab') }
|
||||||
|
|
||||||
|
it 'sets the note text using default timezone' do
|
||||||
|
spend_time!(277200)
|
||||||
|
|
||||||
|
expect(subject.note).to eq "added 1w 4d 5h of time spent at 2019-12-30 14:05:12 UTC"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'when time was subtracted' do
|
context 'when time was subtracted' do
|
||||||
it 'sets the note text' do
|
it 'sets the note text' do
|
||||||
spend_time!(360000)
|
spend_time!(360000)
|
||||||
|
Reference in New Issue
Block a user