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
d4d38997
Commit
d4d38997
authored
May 21, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor method clean up
parent
f3eec0ff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
118 deletions
+88
-118
ee/app/assets/javascripts/geo_nodes/components/node_detail_sections/node_details_section_other.vue
...nents/node_detail_sections/node_details_section_other.vue
+35
-41
ee/app/assets/javascripts/geo_nodes/components/node_detail_sections/node_details_section_verification.vue
...ode_detail_sections/node_details_section_verification.vue
+28
-45
ee/app/assets/javascripts/geo_nodes/store/geo_nodes_store.js
ee/app/assets/javascripts/geo_nodes/store/geo_nodes_store.js
+2
-2
spec/javascripts/geo_nodes/components/node_detail_sections/node_details_section_other_spec.js
...s/node_detail_sections/node_details_section_other_spec.js
+23
-30
No files found.
ee/app/assets/javascripts/geo_nodes/components/node_detail_sections/node_details_section_other.vue
View file @
d4d38997
...
...
@@ -26,15 +26,45 @@
data
()
{
return
{
showSectionItems
:
false
,
primaryNodeDetailItems
:
this
.
getPrimaryNodeDetailItems
(),
secondaryNodeDetailItems
:
this
.
getSecondaryNodeDetailItems
(),
};
},
computed
:
{
nodeDetailItems
()
{
return
this
.
nodeTypePrimary
?
this
.
getPrimaryNodeDetailItems
()
:
this
.
getSecondaryNodeDetailItems
();
if
(
this
.
nodeTypePrimary
)
{
// Return primary node detail items
const
primaryNodeDetailItems
=
[
{
itemTitle
:
s__
(
'
GeoNodes|Replication slots
'
),
itemValue
:
this
.
nodeDetails
.
replicationSlots
,
itemValueType
:
VALUE_TYPE
.
GRAPH
,
successLabel
:
s__
(
'
GeoNodes|Used slots
'
),
neutraLabel
:
s__
(
'
GeoNodes|Unused slots
'
),
},
];
if
(
this
.
nodeDetails
.
replicationSlots
.
totalCount
)
{
primaryNodeDetailItems
.
push
(
{
itemTitle
:
s__
(
'
GeoNodes|Replication slot WAL
'
),
itemValue
:
numberToHumanSize
(
this
.
nodeDetails
.
replicationSlotWAL
),
itemValueType
:
VALUE_TYPE
.
PLAIN
,
cssClass
:
'
node-detail-value-bold
'
,
},
);
}
return
primaryNodeDetailItems
;
}
// Return secondary node detail items
return
[
{
itemTitle
:
s__
(
'
GeoNodes|Storage config
'
),
itemValue
:
this
.
storageShardsStatus
,
itemValueType
:
VALUE_TYPE
.
PLAIN
,
cssClass
:
this
.
storageShardsCssClass
,
},
];
},
storageShardsStatus
()
{
if
(
this
.
nodeDetails
.
storageShardsMatch
==
null
)
{
...
...
@@ -48,42 +78,6 @@
},
},
methods
:
{
getPrimaryNodeDetailItems
()
{
const
primaryNodeDetailItems
=
[
{
itemTitle
:
s__
(
'
GeoNodes|Replication slots
'
),
itemValue
:
this
.
nodeDetails
.
replicationSlots
,
itemValueType
:
VALUE_TYPE
.
GRAPH
,
successLabel
:
s__
(
'
GeoNodes|Used slots
'
),
neutraLabel
:
s__
(
'
GeoNodes|Unused slots
'
),
},
];
if
(
this
.
nodeDetails
.
replicationSlots
.
totalCount
)
{
primaryNodeDetailItems
.
push
(
{
itemTitle
:
s__
(
'
GeoNodes|Replication slot WAL
'
),
itemValue
:
numberToHumanSize
(
this
.
nodeDetails
.
replicationSlotWAL
),
itemValueType
:
VALUE_TYPE
.
PLAIN
,
cssClass
:
'
node-detail-value-bold
'
,
},
);
}
return
primaryNodeDetailItems
;
},
getSecondaryNodeDetailItems
()
{
const
secondaryNodeDetailItems
=
[
{
itemTitle
:
s__
(
'
GeoNodes|Storage config
'
),
itemValue
:
this
.
storageShardsStatus
,
itemValueType
:
VALUE_TYPE
.
PLAIN
,
cssClass
:
this
.
storageShardsCssClass
,
},
];
return
secondaryNodeDetailItems
;
},
handleSectionToggle
(
toggleState
)
{
this
.
showSectionItems
=
toggleState
;
},
...
...
ee/app/assets/javascripts/geo_nodes/components/node_detail_sections/node_details_section_verification.vue
View file @
d4d38997
...
...
@@ -29,12 +29,6 @@
};
},
computed
:
{
hasItemsToShow
()
{
if
(
!
this
.
nodeTypePrimary
)
{
return
this
.
nodeDetails
.
repositoryVerificationEnabled
;
}
return
true
;
},
nodeDetailItems
()
{
return
this
.
nodeTypePrimary
?
this
.
getPrimaryNodeDetailItems
()
:
...
...
@@ -43,43 +37,37 @@
},
methods
:
{
getPrimaryNodeDetailItems
()
{
const
primaryNodeDetailItems
=
[];
if
(
this
.
nodeDetails
.
repositoryVerificationEnabled
)
{
primaryNodeDetailItems
.
push
(
{
itemTitle
:
s__
(
'
GeoNodes|Repository checksum progress
'
),
itemValue
:
this
.
nodeDetails
.
repositoriesChecksummed
,
itemValueType
:
VALUE_TYPE
.
GRAPH
,
successLabel
:
s__
(
'
GeoNodes|Checksummed
'
),
neutraLabel
:
s__
(
'
GeoNodes|Not checksummed
'
),
failureLabel
:
s__
(
'
GeoNodes|Failed
'
),
helpInfo
:
{
title
:
s__
(
'
GeoNodes|Repositories checksummed for verification with their counterparts on Secondary nodes
'
),
url
:
HELP_INFO_URL
,
urlText
:
s__
(
'
GeoNodes|Learn more about Repository checksum progress
'
),
},
return
[
{
itemTitle
:
s__
(
'
GeoNodes|Repository checksum progress
'
),
itemValue
:
this
.
nodeDetails
.
repositoriesChecksummed
,
itemValueType
:
VALUE_TYPE
.
GRAPH
,
successLabel
:
s__
(
'
GeoNodes|Checksummed
'
),
neutraLabel
:
s__
(
'
GeoNodes|Not checksummed
'
),
failureLabel
:
s__
(
'
GeoNodes|Failed
'
),
helpInfo
:
{
title
:
s__
(
'
GeoNodes|Repositories checksummed for verification with their counterparts on Secondary nodes
'
),
url
:
HELP_INFO_URL
,
urlText
:
s__
(
'
GeoNodes|Learn more about Repository checksum progress
'
),
},
{
itemTitle
:
s__
(
'
GeoNodes|Wiki checksum progress
'
),
itemValue
:
this
.
nodeDetails
.
wikisChecksummed
,
itemValueType
:
VALUE_TYPE
.
GRAPH
,
successLabel
:
s__
(
'
GeoNodes|Checksummed
'
)
,
neutraLabel
:
s__
(
'
GeoNodes|Not c
hecksummed
'
),
failureLabel
:
s__
(
'
GeoNodes|Fail
ed
'
),
helpInfo
:
{
title
:
s__
(
'
GeoNodes|Wikis checksummed for verification with their counterparts on Secondary nodes
'
),
url
:
HELP_INFO_URL
,
urlText
:
s__
(
'
GeoNodes|Learn more about Wiki checksum progress
'
)
,
}
,
},
{
itemTitle
:
s__
(
'
GeoNodes|Wiki checksum progress
'
)
,
itemValue
:
this
.
nodeDetails
.
wikisChecksummed
,
itemValueType
:
VALUE_TYPE
.
GRAPH
,
successLabel
:
s__
(
'
GeoNodes|C
hecksummed
'
),
neutraLabel
:
s__
(
'
GeoNodes|Not checksumm
ed
'
),
failureLabel
:
s__
(
'
GeoNodes|Failed
'
),
helpInfo
:
{
title
:
s__
(
'
GeoNodes|Wikis checksummed for verification with their counterparts on Secondary nodes
'
)
,
url
:
HELP_INFO_URL
,
urlText
:
s__
(
'
GeoNodes|Learn more about Wiki checksum progress
'
)
,
},
);
}
return
primaryNodeDetailItems
;
},
];
},
getSecondaryNodeDetailItems
()
{
const
secondaryNodeDetailItems
=
[
return
[
{
itemTitle
:
s__
(
'
GeoNodes|Repository verification progress
'
),
itemValue
:
this
.
nodeDetails
.
verifiedRepositories
,
...
...
@@ -107,8 +95,6 @@
},
},
];
return
secondaryNodeDetailItems
;
},
handleSectionToggle
(
toggleState
)
{
this
.
showSectionItems
=
toggleState
;
...
...
@@ -118,10 +104,7 @@
</
script
>
<
template
>
<div
v-if=
"hasItemsToShow"
class=
"row-fluid clearfix node-detail-section verification-section"
>
<div
class=
"row-fluid clearfix node-detail-section verification-section"
>
<div
class=
"col-md-12"
>
<section-reveal-button
:button-title=
"__('Verification information')"
...
...
ee/app/assets/javascripts/geo_nodes/store/geo_nodes_store.js
View file @
d4d38997
...
...
@@ -70,8 +70,9 @@ export default class GeoNodesStore {
primaryRevision
:
rawNodeDetails
.
primaryRevision
,
replicationSlotWAL
:
rawNodeDetails
.
replication_slots_max_retained_wal_bytes
,
missingOAuthApplication
:
rawNodeDetails
.
missing_oauth_application
||
false
,
storageShardsMatch
:
rawNodeDetails
.
storage_shards_match
,
syncStatusUnavailable
:
rawNodeDetails
.
sync_status_unavailable
||
false
,
storageShardsMatch
:
rawNodeDetails
.
storage_shards_match
,
repositoryVerificationEnabled
:
rawNodeDetails
.
repository_verification_enabled
,
replicationSlots
:
{
totalCount
:
rawNodeDetails
.
replication_slots_count
||
0
,
successCount
:
rawNodeDetails
.
replication_slots_used_count
||
0
,
...
...
@@ -87,7 +88,6 @@ export default class GeoNodesStore {
successCount
:
rawNodeDetails
.
wikis_synced_count
||
0
,
failureCount
:
rawNodeDetails
.
wikis_failed_count
||
0
,
},
repositoryVerificationEnabled
:
rawNodeDetails
.
repository_verification_enabled
,
repositoriesChecksummed
:
{
totalCount
:
rawNodeDetails
.
repositories_count
||
0
,
successCount
:
rawNodeDetails
.
repositories_checksummed_count
||
0
,
...
...
spec/javascripts/geo_nodes/components/node_detail_sections/node_details_section_other_spec.js
View file @
d4d38997
...
...
@@ -31,14 +31,33 @@ describe('NodeDetailsSectionOther', () => {
describe
(
'
data
'
,
()
=>
{
it
(
'
returns default data props
'
,
()
=>
{
expect
(
vm
.
showSectionItems
).
toBe
(
false
);
expect
(
Array
.
isArray
(
vm
.
primaryNodeDetailItems
)).
toBe
(
true
);
expect
(
Array
.
isArray
(
vm
.
secondaryNodeDetailItems
)).
toBe
(
true
);
expect
(
vm
.
primaryNodeDetailItems
.
length
>
0
).
toBe
(
true
);
expect
(
vm
.
secondaryNodeDetailItems
.
length
>
0
).
toBe
(
true
);
});
});
describe
(
'
computed
'
,
()
=>
{
describe
(
'
nodeDetailItems
'
,
()
=>
{
it
(
'
returns array containing items to show under primary node when prop `nodeTypePrimary` is true
'
,
()
=>
{
const
vmNodePrimary
=
createComponent
(
mockNodeDetails
,
true
);
const
items
=
vmNodePrimary
.
nodeDetailItems
;
expect
(
items
.
length
).
toBe
(
2
);
expect
(
items
[
0
].
itemTitle
).
toBe
(
'
Replication slots
'
);
expect
(
items
[
0
].
itemValue
).
toBe
(
mockNodeDetails
.
replicationSlots
);
expect
(
items
[
1
].
itemTitle
).
toBe
(
'
Replication slot WAL
'
);
expect
(
items
[
1
].
itemValue
).
toBe
(
numberToHumanSize
(
mockNodeDetails
.
replicationSlotWAL
));
vmNodePrimary
.
$destroy
();
});
it
(
'
returns array containing items to show under secondary node when prop `nodeTypePrimary` is false
'
,
()
=>
{
const
items
=
vm
.
nodeDetailItems
;
expect
(
items
.
length
).
toBe
(
1
);
expect
(
items
[
0
].
itemTitle
).
toBe
(
'
Storage config
'
);
});
});
describe
(
'
storageShardsStatus
'
,
()
=>
{
it
(
'
returns `Unknown` when `nodeDetails.storageShardsMatch` is null
'
,
(
done
)
=>
{
vm
.
nodeDetails
.
storageShardsMatch
=
null
;
...
...
@@ -82,32 +101,6 @@ describe('NodeDetailsSectionOther', () => {
});
});
describe
(
'
methods
'
,
()
=>
{
describe
(
'
getPrimaryNodeDetailItems
'
,
()
=>
{
it
(
'
returns array containing items to show under primary node
'
,
()
=>
{
const
items
=
vm
.
getPrimaryNodeDetailItems
();
expect
(
items
.
length
).
toBe
(
2
);
expect
(
items
[
0
].
itemTitle
).
toBe
(
'
Replication slots
'
);
expect
(
items
[
0
].
itemValue
).
toBe
(
mockNodeDetails
.
replicationSlots
);
expect
(
items
[
1
].
itemTitle
).
toBe
(
'
Replication slot WAL
'
);
expect
(
items
[
1
].
itemValue
).
toBe
(
numberToHumanSize
(
mockNodeDetails
.
replicationSlotWAL
));
});
});
describe
(
'
getSecondaryNodeDetailItems
'
,
()
=>
{
it
(
'
returns array containing items to show under secondary node
'
,
()
=>
{
vm
.
nodeDetails
.
storageShardsMatch
=
true
;
const
items
=
vm
.
getSecondaryNodeDetailItems
();
expect
(
items
.
length
).
toBe
(
1
);
expect
(
items
[
0
].
itemTitle
).
toBe
(
'
Storage config
'
);
expect
(
items
[
0
].
itemValue
).
toBe
(
'
OK
'
);
});
});
});
describe
(
'
template
'
,
()
=>
{
it
(
'
renders component container element
'
,
()
=>
{
expect
(
vm
.
$el
.
classList
.
contains
(
'
other-section
'
)).
toBe
(
true
);
...
...
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