From 700d8b2d1fba405a379f688b640f7ed7b1b5efef Mon Sep 17 00:00:00 2001 From: eheinrich Date: Tue, 2 Mar 2021 17:07:48 -0800 Subject: [PATCH 01/15] Get formatFloat function from lib --- src/components/CoInvestigatorTable.vue | 5 ++--- src/utils.js | 15 +-------------- src/views/ProposalDetail.vue | 5 +++-- src/views/SemesterAdminTable.vue | 4 ++-- src/views/SemesterDetail.vue | 4 ++-- 5 files changed, 10 insertions(+), 23 deletions(-) diff --git a/src/components/CoInvestigatorTable.vue b/src/components/CoInvestigatorTable.vue index f46b9b2..8409a1f 100644 --- a/src/components/CoInvestigatorTable.vue +++ b/src/components/CoInvestigatorTable.vue @@ -115,16 +115,15 @@ diff --git a/src/views/RequestgroupDetail.vue b/src/views/RequestgroupDetail.vue index 804764f..de0a894 100644 --- a/src/views/RequestgroupDetail.vue +++ b/src/views/RequestgroupDetail.vue @@ -1,6 +1,48 @@ @@ -131,22 +134,21 @@ diff --git a/src/components/EditSciApplication.vue b/src/components/EditSciApplication.vue index 9fb24ad..38cd51a 100644 --- a/src/components/EditSciApplication.vue +++ b/src/components/EditSciApplication.vue @@ -553,7 +553,7 @@ export default { }, methods: { initializeDataEndpoint: function() { - return '/api/calls/' + this.callId + '/'; + return this.$store.state.urls.observationPortalApi + '/api/calls/' + this.callId + '/'; }, getSciAppData: function(callId, initialSciApp) { // Return sciApp data. If `initialSciApp` is passed in, the sciApp data that diff --git a/src/components/ProposalInvitations.vue b/src/components/ProposalInvitations.vue index b4e544e..f6a4fea 100644 --- a/src/components/ProposalInvitations.vue +++ b/src/components/ProposalInvitations.vue @@ -61,7 +61,7 @@ export default { }, methods: { initializeDataEndpoint: function() { - return '/api/invitations/?pending=true&proposal=' + this.proposalId; + return this.$store.state.urls.observationPortalApi + '/api/invitations/?pending=true&proposal=' + this.proposalId; }, getDeleteInvitationConfirmationMessage: function(email) { return 'Are you sure you want to delete the invitation for ' + email + ' for this proposal?'; diff --git a/src/components/SciApplications.vue b/src/components/SciApplications.vue index 2988f09..d6657bb 100644 --- a/src/components/SciApplications.vue +++ b/src/components/SciApplications.vue @@ -171,7 +171,7 @@ export default { methods: { initializeDataEndpoint: function() { // TODO: Paginate results - let endpoint = '/api/scienceapplications/?only_authored=true&limit=1000&ordering=-call__semester'; + let endpoint = this.$store.state.urls.observationPortalApi + '/api/scienceapplications/?only_authored=true&limit=1000&ordering=-call__semester'; if (this.isSciCollab) { return endpoint + '&proposal_type=COLAB'; } else { diff --git a/src/views/Apply.vue b/src/views/Apply.vue index 899f0b0..f990c86 100644 --- a/src/views/Apply.vue +++ b/src/views/Apply.vue @@ -125,7 +125,7 @@ export default { }, methods: { initializeDataEndpoint: function() { - return '/api/calls/?only_open=true'; + return this.$store.state.urls.observationPortalApi + '/api/calls/?only_open=true'; }, getTimeRequested: function(callId, telescopeName) { for (let call of this.data.results) { diff --git a/src/views/ObservationDetail.vue b/src/views/ObservationDetail.vue index f3b0586..a2d39b3 100644 --- a/src/views/ObservationDetail.vue +++ b/src/views/ObservationDetail.vue @@ -29,7 +29,7 @@ export default { }, methods: { initializeDataEndpoint: function() { - return '/api/observations/' + this.id + '/'; + return this.$store.state.urls.observationPortalApi + '/api/observations/' + this.id + '/'; } } }; diff --git a/src/views/ProposalDetail.vue b/src/views/ProposalDetail.vue index 8aecb74..f4db3a1 100644 --- a/src/views/ProposalDetail.vue +++ b/src/views/ProposalDetail.vue @@ -294,7 +294,7 @@ export default { }, methods: { initializeDataEndpoint: function() { - return '/api/proposals/' + this.id + '/'; + return this.$store.state.urls.observationPortalApi + '/api/proposals/' + this.id + '/'; }, clearMessages: function() { this.$store.commit('clearAllMessages'); diff --git a/src/views/SciApplicationCombinedPdf.vue b/src/views/SciApplicationCombinedPdf.vue index 319069c..59344fe 100644 --- a/src/views/SciApplicationCombinedPdf.vue +++ b/src/views/SciApplicationCombinedPdf.vue @@ -90,7 +90,7 @@ export default { }, methods: { initializeDataEndpoint: function() { - return '/api/scienceapplications/' + this.sciAppId + '/'; + return this.$store.state.urls.observationPortalApi + '/api/scienceapplications/' + this.sciAppId + '/'; }, createCombinedPdf: function(uploadedPdfArrayBuffer) { var options = { diff --git a/src/views/SciApplicationDetail.vue b/src/views/SciApplicationDetail.vue index cdf0a8d..deeea3b 100644 --- a/src/views/SciApplicationDetail.vue +++ b/src/views/SciApplicationDetail.vue @@ -43,7 +43,7 @@ export default { }, methods: { initializeDataEndpoint: function() { - return '/api/scienceapplications/' + this.sciAppId + '/'; + return this.$store.state.urls.observationPortalApi + '/api/scienceapplications/' + this.sciAppId + '/'; } } }; diff --git a/src/views/SemesterAdminTable.vue b/src/views/SemesterAdminTable.vue index d6c0a23..aad3d08 100644 --- a/src/views/SemesterAdminTable.vue +++ b/src/views/SemesterAdminTable.vue @@ -315,7 +315,7 @@ export default { }, methods: { initializeDataEndpoint: function() { - return this.generateDataEndpoint(); + return this.$store.state.urls.observationPortalApi + this.generateDataEndpoint(); }, generateDataEndpoint: function() { return '/api/semesters/' + this.id + '/timeallocations/'; diff --git a/src/views/SemesterDetail.vue b/src/views/SemesterDetail.vue index 4ab17c7..817fe86 100644 --- a/src/views/SemesterDetail.vue +++ b/src/views/SemesterDetail.vue @@ -128,7 +128,7 @@ export default { }, methods: { initializeDataEndpoint: function() { - return '/api/semesters/' + this.id + '/proposals/'; + return this.$store.state.urls.observationPortalApi + '/api/semesters/' + this.id + '/proposals/'; }, getAllocationForInstrument: function(allocation, instrumentType) { let hours = 0; diff --git a/src/views/SemesterDetailCurrent.vue b/src/views/SemesterDetailCurrent.vue index caa48c8..2b37fe1 100644 --- a/src/views/SemesterDetailCurrent.vue +++ b/src/views/SemesterDetailCurrent.vue @@ -21,7 +21,7 @@ export default { methods: { initializeDataEndpoint: function() { let datetimeNow = moment.utc().format(datetimeFormat); - return '/api/semesters/?semester_contains=' + datetimeNow; + return this.$store.state.urls.observationPortalApi + '/api/semesters/?semester_contains=' + datetimeNow; }, initializeSetNotFoundOnEmptyList: function() { return true; diff --git a/src/views/UpdateSciApplication.vue b/src/views/UpdateSciApplication.vue index bf3cc3f..0f80676 100644 --- a/src/views/UpdateSciApplication.vue +++ b/src/views/UpdateSciApplication.vue @@ -27,7 +27,7 @@ export default { }, methods: { initializeDataEndpoint: function() { - return '/api/scienceapplications/' + this.sciAppId + '/?status=DRAFT'; + return this.$store.state.urls.observationPortalApi + '/api/scienceapplications/' + this.sciAppId + '/?status=DRAFT'; } } }; From 50f8de93910a481dac665c497b857771c34a8364 Mon Sep 17 00:00:00 2001 From: eheinrich Date: Mon, 8 Mar 2021 18:02:38 -0800 Subject: [PATCH 10/15] Rename variable --- src/components/AirmassTelescopeStates.vue | 4 ++-- src/views/ObservationDetail.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/AirmassTelescopeStates.vue b/src/components/AirmassTelescopeStates.vue index 6a5465d..d941f21 100644 --- a/src/components/AirmassTelescopeStates.vue +++ b/src/components/AirmassTelescopeStates.vue @@ -56,7 +56,7 @@ export default { { eventType: 'SEQUENCER_DISABLED', text: 'Manually Disabled' }, { eventType: 'NO_CONNECTION', text: 'No Connection to Telescope' } ], - additionalEventTypeText: { + eventTypeReasonPrefix: { AVAILABLE: 'Available', NOT_OK_TO_OPEN: '', SEQUENCER_DISABLED: 'Manually Disabled', @@ -84,7 +84,7 @@ export default { } else if (this.initializingEventTypeCodes.indexOf(event['event_type']) > -1) { reason = ': Telescope initializing'; } - let additionalText = _.get(this.additionalEventTypeText, [event['event_type']], ''); + let additionalText = _.get(this.eventTypeReasonPrefix, [event['event_type']], ''); this.telescopeStatesData[telescope][i]['event_reason'] = additionalText + reason; } } diff --git a/src/views/ObservationDetail.vue b/src/views/ObservationDetail.vue index a2d39b3..a19b0dd 100644 --- a/src/views/ObservationDetail.vue +++ b/src/views/ObservationDetail.vue @@ -7,7 +7,7 @@ + />