|
170 | 170 | width: '100%', |
171 | 171 | }; |
172 | 172 | }, |
173 | | - bodyStyle() { |
174 | | - if (this.ui === 'section' || this.ui === 'multipart') { |
175 | | - return { |
176 | | - padding: 0, |
177 | | - }; |
178 | | - } |
179 | | - return {}; |
180 | | - }, |
181 | 173 | ui() { |
182 | 174 | /* eslint-disable */ |
183 | 175 | if (this.data['@type'] && this.data['@type'][0] === "http://schema.repronim.org/Activity") { |
|
229 | 221 | fieldData() { |
230 | 222 | return this.data; |
231 | 223 | }, |
232 | | - findPassOptions() { |
233 | | - if (this.data['http://schema.repronim.org/responseOptions']) { |
234 | | - // when responseOptions is a remote object |
235 | | - if (Object.keys(this.data['http://schema.repronim.org/responseOptions'][0]).indexOf('@id') > -1) { |
236 | | - this.getRequiredVal(); |
237 | | - return this.requireVal; |
238 | | - } |
239 | | - // when responseOptions in embedded in item object itself |
240 | | - if (this.data['http://schema.repronim.org/responseOptions'][0]) { |
241 | | - // make sure the requiredValue key is defined |
242 | | - // todo: requiredValue has moved to activity level, so change the code here |
243 | | - if (this.data['http://schema.repronim.org/responseOptions'][0]['http://schema.org/valueRequired']) { |
244 | | - return this.data['http://schema.repronim.org/responseOptions'][0]['http://schema.org/valueRequired'][0]['@value']; |
245 | | - } |
246 | | - } |
247 | | - } |
248 | | - return false; |
249 | | - }, |
250 | 224 | }, |
251 | 225 | methods: { |
252 | | - getRequiredVal() { // todo: this needs to change. requiredValue is in activity level now |
253 | | - jsonld.expand(this.data['http://schema.repronim.org/responseOptions'][0]['@id']) |
254 | | - .then((rsp) => { |
255 | | - this.requireVal = rsp[0]['http://schema.org/valueRequired'][0]['@value']; |
256 | | - // eslint-disable-next-line no-unused-vars |
257 | | - }).catch((e) => { |
258 | | - // console.log(240, 'constraint error', e); |
259 | | - jsonld.expand(`${this.data['http://schema.repronim.org/responseOptions'][0]['@id']}.jsonld`).then((resp) => { |
260 | | - // console.log(250, resp); |
261 | | - this.requireVal = resp[0]['http://schema.org/valueRequired'][0]['@value']; |
262 | | - // eslint-disable-next-line no-unused-vars |
263 | | - }).catch((e1) => { |
264 | | - // console.log(252, e1); |
265 | | - }); |
266 | | - }); |
267 | | - }, |
268 | 226 | getValueConstraintsData(url) { |
269 | 227 | jsonld.expand(url).then((rsp) => { |
270 | 228 | this.valueC = rsp[0]; |
|
0 commit comments