summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Vargas <jvargas@gitlab.com>2019-02-06 16:19:08 -0600
committerJose Vargas <jvargas@gitlab.com>2019-02-07 09:19:46 -0600
commit71c33e95fbdbc19c49cb6c0f9595836b05d9a288 (patch)
treef10764c43a99358f30dffa464b62403864817c75
parent8920224f057672a986edd04bdf6a70421054a68a (diff)
downloadgitlab-ce-71c33e95fbdbc19c49cb6c0f9595836b05d9a288.tar.gz
Clarified initial state for the project listtr-error-tracking-project-selection
Inlined translations
-rw-r--r--app/assets/javascripts/error_tracking_settings/components/project_dropdown.vue18
-rw-r--r--app/assets/javascripts/error_tracking_settings/store/state.js2
2 files changed, 8 insertions, 12 deletions
diff --git a/app/assets/javascripts/error_tracking_settings/components/project_dropdown.vue b/app/assets/javascripts/error_tracking_settings/components/project_dropdown.vue
index 0bf3ff089d1..363f609d6a7 100644
--- a/app/assets/javascripts/error_tracking_settings/components/project_dropdown.vue
+++ b/app/assets/javascripts/error_tracking_settings/components/project_dropdown.vue
@@ -12,12 +12,6 @@ export default {
GlDropdownItem,
Icon,
},
- noAuthTokenText: s__('ErrorTracking|To enable project selection, enter a valid Auth Token'),
- noConnectionText: s__(
- "ErrorTracking|Click 'Connect' to re-establish the connection to Sentry and activate the dropdown.",
- ),
- noProjectsText: s__('ErrorTracking|No projects available'),
- selectProjectText: s__('ErrorTracking|Select project'),
computed: {
...mapState(['token', 'projects', 'selectedProject']),
dropdownText() {
@@ -25,15 +19,17 @@ export default {
return this.getDisplayName(this.selectedProject);
}
if (!this.areProjectsLoaded || this.isProjectListEmpty) {
- return this.$options.noProjectsText;
+ return s__('ErrorTracking|No projects available');
}
- return this.$options.selectProjectText;
+ return s__('ErrorTracking|Select project');
},
projectSelectionText() {
if (this.token) {
- return this.$options.noConnectionText;
+ return s__(
+ "ErrorTracking|Click 'Connect' to re-establish the connection to Sentry and activate the dropdown.",
+ );
}
- return this.$options.noAuthTokenText;
+ return s__('ErrorTracking|To enable project selection, enter a valid Auth Token');
},
isProjectListEmpty() {
return this.areProjectsLoaded && this.projects.length === 0;
@@ -46,7 +42,7 @@ export default {
);
},
areProjectsLoaded() {
- return this.projects !== null;
+ return this.projects.length;
},
isDropdownDisabled() {
return !this.areProjectsLoaded || this.isProjectListEmpty;
diff --git a/app/assets/javascripts/error_tracking_settings/store/state.js b/app/assets/javascripts/error_tracking_settings/store/state.js
index e0d8856dcfa..7af9eb0bd97 100644
--- a/app/assets/javascripts/error_tracking_settings/store/state.js
+++ b/app/assets/javascripts/error_tracking_settings/store/state.js
@@ -2,7 +2,7 @@ export default () => ({
apiHost: '',
enabled: false,
token: '',
- projects: null,
+ projects: [],
selectedProject: null,
settingsLoading: false,
connectSuccessful: false,