Skip to content

Commit 6bff21f

Browse files
authored
Merge pull request #70 from LCOGT/dev
dev to prod
2 parents 67675a5 + 03d8f55 commit 6bff21f

16 files changed

+508
-93
lines changed

helm-chart/values-dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
replicaCount: 1
1+
replicaCount: 2
22

33
resources:
44
requests:

package-lock.json

Lines changed: 20 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"core-js": "^3.8.3",
2323
"dayjs": "^1.11.7",
2424
"dotenv": "^16.0.0",
25+
"filesize": "^10.0.11",
2526
"http": "^0.0.1-security",
2627
"http-browserify": "^1.7.0",
2728
"https": "^1.0.0",

src/assets/css/submissions.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@
7777
flex: 0 0 10%;
7878
}
7979

80+
[id^="group_associations-fieldgroup-advanced-target-collapse"] label{
81+
flex: 0 0 10%;
82+
}
83+
8084
#aliases-fieldgroup-advanced-target-collapse-0 label{
8185
flex: 0 0 10%;
8286
}

src/components/message-composition/DataPhotometry.vue

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,18 @@
7070
:errors="errors.brightness_error" @input="update" />
7171
</b-col>
7272
<b-col md="3">
73-
<ocs-custom-field v-model="photometry.bandpass" field="bandpass" label="Band:" :hide=false
73+
<ocs-custom-field v-if="!isTns" v-model="photometry.bandpass" field="bandpass" label="Band:" :hide=false
7474
:errors="errors.bandpass" @input="update" />
75+
<ocs-custom-select
76+
v-else
77+
v-model="photometry.bandpass"
78+
field="bandpass"
79+
label="Band:"
80+
:hide=false
81+
:options="getTnsValuesList('filters')"
82+
:errors="errors.bandpass"
83+
@input="update"
84+
/>
7585
</b-col>
7686
</b-form-row>
7787
<b-form-row>
@@ -89,12 +99,32 @@
8999
</ocs-custom-field>
90100
</b-col>
91101
<b-col md="3">
92-
<ocs-custom-field v-model="photometry.telescope" field="telescope" label="Telescope:" :hide=false
102+
<ocs-custom-field v-if="!isTns" v-model="photometry.telescope" field="telescope" label="Telescope:" :hide=false
93103
:errors="errors.telescope" @input="update" />
104+
<ocs-custom-select
105+
v-else
106+
v-model="photometry.telescope"
107+
field="telescope"
108+
label="Telescope:"
109+
:hide=false
110+
:options="getTnsValuesList('telescopes')"
111+
:errors="errors.telescope"
112+
@input="update"
113+
/>
94114
</b-col>
95115
<b-col md="3">
96-
<ocs-custom-field v-model="photometry.instrument" field="instrument" label="Instrument:" :hide=false
116+
<ocs-custom-field v-if="!isTns" v-model="photometry.instrument" field="instrument" label="Instrument:" :hide=false
97117
:errors="errors.instrument" @input="update" />
118+
<ocs-custom-select
119+
v-else
120+
v-model="photometry.instrument"
121+
field="instrument"
122+
label="Instrument:"
123+
:hide=false
124+
:options="getTnsValuesList('instruments')"
125+
:errors="errors.instrument"
126+
@input="update"
127+
/>
98128
</b-col>
99129
</b-form-row>
100130
<b-collapse :id="'advanced-photometry-collapse-' + index" class="mt-2">
@@ -111,10 +141,6 @@
111141
<ocs-custom-field v-model="photometry.catalog" field="catalog" label="Catalog:" :hide=false
112142
:errors="errors.catalog" @input="update" />
113143
</b-col>
114-
<b-col md="4">
115-
<ocs-custom-field v-model="photometry.group_associations" field="group_associations" label="Group Associations:" :hide=false
116-
:errors="errors.group_associations" @input="update" />
117-
</b-col>
118144
</b-form-row>
119145
<b-form-row>
120146
<b-col md="12">
@@ -149,6 +175,7 @@
149175
<script>
150176
import { OCSMixin } from 'ocs-component-lib';
151177
import _ from 'lodash';
178+
import { mapGetters } from "vuex";
152179
import {schemaDataMixin} from '@/mixins/schemaDataMixin.js';
153180
154181
export default {
@@ -173,6 +200,10 @@
173200
default: () => {
174201
return [];
175202
}
203+
},
204+
isTns: {
205+
type: Boolean,
206+
default: false
176207
}
177208
},
178209
data: function() {
@@ -184,9 +215,21 @@
184215
};
185216
},
186217
computed: {
218+
...mapGetters(["getTnsOptions"]),
187219
targetNames: function() {
188220
return _.map(this.targets, 'name');
189221
}
222+
},
223+
methods: {
224+
getTnsValuesList: function(category) {
225+
let tnsOptions = this.getTnsOptions;
226+
if (_.isArray(tnsOptions[category])) {
227+
return tnsOptions[category].sort((a, b) => a.localeCompare(b, undefined, {sensitivity: 'base'}));
228+
}
229+
else {
230+
return _.values(tnsOptions[category]).sort((a, b) => a.localeCompare(b, undefined, {sensitivity: 'base'}));
231+
}
232+
}
190233
}
191234
};
192235
</script>

src/components/message-composition/DataSection.vue

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<b-button block v-b-toggle:[tabName] :variant="getVariant" @click="addNewRowIfEmpty">
88
<b-row>
99
<b-col class="text-left error-icon">
10-
<b-icon v-if="!isEmpty && hasErrors" icon="exclamation-circle-fill" variant="danger"
10+
<b-icon v-if="hasErrors" icon="exclamation-circle-fill" variant="danger"
1111
:title="getErrorTooltipString()"></b-icon>
1212
</b-col>
1313
<b-col v-if="isEmpty" class="text-center" :style="textStyle">
@@ -29,13 +29,13 @@
2929
<input @change="loadCsv" type="file" :ref="section + 'File'" accept=".csv" hidden/>
3030
</b-button>
3131
</span>
32-
<span v-if="sectionShowSimple" class="text-right">
33-
<b-button class="br-0" title="Advanced UI" :disabled="onlySimple" @click="toggleSectionShowSimple()">
32+
<span v-if="sectionShowSimple && !onlySimple" class="text-right">
33+
<b-button class="br-0" title="Advanced UI" :disabled="disabled" @click="toggleSectionShowSimple()">
3434
<b-icon icon="diagram3" aria-hidden="true"></b-icon>
3535
</b-button>
3636
</span>
37-
<span v-if="!sectionShowSimple && !onlySimple" class="text-right">
38-
<b-button class="br-0" title="Simple UI" @click="toggleSectionShowSimple()">
37+
<span v-if="!sectionShowSimple || onlySimple" class="text-right">
38+
<b-button class="br-0" title="Simple UI" :disabled="disabled" @click="toggleSectionShowSimple()">
3939
<b-icon icon="card-list" aria-hidden="true"></b-icon>
4040
</b-button>
4141
</span>
@@ -64,14 +64,26 @@ export default {
6464
type: String,
6565
required: true
6666
},
67+
pluralDatatype: {
68+
type: String,
69+
required: false
70+
},
6771
isEmpty: {
6872
type: Boolean,
6973
default: false
7074
},
75+
sectionShowSimple: {
76+
type: Boolean,
77+
default: true
78+
},
7179
onlySimple: {
7280
type: Boolean,
7381
default: false
7482
},
83+
disabled: {
84+
type: Boolean,
85+
default: false
86+
},
7587
allowLoading: {
7688
type: Boolean,
7789
default: false
@@ -87,9 +99,7 @@ export default {
8799
visible: false,
88100
id: this.section,
89101
tabName: this.section.toLowerCase() + '-tab',
90-
capitalSection: _.capitalize(this.section),
91102
fileInput: null,
92-
sectionShowSimple: true
93103
}
94104
},
95105
watch: {
@@ -99,6 +109,12 @@ export default {
99109
}
100110
},
101111
computed: {
112+
capitalSection: function() {
113+
if (this.pluralDatatype){
114+
return this.pluralDatatype;
115+
}
116+
return _.capitalize(this.section);
117+
},
102118
hasErrors: function() {
103119
return !_.isEmpty(this.errors);
104120
},
@@ -111,13 +127,13 @@ export default {
111127
}
112128
},
113129
getVariant: function () {
114-
if (this.isEmpty) {
130+
if (this.hasErrors){
131+
return 'errors';
132+
}
133+
else if (this.isEmpty) {
115134
return 'empty';
116135
}
117136
else{
118-
if (this.hasErrors) {
119-
return 'errors';
120-
}
121137
return 'valid';
122138
}
123139
}
@@ -138,7 +154,10 @@ export default {
138154
let errorStr = 'Field Errors:\n';
139155
if (_.isArray(this.errors)){
140156
for (var i = 0; i < this.errors.length; i += 1) {
141-
if (!_.isEmpty(this.errors[i])) {
157+
if (_.isString(this.errors[i])) {
158+
errorStr += this.errors[i] + '\n';
159+
}
160+
else if (_.isObject(this.errors[i]) && !_.isEmpty(this.errors[i])) {
142161
_.forEach(this.errors[i], function(value, key) {
143162
errorStr += i + ': ' + key + '\n';
144163
});

src/components/message-composition/DataSpectroscopy.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@
179179
@input="update"
180180
/>
181181
</b-col>
182-
<b-col md="6">
183-
<ocs-custom-field v-model="spectroscopy.group_associations" field="group_associations" label="Group Associations:" :hide=false
184-
:errors="errors.group_associations" @input="update" />
185-
</b-col>
186182
</b-form-row>
187183
<b-form-row>
188184
<b-col md="12">
@@ -241,6 +237,10 @@
241237
default: () => {
242238
return [];
243239
}
240+
},
241+
isTns: {
242+
type: Boolean,
243+
default: false
244244
}
245245
},
246246
data: function() {

0 commit comments

Comments
 (0)