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
84b69f34
Commit
84b69f34
authored
May 10, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moves mr widget options ee file into vue file
parent
75ee3d1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
91 deletions
+104
-91
app/assets/javascripts/vue_merge_request_widget/dependencies.js
...sets/javascripts/vue_merge_request_widget/dependencies.js
+1
-1
ee/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
...avascripts/vue_merge_request_widget/mr_widget_options.vue
+102
-89
spec/javascripts/vue_mr_widget/ee_mr_widget_options_spec.js
spec/javascripts/vue_mr_widget/ee_mr_widget_options_spec.js
+1
-1
No files found.
app/assets/javascripts/vue_merge_request_widget/dependencies.js
View file @
84b69f34
...
...
@@ -44,4 +44,4 @@ export { default as SquashBeforeMerge } from 'ee/vue_merge_request_widget/compon
export
{
default
as
notify
}
from
'
../lib/utils/notify
'
;
export
{
default
as
SourceBranchRemovalStatus
}
from
'
./components/source_branch_removal_status.vue
'
;
export
{
default
as
mrWidgetOptions
}
from
'
ee/vue_merge_request_widget/mr_widget_options
'
;
export
{
default
as
mrWidgetOptions
}
from
'
ee/vue_merge_request_widget/mr_widget_options
.vue
'
;
ee/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.
js
→
ee/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.
vue
View file @
84b69f34
<
script
>
import
{
n__
,
s__
,
__
,
sprintf
}
from
'
~/locale
'
;
import
CEWidgetOptions
from
'
~/vue_merge_request_widget/mr_widget_options
'
;
import
CEWidgetOptions
from
'
~/vue_merge_request_widget/mr_widget_options
.vue
'
;
import
WidgetApprovals
from
'
./components/approvals/mr_widget_approvals
'
;
import
GeoSecondaryNode
from
'
./components/states/mr_widget_secondary_geo_node
'
;
import
ReportSection
from
'
../vue_shared/security_reports/components/report_section.vue
'
;
...
...
@@ -118,6 +119,15 @@ export default {
return
this
.
checkReportStatus
(
this
.
isLoadingPerformance
,
this
.
loadingPerformanceFailed
);
},
},
created
()
{
if
(
this
.
shouldRenderCodeQuality
)
{
this
.
fetchCodeQuality
();
}
if
(
this
.
shouldRenderPerformance
)
{
this
.
fetchPerformance
();
}
},
methods
:
{
fetchCodeQuality
()
{
const
{
head_path
,
base_path
}
=
this
.
mr
.
codeclimate
;
...
...
@@ -167,97 +177,100 @@ export default {
};
},
},
created
()
{
if
(
this
.
shouldRenderCodeQuality
)
{
this
.
fetchCodeQuality
();
}
if
(
this
.
shouldRenderPerformance
)
{
this
.
fetchPerformance
();
}
},
template
:
`
<div class="mr-state-widget prepend-top-default">
<mr-widget-header :mr="mr" />
<mr-widget-pipeline
v-if="shouldRenderPipelines"
:pipeline="mr.pipeline"
:ci-status="mr.ciStatus"
:has-ci="mr.hasCI"
/>
<deployment
v-for="deployment in mr.deployments"
:key="deployment.id"
:deployment="deployment"
/>
<mr-widget-approvals
v-if="shouldRenderApprovals"
};
</
script
>
<
template
>
<div
class=
"mr-state-widget prepend-top-default"
>
<mr-widget-header
:mr=
"mr"
/>
<mr-widget-pipeline
v-if=
"shouldRenderPipelines"
:pipeline=
"mr.pipeline"
:ci-status=
"mr.ciStatus"
:has-ci=
"mr.hasCI"
/>
<deployment
v-for=
"deployment in mr.deployments"
:key=
"deployment.id"
:deployment=
"deployment"
/>
<mr-widget-approvals
v-if=
"shouldRenderApprovals"
:mr=
"mr"
:service=
"service"
/>
<report-section
class=
"js-codequality-widget mr-widget-border-top"
v-if=
"shouldRenderCodeQuality"
type=
"codequality"
:status=
"codequalityStatus"
:loading-text=
"translateText('codeclimate').loading"
:error-text=
"translateText('codeclimate').error"
:success-text=
"codequalityText"
:unresolved-issues=
"mr.codeclimateMetrics.newIssues"
:resolved-issues=
"mr.codeclimateMetrics.resolvedIssues"
:has-issues=
"hasCodequalityIssues"
/>
<report-section
class=
"js-performance-widget mr-widget-border-top"
v-if=
"shouldRenderPerformance"
type=
"performance"
:status=
"performanceStatus"
:loading-text=
"translateText('performance').loading"
:error-text=
"translateText('performance').error"
:success-text=
"performanceText"
:unresolved-issues=
"mr.performanceMetrics.degraded"
:resolved-issues=
"mr.performanceMetrics.improved"
:neutral-issues=
"mr.performanceMetrics.neutral"
:has-issues=
"hasPerformanceMetrics"
/>
<grouped-security-reports-app
v-if=
"shouldRenderSecurityReport"
:head-blob-path=
"mr.headBlobPath"
:base-blob-path=
"mr.baseBlobPath"
:sast-head-path=
"mr.sast.head_path"
:sast-base-path=
"mr.sast.base_path"
:sast-help-path=
"mr.sastHelp"
:dast-head-path=
"mr.dast.head_path"
:dast-base-path=
"mr.dast.base_path"
:dast-help-path=
"mr.dastHelp"
:sast-container-head-path=
"mr.sastContainer.head_path"
:sast-container-base-path=
"mr.sastContainer.base_path"
:sast-container-help-path=
"mr.sastContainerHelp"
:dependency-scanning-head-path=
"mr.dependencyScanning.head_path"
:dependency-scanning-base-path=
"mr.dependencyScanning.base_path"
:dependency-scanning-help-path=
"mr.dependencyScanningHelp"
:vulnerability-feedback-path=
"mr.vulnerabilityFeedbackPath"
:vulnerability-feedback-help-path=
"mr.vulnerabilityFeedbackHelpPath"
:pipeline-id=
"mr.securityReportsPipelineId"
/>
<div
class=
"mr-widget-section"
>
<component
:is=
"componentName"
:mr=
"mr"
:service=
"service"
/>
<report-section
class="js-codequality-widget mr-widget-border-top"
v-if="shouldRenderCodeQuality"
type="codequality"
:status="codequalityStatus"
:loading-text="translateText('codeclimate').loading"
:error-text="translateText('codeclimate').error"
:success-text="codequalityText"
:unresolved-issues="mr.codeclimateMetrics.newIssues"
:resolved-issues="mr.codeclimateMetrics.resolvedIssues"
:has-issues="hasCodequalityIssues"
/>
<report-section
class="js-performance-widget mr-widget-border-top"
v-if="shouldRenderPerformance"
type="performance"
:status="performanceStatus"
:loading-text="translateText('performance').loading"
:error-text="translateText('performance').error"
:success-text="performanceText"
:unresolved-issues="mr.performanceMetrics.degraded"
:resolved-issues="mr.performanceMetrics.improved"
:neutral-issues="mr.performanceMetrics.neutral"
:has-issues="hasPerformanceMetrics"
<section
v-if=
"mr.maintainerEditAllowed"
class=
"mr-info-list mr-links"
>
{{
s__
(
"
mrWidget|Allows edits from maintainers
"
)
}}
</section>
<mr-widget-related-links
v-if=
"shouldRenderRelatedLinks"
:state=
"mr.state"
:related-links=
"mr.relatedLinks"
/>
<grouped-security-reports-app
v-if="shouldRenderSecurityReport"
:head-blob-path="mr.headBlobPath"
:base-blob-path="mr.baseBlobPath"
:sast-head-path="mr.sast.head_path"
:sast-base-path="mr.sast.base_path"
:sast-help-path="mr.sastHelp"
:dast-head-path="mr.dast.head_path"
:dast-base-path="mr.dast.base_path"
:dast-help-path="mr.dastHelp"
:sast-container-head-path="mr.sastContainer.head_path"
:sast-container-base-path="mr.sastContainer.base_path"
:sast-container-help-path="mr.sastContainerHelp"
:dependency-scanning-head-path="mr.dependencyScanning.head_path"
:dependency-scanning-base-path="mr.dependencyScanning.base_path"
:dependency-scanning-help-path="mr.dependencyScanningHelp"
:vulnerability-feedback-path="mr.vulnerabilityFeedbackPath"
:vulnerability-feedback-help-path="mr.vulnerabilityFeedbackHelpPath"
:pipeline-id="mr.securityReportsPipelineId"
<source-branch-removal-status
v-if=
"shouldRenderSourceBranchRemovalStatus"
/>
<div class="mr-widget-section">
<component
:is="componentName"
:mr="mr"
:service="service" />
<mr-widget-maintainer-edit
:maintainerEditAllowed="mr.maintainerEditAllowed" />
<mr-widget-related-links
v-if="shouldRenderRelatedLinks"
:state="mr.state"
:related-links="mr.relatedLinks" />
<source-branch-removal-status
v-if="shouldRenderSourceBranchRemovalStatus"
/>
</div>
<div class="mr-widget-footer" v-if="shouldRenderMergeHelp">
<mr-widget-merge-help />
</div>
</div>
`
,
};
<div
class=
"mr-widget-footer"
v-if=
"shouldRenderMergeHelp"
>
<mr-widget-merge-help
/>
</div>
</div>
</template
spec/javascripts/vue_mr_widget/ee_mr_widget_options_spec.js
View file @
84b69f34
import
Vue
from
'
vue
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
mrWidgetOptions
from
'
ee/vue_merge_request_widget/mr_widget_options
'
;
import
mrWidgetOptions
from
'
ee/vue_merge_request_widget/mr_widget_options
.vue
'
;
import
MRWidgetService
from
'
ee/vue_merge_request_widget/services/mr_widget_service
'
;
import
MRWidgetStore
from
'
ee/vue_merge_request_widget/stores/mr_widget_store
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
...
...
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