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
5053c020
Commit
5053c020
authored
Jul 15, 2020
by
Jose Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dropdown constants
This also rewrites some conditions and tests for better clarity
parent
93b58f5e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
12 deletions
+18
-12
app/assets/javascripts/logs/components/environment_logs.vue
app/assets/javascripts/logs/components/environment_logs.vue
+4
-4
app/assets/javascripts/logs/constants.js
app/assets/javascripts/logs/constants.js
+5
-0
app/assets/javascripts/logs/stores/actions.js
app/assets/javascripts/logs/stores/actions.js
+7
-3
locale/gitlab.pot
locale/gitlab.pot
+0
-3
spec/frontend/logs/stores/mutations_spec.js
spec/frontend/logs/stores/mutations_spec.js
+2
-2
No files found.
app/assets/javascripts/logs/components/environment_logs.vue
View file @
5053c020
...
...
@@ -180,7 +180,7 @@ export default {
:disabled=
"environments.isLoading"
class=
"mb-2 gl-h-32 pr-2 d-flex d-md-block js-environments-dropdown"
>
<gl-dropdown-header
class=
"text-center"
>
<gl-dropdown-header
class=
"
gl-
text-center"
>
{{
s__
(
'
Environments|Environments
'
)
}}
</gl-dropdown-header>
<gl-dropdown-item
...
...
@@ -193,11 +193,11 @@ export default {
:class=
"
{ invisible: !isCurrentEnvironment(env.name) }"
name="status_success_borderless"
/>
<div
class=
"flex-grow-1"
>
{{
env
.
name
}}
</div>
<div
class=
"
gl-
flex-grow-1"
>
{{
env
.
name
}}
</div>
</div>
</gl-dropdown-item>
<gl-dropdown-divider
/>
<gl-dropdown-header
class=
"text-center"
>
<gl-dropdown-header
class=
"
gl-
text-center"
>
{{
s__
(
'
Environments|Managed apps
'
)
}}
</gl-dropdown-header>
<gl-dropdown-item
...
...
@@ -210,7 +210,7 @@ export default {
:class=
"
{ invisible: !isCurrentManagedApp(app.name) }"
name="status_success_borderless"
/>
<div
class=
"flex-grow-1"
>
{{
app
.
name
}}
</div>
<div
class=
"
gl-
flex-grow-1"
>
{{
app
.
name
}}
</div>
</div>
</gl-dropdown-item>
</gl-dropdown>
...
...
app/assets/javascripts/logs/constants.js
View file @
5053c020
...
...
@@ -10,3 +10,8 @@ export const tracking = {
REFRESH_POD_LOGS
:
'
refresh_pod_logs
'
,
MANAGED_APP_SELECTED
:
'
managed_app_selected
'
,
};
export
const
logExplorerOptions
=
{
environments
:
'
environments
'
,
managedApps
:
'
managedApps
'
,
};
app/assets/javascripts/logs/stores/actions.js
View file @
5053c020
...
...
@@ -2,7 +2,7 @@ import { backOff } from '~/lib/utils/common_utils';
import
httpStatusCodes
from
'
~/lib/utils/http_status
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
convertToFixedRange
}
from
'
~/lib/utils/datetime_range
'
;
import
{
TOKEN_TYPE_POD_NAME
,
tracking
}
from
'
../constants
'
;
import
{
TOKEN_TYPE_POD_NAME
,
tracking
,
logExplorerOptions
}
from
'
../constants
'
;
import
trackLogs
from
'
../logs_tracking_helper
'
;
import
*
as
types
from
'
./mutation_types
'
;
...
...
@@ -25,11 +25,15 @@ const requestUntilData = (url, params) =>
const
requestLogsUntilData
=
({
commit
,
state
})
=>
{
const
params
=
{};
const
type
=
state
.
environments
.
current
!=
null
?
'
environments
'
:
'
managedApps
'
;
const
type
=
state
.
environments
.
current
?
logExplorerOptions
.
environments
:
logExplorerOptions
.
managedApps
;
const
selectedObj
=
state
[
type
].
options
.
find
(({
name
})
=>
name
===
state
[
type
].
current
);
const
path
=
type
===
'
environments
'
?
selectedObj
.
logs_api_path
:
selectedObj
.
gitlab_managed_apps_logs_path
;
type
===
logExplorerOptions
.
environments
?
selectedObj
.
logs_api_path
:
selectedObj
.
gitlab_managed_apps_logs_path
;
if
(
state
.
pods
.
current
)
{
params
.
pod_name
=
state
.
pods
.
current
;
...
...
locale/gitlab.pot
View file @
5053c020
...
...
@@ -9169,9 +9169,6 @@ msgstr ""
msgid "Environments|Rollback environment %{name}?"
msgstr ""
msgid "Environments|Select environment"
msgstr ""
msgid "Environments|Select pod"
msgstr ""
...
...
spec/frontend/logs/stores/mutations_spec.js
View file @
5053c020
...
...
@@ -39,7 +39,7 @@ describe('Logs Store Mutations', () => {
describe
(
'
SET_MANAGED_APP
'
,
()
=>
{
it
(
'
sets the managed app
'
,
()
=>
{
mutations
[
types
.
SET_MANAGED_APP
](
state
,
mockManagedAppName
);
expect
(
state
.
managedApps
.
current
).
to
Equal
(
mockManagedAppName
);
expect
(
state
.
managedApps
.
current
).
to
Be
(
mockManagedAppName
);
expect
(
state
.
environments
.
current
).
toBe
(
null
);
});
});
...
...
@@ -273,7 +273,7 @@ describe('Logs Store Mutations', () => {
mutations
[
types
.
RECEIVE_MANAGED_APPS_DATA_SUCCESS
](
state
,
mockManagedApps
);
expect
(
state
.
managedApps
.
options
).
toEqual
(
mockManagedApps
);
expect
(
state
.
managedApps
.
isLoading
).
to
Equal
(
false
);
expect
(
state
.
managedApps
.
isLoading
).
to
Be
(
false
);
});
});
...
...
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