Giter Site home page Giter Site logo

kelpie's People

Contributors

dependabot[bot] avatar ember-tomster avatar fozy81 avatar

Watchers

 avatar  avatar

kelpie's Issues

Correctly display non-multiple entry question

  • Remove response display beneath question
  • Add multi-entry to form/form-template models (this should be form level not question/question-template level)
  • Add Multi-entry option to form editing component
  • Save multi-entry true/false to form and template models (how to best? can we use @value? or selectOptions in form-card.js?
  • Upon save - check if form is multi-entry
  • If form multi-entry then save responses in new form
  • If form not multi-entry update existing form

Edit method forms (remove)

Need ability to delete forms from method and some ability (if only by deletion) to re-order forms.

  • Add removeForm function to edit-method.hbs template
  • Pass formTemplate.id into removeForm function
  • Pass method.id into removeForm function
  • Peek method.formTemplates using method.id to find method
  • Remove formTemplates from array if matches method.id (need filter Array?) based on id key?

Editing forms changes type

If question not changed, they are reset to text type input. Only update question which have been edited.

Fix ordering of forms

Form order should remain the same as order they are added to task - manually or by adding method(s).

  • Check what influences the ordering of forms currently - see forms component
  • Base order of forms on datetime created/added to task?

Upon adding new form go to edit form mode

Currently adding a new form will added it but best if new form is added but opens the edit form mode.

Initially idea: Needs create form component to update this.edit == true? pass this down are attribute on form-card.hbs?

UPDATE: Need to change data on form model - include edit attribute - then change that attribute whether in edit mode or not

  • New form added - then open edit
  • Existing form added - then don't open edit
  • Save and update form on first edit? Or offer options to save and update?

Multi entry forms create forms for each

Currently multi-entry forms add multi entries to the same form. Instead, responses entered and saved together should create a new form. This keeps each 'save' into the form identifiable with a unique formEntryId. However, we don't want to display a form for each entry in the task. So multi-entry forms will only display a form for the first replicate of that formId. But when clicked on will display all responses for that form beneath the form entry section.

  • Add rep to form model (and demo data)
  • only display the first rep multi-entry form when opening task
  • save each entry to the multi-entry forms as a separate form within the task (current each entry is appended as a extra questions not a separate form)
  • when the multi-entry form is clicked on - display multi-entry responses beneath (need to filter form array for current multi-entry form being viewed)
  • display responses below in a way which splits them to indicate each form / entry made. So responses saved at the same time appear as a block.
  • rep is hardcoded to 2 - need to increment for each mutli-entry form add (maybe make true / false) - can't reliably increment number because distributed database?
  • style each entry based on form Id - e.g. alternating colours to split up entries

Use views to summarise percentage completion

Issue:
Currently Projects don't show the percentage completion. Currently % completion is calculated dynamically for forms and tasks. This is not likely to remain scale-able as number of questions, forms, tasks and projects increases. Furthermore, project route does not currently load tasks, forms and questions models partly for performance so % completion can't be dynamically calculated in that route.

Suggestions:

  1. Add completion % to Projects using couchdb view. Problem is importing into reporting database - would rather store this completion info within project document?
  2. Use changes feed to monitor updates to questions and update project, task, forms documents accordingly? (due to network delays and/or caching, completion info could get out of sync with actual completion info)
  3. Use js helper function to calculate and update - projects, tasks, forms accordingly. I think this is preferred? All data will be in memory so should be quick to update and cascade to forms, containers, tasks and projects? Can use peekRecord to peek the form, update completion, another function to peek the container and update, then task, then project?
  • Create view based on documents filtered on type 'question' (make sure question includes project, test, form ids)
  • Remove questions that are optional or contain default responses
  • Map by project, task, form
  • Reduce by proportion of questions completed
  • Query View by project id to display % completion on project card

Add functionality to add question button

Write code to allow 'add question' button to work.

Need to add empty question? Increment counter each time 'add question' is clicked. Then display the empty question for number of count?

on 'click' this.addQuestiont then @Tracked count this.count {let count += 1 }

Create addQuestion component?

  • add/create addQuestion function
  • check function works (console.log('works') etc )
  • @track question count = '' ?
  • On click increment counter this.countt
  • Display count and check it works
  • In template for each addQuestion - display message
  • for each question display a addQuestion component?

Multiple entry repsonse can't be blank

Multi entry response can't be blank, it will use previous response value.

  • Set value to '' until updated
  • Possibly conflicts with single entry requirements?

Add container model attribute

A form may or may not have an associated container such as a sample bottle or packaging box. A form can have a default container associated with it which is added by default when the form is added to task. This default container is selected when editing the form.

When form(s) share a container - we will need to display that container to click on. Once clicked on the container will open and display the forms inside. This could be recursive (Russian doll style). With a box containing smaller boxes, containing bottles etc.

Forms without containers will be display as currently - directly in the Task template. These are rendered first (i.e. container == NULL)

If container == true, then only display the container details. When the user clicks on the container, filter the forms for matching containerRecordID and display those forms.

To allow recursive containers, parentContainerId == containerId (displayed at top level), then when clicking on the top level /parent container filter for other containers where parentContainerId == containerId (of top level container) and so on...

  • Add containerId to form model
  • Create container model (containerId, title, description)
  • Add container relation form & formTemplate model
  • Add unique id of container instance onto form using shortId - needs to also work with multi-entry forms
  • Add option to add default container when editing form
  • edit addTemplateForm() function to deal with adding container to formTemplates and form model
  • Create menu to create containers
  • Allowing selecting and adding of existing containers to form
  • Allow editing of container attributes
  • Allow default containers to be added when associated methods are added
  • Only render container == NULL forms at top level of Task template
  • Create component to render containers lower on Task template based on shortId of container instance
  • Add ContainerMainId and containerLevelId to form model
  • Render containers where containerLevelId == containerId (recursively)
  • Create menu to add form into container (once container is clicked on) maybe existing add form component?

change models names

Update models:

template - formTemplate i.e. model: form-template.js store: formTemplate
action - questionTemplate

Update associated components / routes / templates

Add models
projectTemplate
taskTemplate

Remove records to archive (don't destroy)

Currently if removing record (project, form, tasks etc) They are destroyed. Instead only add archived = true flag. And don't display. Then these can be restored or destroyed with extra steps.

  • add archive flag in models
  • display archived records when requested in menu
  • restore selected archived records
  • or destroy selected archived records

Offline local db only sync filtered subset of documents

Issue:
Currently all remote documents are synced to local db. This won't scale.

Fix:
Only sync a limited number of most relevant documents to local db, but if online, allow search/data entry for all remote documents?

Steps:

  • Check if offline or online
  • If offline only use local db
  • If online only use remote db
  • Filter local db based on collection date / completion date / recents

Add sub tasks

Update models

  • Create container model
  • ContainerTemplate
  • Add containers to container.level = task.id by default and then matches to parent container.id

Create container component

  • Takes arguments and level from container/task
  • recursive if container level matches container.id of level argument

Update task component

  • Add container component to tasks component
  • Takes arguments and level from container/task

Edit form updating and form creation code

  • Make sure form component now has access to container model and current level in task
  • Check formTemplates's default containerTemplate, check if container matching that default exists in task and at same level.
  • Note, may need special exception of empty/null default container which creates 'null' container.
  • If not, create an instance of that container.
  • Add form to container (copy down taskId, projectId?)
  • Add question to form (copy down mainTaskId, projectId, formId?)

Does this work easily with updates or changes etc?

  • change taskTemplate? Yes - updates relationship? separate table to join - but okay
  • change container? Yes - updates relationship? separate table to join - but okay
  • change container on form? Yes - need to check container different to task container at that levelId, if so add new sub-task at that levelId
  • add container to task? Yes - create new subtask with container details.
  • delete sub-task? Yes - but need recursively find all related sub-tasks and archive etc.
  • query all responses from task? Yes - use mainTaskId? Need view/index?

Archive methods

Option to archive methods if no longer needed (similar to forms)

  • Add archive button to edit-method component

Edit multi-entry responses

After adding a response to multi-entry form, make the responses displayed below the form editable.

Create response table component.

  • Use as form question component?
  • Re-write question component to include submit form button?
  • Design the different modes of operation. Multi-form submit / single submit / multi update / single update?
  • Design the function required (submit, update, multiform, singleform, cancel, open form, close form, open entered, open menu....)
  • Add menu to edit form to allow removal of form or add form comment?
  • Don't use submit button? Just update on the fly?

Save questions during 'save' button action

Issue

When clicking save button while editing form, the questions aren't saved correctly. However, if 'save and add' button clicked the questions and form are correctly saved and added to the task.

Expected

When clicking save button the form and the related questions should be saved correctly. They can then later been added to a task or method, and all related questions displayed.

To do

  • Find out the difference in saving action between 'save' and 'save and add'
  • Implement correct 'save' action to correctly save questions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.