Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
07207812
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
07207812
编写于
6月 06, 2020
作者:
G
GitLab Bot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add latest changes from gitlab-org/gitlab@master
上级
2ade98b6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
24 deletion
+18
-24
app/assets/javascripts/alert_management/components/alert_management_list.vue
...pts/alert_management/components/alert_management_list.vue
+5
-6
app/assets/stylesheets/framework/variables_overrides.scss
app/assets/stylesheets/framework/variables_overrides.scss
+2
-2
changelogs/unreleased/lm-change-sorting.yml
changelogs/unreleased/lm-change-sorting.yml
+5
-0
spec/frontend/alert_management/components/alert_management_list_spec.js
...alert_management/components/alert_management_list_spec.js
+6
-16
未找到文件。
app/assets/javascripts/alert_management/components/alert_management_list.vue
浏览文件 @
07207812
...
@@ -34,7 +34,6 @@ import Tracking from '~/tracking';
...
@@ -34,7 +34,6 @@ import Tracking from '~/tracking';
const
tdClass
=
'
table-col d-flex d-md-table-cell align-items-center
'
;
const
tdClass
=
'
table-col d-flex d-md-table-cell align-items-center
'
;
const
bodyTrClass
=
const
bodyTrClass
=
'
gl-border-1 gl-border-t-solid gl-border-gray-100 gl-hover-bg-blue-50 gl-hover-cursor-pointer gl-hover-border-b-solid gl-hover-border-blue-200
'
;
'
gl-border-1 gl-border-t-solid gl-border-gray-100 gl-hover-bg-blue-50 gl-hover-cursor-pointer gl-hover-border-b-solid gl-hover-border-blue-200
'
;
const
findDefaultSortColumn
=
()
=>
document
.
querySelector
(
'
.js-started-at
'
);
const
initialPaginationState
=
{
const
initialPaginationState
=
{
currentPage
:
1
,
currentPage
:
1
,
...
@@ -189,10 +188,12 @@ export default {
...
@@ -189,10 +188,12 @@ export default {
errored
:
false
,
errored
:
false
,
isAlertDismissed
:
false
,
isAlertDismissed
:
false
,
isErrorAlertDismissed
:
false
,
isErrorAlertDismissed
:
false
,
sort
:
'
STARTED_AT_
A
SC
'
,
sort
:
'
STARTED_AT_
DE
SC
'
,
statusFilter
:
[],
statusFilter
:
[],
filteredByStatus
:
''
,
filteredByStatus
:
''
,
pagination
:
initialPaginationState
,
pagination
:
initialPaginationState
,
sortBy
:
'
startedAt
'
,
sortDesc
:
true
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -241,9 +242,6 @@ export default {
...
@@ -241,9 +242,6 @@ export default {
const
sortDirection
=
sortDesc
?
'
DESC
'
:
'
ASC
'
;
const
sortDirection
=
sortDesc
?
'
DESC
'
:
'
ASC
'
;
const
sortColumn
=
convertToSnakeCase
(
sortBy
).
toUpperCase
();
const
sortColumn
=
convertToSnakeCase
(
sortBy
).
toUpperCase
();
if
(
sortBy
!==
'
startedAt
'
)
{
findDefaultSortColumn
().
ariaSort
=
'
none
'
;
}
this
.
resetPagination
();
this
.
resetPagination
();
this
.
sort
=
`
${
sortColumn
}
_
${
sortDirection
}
`
;
this
.
sort
=
`
${
sortColumn
}
_
${
sortDirection
}
`
;
},
},
...
@@ -344,8 +342,9 @@ export default {
...
@@ -344,8 +342,9 @@ export default {
stacked=
"md"
stacked=
"md"
:tbody-tr-class=
"tbodyTrClass"
:tbody-tr-class=
"tbodyTrClass"
:no-local-sorting=
"true"
:no-local-sorting=
"true"
:sort-desc.sync=
"sortDesc"
:sort-by.sync=
"sortBy"
sort-icon-left
sort-icon-left
sort-by=
"startedAt"
@
row-clicked=
"navigateToAlertDetails"
@
row-clicked=
"navigateToAlertDetails"
@
sort-changed=
"fetchSortedData"
@
sort-changed=
"fetchSortedData"
>
>
...
...
app/assets/stylesheets/framework/variables_overrides.scss
浏览文件 @
07207812
...
@@ -55,7 +55,7 @@ $tooltip-padding-y: 0.5rem;
...
@@ -55,7 +55,7 @@ $tooltip-padding-y: 0.5rem;
$tooltip-padding-x
:
0
.75rem
;
$tooltip-padding-x
:
0
.75rem
;
$tooltip-arrow-height
:
0
.5rem
;
$tooltip-arrow-height
:
0
.5rem
;
$tooltip-arrow-width
:
1rem
;
$tooltip-arrow-width
:
1rem
;
$b-table-sort-icon-bg-
a
scending
:
url('data:image/svg+xml, <svg \
$b-table-sort-icon-bg-
de
scending
:
url('data:image/svg+xml, <svg \
xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="4 0 8 16"> \
xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="4 0 8 16"> \
<path style="fill: #666;" fill-rule="evenodd" d="M11.707085,11.7071 \
<path style="fill: #666;" fill-rule="evenodd" d="M11.707085,11.7071 \
L7.999975,15.4142 L4.292875,11.7071 C3.902375,11.3166 3.902375, \
L7.999975,15.4142 L4.292875,11.7071 C3.902375,11.3166 3.902375, \
...
@@ -67,7 +67,7 @@ $b-table-sort-icon-bg-ascending: url('data:image/svg+xml, <svg \
...
@@ -67,7 +67,7 @@ $b-table-sort-icon-bg-ascending: url('data:image/svg+xml, <svg \
,9.90237 11.316555,9.90237 11.707085,10.2929 \
,9.90237 11.316555,9.90237 11.707085,10.2929 \
C12.097605,10.6834 12.097605,11.3166 11.707085,11.7071 Z"/> \
C12.097605,10.6834 12.097605,11.3166 11.707085,11.7071 Z"/> \
</svg>')
!
default
;
</svg>')
!
default
;
$b-table-sort-icon-bg-
de
scending
:
url('data:image/svg+xml,<svg \
$b-table-sort-icon-bg-
a
scending
:
url('data:image/svg+xml,<svg \
xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="4 0 8 16"> \
xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="4 0 8 16"> \
<path style="fill: #666;" fill-rule="evenodd" d="M4.29289,4.2971 L8,0.59 \
<path style="fill: #666;" fill-rule="evenodd" d="M4.29289,4.2971 L8,0.59 \
L11.7071,4.2971 C12.0976,4.6876 \
L11.7071,4.2971 C12.0976,4.6876 \
...
...
changelogs/unreleased/lm-change-sorting.yml
0 → 100644
浏览文件 @
07207812
---
title
:
'
Alert
Managament:
Change
sorting
order
to
have
newest
alerts
first'
merge_request
:
33642
author
:
type
:
changed
spec/frontend/alert_management/components/alert_management_list_spec.js
浏览文件 @
07207812
...
@@ -48,7 +48,6 @@ describe('AlertManagementList', () => {
...
@@ -48,7 +48,6 @@ describe('AlertManagementList', () => {
const
findAssignees
=
()
=>
wrapper
.
findAll
(
'
[data-testid="assigneesField"]
'
);
const
findAssignees
=
()
=>
wrapper
.
findAll
(
'
[data-testid="assigneesField"]
'
);
const
findSeverityFields
=
()
=>
wrapper
.
findAll
(
'
[data-testid="severityField"]
'
);
const
findSeverityFields
=
()
=>
wrapper
.
findAll
(
'
[data-testid="severityField"]
'
);
const
findSeverityColumnHeader
=
()
=>
wrapper
.
findAll
(
'
th
'
).
at
(
0
);
const
findSeverityColumnHeader
=
()
=>
wrapper
.
findAll
(
'
th
'
).
at
(
0
);
const
findStartTimeColumnHeader
=
()
=>
wrapper
.
findAll
(
'
th
'
).
at
(
1
);
const
findPagination
=
()
=>
wrapper
.
find
(
GlPagination
);
const
findPagination
=
()
=>
wrapper
.
find
(
GlPagination
);
const
alertsCount
=
{
const
alertsCount
=
{
open
:
14
,
open
:
14
,
...
@@ -92,10 +91,7 @@ describe('AlertManagementList', () => {
...
@@ -92,10 +91,7 @@ describe('AlertManagementList', () => {
});
});
}
}
const
mockStartedAtCol
=
{};
beforeEach
(()
=>
{
beforeEach
(()
=>
{
jest
.
spyOn
(
document
,
'
querySelector
'
).
mockReturnValue
(
mockStartedAtCol
);
mountComponent
();
mountComponent
();
});
});
...
@@ -333,7 +329,12 @@ describe('AlertManagementList', () => {
...
@@ -333,7 +329,12 @@ describe('AlertManagementList', () => {
beforeEach
(()
=>
{
beforeEach
(()
=>
{
mountComponent
({
mountComponent
({
props
:
{
alertManagementEnabled
:
true
,
userCanEnableAlertManagement
:
true
},
props
:
{
alertManagementEnabled
:
true
,
userCanEnableAlertManagement
:
true
},
data
:
{
alerts
:
{
list
:
mockAlerts
},
errored
:
false
,
sort
:
'
STARTED_AT_ASC
'
,
alertsCount
},
data
:
{
alerts
:
{
list
:
mockAlerts
},
errored
:
false
,
sort
:
'
STARTED_AT_DESC
'
,
alertsCount
,
},
loading
:
false
,
loading
:
false
,
stubs
:
{
GlTable
},
stubs
:
{
GlTable
},
});
});
...
@@ -348,17 +349,6 @@ describe('AlertManagementList', () => {
...
@@ -348,17 +349,6 @@ describe('AlertManagementList', () => {
expect
(
wrapper
.
vm
.
$data
.
sort
).
toBe
(
'
SEVERITY_DESC
'
);
expect
(
wrapper
.
vm
.
$data
.
sort
).
toBe
(
'
SEVERITY_DESC
'
);
});
});
it
(
'
updates the `ariaSort` attribute so the sort icon appears in the proper column
'
,
()
=>
{
expect
(
findStartTimeColumnHeader
().
attributes
(
'
aria-sort
'
)).
toBe
(
'
ascending
'
);
findSeverityColumnHeader
().
trigger
(
'
click
'
);
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
findStartTimeColumnHeader
().
attributes
(
'
aria-sort
'
)).
toBe
(
'
none
'
);
expect
(
findSeverityColumnHeader
().
attributes
(
'
aria-sort
'
)).
toBe
(
'
ascending
'
);
});
});
});
});
describe
(
'
updating the alert status
'
,
()
=>
{
describe
(
'
updating the alert status
'
,
()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录