Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Add uniforms to starter app #417

Merged
merged 7 commits into from
May 26, 2020
Merged

Add uniforms to starter app #417

merged 7 commits into from
May 26, 2020

Conversation

kingsleyzissou
Copy link
Contributor

Description

Checklist
  • npm test passes
  • npm run build works
  • tests are included
  • documentation is changed or added

@kingsleyzissou kingsleyzissou requested a review from wtrocki May 22, 2020 16:18
"typescript": "3.8.3"
"typescript": "3.8.3",
"uniforms-ionic": "^0.0.11",
"uniforms": "v3.0.0-alpha.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pinged @radekmie to see when beta will be available.
DataSync starter itself is designed as template that various parties can push to production.

It will be nice to use some beta/prerelease version etc.
Happy to get alpha in as well

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we are almost there. My wishful plan is to get a final release candidate by the end of June, but I cannot guarantee that. You are not the only ones using the latest alpha though, therefore I'm quite confident about the stability of each release.

I think it should say "uniforms": "3.0.0-alpha.3", or "uniforms": "^3.0.0-alpha.3", though. Or is this v prefix something I don't know?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@radekmie Ah, that is good to know, looking forward to the release. I have found one or two issues using it in another project for a POC (mainly with JSON schema, I will create the issues. I'll fork the repo too and have a play around with it to see if I can sort that out.

You are correct on that, I will update it to "uniforms": "^3.0.0-alpha.3", but I think somehow yarn is still able to parse the v3.0.0-alpha.3

@wtrocki wtrocki changed the title Add basic uniforms to starter app Add uniforms to starter app May 22, 2020
import { LongTextField } from 'uniforms-ionic';

const s = new SimpleSchema({
title: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we use mongo we can add some of the elements now to the task to present capabilities of the forms. We use here an only string. Maybe some checkboxes etc.

Suggestions:

  • suggestedStartTime
  • suggestedStartDay
  • finishedNote (when task is completed it is marked with note)
  • incidents (Long string field to mark some problems with task)
  • priority
  • links (string with possible external references)

Copy link
Contributor

@wtrocki wtrocki May 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is optional, but we can copy some stuff from https://openvolunteer.org

I will add relationship later on as with relationship this will be much better (something like task having OneToOne comment rather than finishedNote field

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that sounds like a good idea. I can flesh this out a bit and add a few more fields to this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about this a little bit, maybe this part we can think about add it in as a separate PR. Just so we can get the forms added in without too much of a drastic change (from the UI side).

Copy link
Contributor

@wtrocki wtrocki May 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.. I'm happy to add this. I will create an issue and assign this to myself.

<IonToast
isOpen={showToast}
onDidDismiss={() => setShowToast(false)}
message={errorMessage}
position="top"
color="danger"
duration={2000}
duration={20000}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be too long. Not opinion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh whoops, that was me debugging. Will fix

"typescript": "3.8.3"
"typescript": "3.8.3",
"uniforms-ionic": "^0.0.11",
"uniforms": "v3.0.0-alpha.3",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we are almost there. My wishful plan is to get a final release candidate by the end of June, but I cannot guarantee that. You are not the only ones using the latest alpha though, therefore I'm quite confident about the stability of each release.

I think it should say "uniforms": "3.0.0-alpha.3", or "uniforms": "^3.0.0-alpha.3", though. Or is this v prefix something I don't know?

</IonItem>
<IonButton className="submit-btn" expand="block" type="submit">Create</IonButton>
</form>
<TaskForm handleSubmit={submit} model={{}} />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty object is the default value for model.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm overloading the TaskForm component for update and edit so I'm passing an empty object in for the add component and then passing in values for the edit/update component, which allows me to re-use the form

client/src/pages/UpdateTaskPage.tsx Outdated Show resolved Hide resolved
@kingsleyzissou
Copy link
Contributor Author

@wtrocki ping

@wtrocki
Copy link
Contributor

wtrocki commented May 26, 2020

Amazing job. Works like dream
Going to extend the model to add some nice uniforms combos etc.

@wtrocki wtrocki merged commit 3cf03a3 into master May 26, 2020
@wtrocki wtrocki deleted the uniforms branch May 26, 2020 11:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants