ReproNim / reproschema-ui

UI to render ReproSchema based protocols and assessments.
https://www.repronim.org/reproschema-ui/
Other
3 stars 18 forks source link

should we make the timeRange input more general? #151

Open Remi-Gau opened 4 years ago

Remi-Gau commented 4 years ago

@sanuann @satra

I was going through the checklist for the PET guidelines and the time range widget seems to have some hard coded aspects that won't be usable for the needs for that use case.

I suspect though this might require some changes on the schema side to allow more flexibility, no?

<template>
  <div class="TimeRangeInput container ml-3 pl-3">
    <b-row class="mt-2 mb-2">
      <b-col class="mt-2 mb-2">
        went to bed:
        {{yesterday}}
        <vue-timepicker v-model="slept" format="hh:mm A"></vue-timepicker>
      </b-col>
      <b-col class="mt-2 mb-2">
        woke up:
        {{today}}
        <vue-timepicker v-model="woke" format="hh:mm A"></vue-timepicker>
      </b-col>
    </b-row>

    <div class="mt-2 mb-2" v-if="timeSlept != null">
      <div class="mt-2 mb-2" v-if="timeSlept < 0">
        <b-alert show variant="danger">You can't sleep negative hours!</b-alert>
      </div>
      <b-button v-else @click="sendData">Submit {{timeSlept}} hours</b-button>
    </div>
  </div>
</template>
satra commented 4 years ago

that seems like a hyper-specific sleep widget :) i wonder why you were looking at it @Remi-Gau and complaining ;)

yes, we should be able to create a general widget.

Remi-Gau commented 4 years ago

well the default sleep range it was giving was something like 10 hours / night... And I thought that must be a mistake as this is clearly more what I get over 3 nights. :laughing:

Remi-Gau commented 4 years ago

Another point on this issue: this widget requires a start and end point.

It might be worth considering creating a widget that allows entering a time duration directly: the use case has already arisen in the COBIDAS-PET case.

satra commented 4 years ago

i think these would be two different input types: