-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added special UUID string field that resolves #11 #13
Conversation
Just FYI, I use QR codes in my install. I get a digits only UUID is better but only by a few characters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I need to know why. It doesn't seem to do anything you cannot already do.
Also if we do add this, the documentation needs to be updated so this cannot be merged as is.
@@ -35,6 +35,9 @@ | |||
<v-layout wrap> | |||
<v-flex :class="field.size ? `xs${field.size}` : 'xs12 sm6 xl4'" v-for="field in group.fields" :key="field.name"> | |||
|
|||
<!-- Special ID field to give a different disabled property and maybe show shortened form --> | |||
<v-text-field :color="field.color ? field.color :'white'" v-if="field.type=='uuid_string'" v-model="item[field.name]" :label="field.displayName" :disabled="mostlyDisabled"></v-text-field> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? the disabled property is already field specific. What does URL encoding it do?
@@ -144,6 +147,12 @@ export default { | |||
return | |||
} | |||
return this.config.dataDefinition | |||
}, | |||
mostlyDisabled: function () { | |||
if (!this.$route.params.id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just enable it? If you leave it blank it will generate one. If you specify it, that will be used. If there is a conflict, the working branch version #12 will display an error.
That is how it functions today. Try it on the demo. It will not let you save if you modify the ID after the initial save. In #12 it will display the console error in a toast.
You are assuming something that is not a requirement for StoreDown. IDs happen to be autogenerated as UUIDs but they are not always or required to be. Any arbitrary value can be accepted as an ID. Hence why that field is a string. So if we do what you are asking we would need code to see the 130 bit and assume it is a UUID and all other values accept as is.
I doubt it. There are stubs for it today but dealing with printers is hell. So makes me happy to let the software that comes with my printer software do it. Plus, my magical utopia is RFIDs or something like AirTags. Where you can throw things in a box and it automagically updates/creates them. |
Unless my contributions become a minority, I am probably going to run this project with things I will use or see valuable. No hard feelings if you disagree and want to fork off. I ran OpenNote for years basically out of the kindness of my heart. So I have to use it and this is something that conflicts with how I use StoreDown(I have non uuid ids I imported from a spreadsheet I used before I wrote StoreDown). Hopefully my reasons and motivations make sense and we can still be friends. |
Zero hard feelings, don't worry. It's still an insanely useful tool and I'm grateful it's been made available in the first place. |
Using the special
uuid_string
type makes it refer to the mostlyDisabled computed property and only allows editing if there's no ID in the route. (I tried making it configurable by doing!this.$route.params.id && !this.config.dataDefinition.fields._id.disabled
but accessing that field that way doesn't make vue happy and I don't yet know enough to know why.) The default schema is untouched, so this shouldn't affect anyone else for now.This also sets the stage for special handling of the field for barcode integration features, from scanning intents to transforming input (for example, because of how QR codes encode values, a digit-only UUID representation is much more compact than its string equivalent, and making a proof of concept of this that works with any random keyboard scanner will be my next target.) Rebased onto PR #12 and everything tests out fine, should merge without conflicts. I readily admit I have very little idea what I'm doing, so unload all barrels and I'll do as directed to improve.
Potentially resolves #11.