qube_rails 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +216 -0
- data/README.md +242 -69
- data/app/assets/javascripts/qube_rails/question.js +425 -38
- data/app/assets/stylesheets/qube_rails.css +1201 -907
- data/app/controllers/qube_rails/connections_controller.rb +23 -6
- data/app/controllers/qube_rails/questions_controller.rb +39 -7
- data/app/controllers/qube_rails/runs_controller.rb +4 -3
- data/app/models/qube_rails/connection.rb +22 -2
- data/app/models/qube_rails/run.rb +28 -10
- data/app/views/qube_rails/_error.html.erb +2 -2
- data/app/views/qube_rails/_question.html.erb +4 -1
- data/app/views/qube_rails/question/_choice.html.erb +36 -11
- data/app/views/qube_rails/question/_exit_button.html.erb +8 -0
- data/app/views/qube_rails/question/_field.html.erb +4 -3
- data/app/views/qube_rails/question/_footer.html.erb +19 -5
- data/app/views/qube_rails/question/_pick.html.erb +8 -3
- data/app/views/qube_rails/question/_picks.html.erb +4 -2
- data/app/views/qube_rails/question/_question.html.erb +22 -7
- data/app/views/qube_rails/question/_submit.html.erb +9 -0
- data/app/views/qube_rails/question/fields/_boolean.html.erb +2 -2
- data/app/views/qube_rails/question/fields/_number.html.erb +2 -2
- data/app/views/qube_rails/question/fields/_rows.html.erb +17 -4
- data/app/views/qube_rails/question/fields/_search.html.erb +3 -1
- data/app/views/qube_rails/question/fields/_select.html.erb +6 -5
- data/app/views/qube_rails/question/fields/_text.html.erb +2 -2
- data/app/views/qube_rails/question/rows/_segmented.html.erb +3 -1
- data/app/views/qube_rails/run_status/_detail.html.erb +5 -1
- data/app/views/qube_rails/run_status/_status.html.erb +5 -2
- data/config/locales/en.yml +23 -1
- data/db/migrate/20261031000000_add_qube_connection_type_and_run_headline.rb +12 -0
- data/lib/generators/qube_rails/templates/initializer.rb.tt +12 -4
- data/lib/qube_rails/configuration.rb +3 -2
- data/lib/qube_rails/connection_events.rb +3 -0
- data/lib/qube_rails/operation.rb +115 -32
- data/lib/qube_rails/question_view.rb +235 -29
- data/lib/qube_rails/rows_view.rb +18 -5
- data/lib/qube_rails/run_status_view.rb +12 -7
- data/lib/qube_rails/storyboard/ask_about_add.json +8 -10
- data/lib/qube_rails/storyboard/choose.json +8 -5
- data/lib/qube_rails/storyboard/enum_select.json +4 -3
- data/lib/qube_rails/storyboard/missing_record.json +10 -13
- data/lib/qube_rails/storyboard/name_clash.json +10 -18
- data/lib/qube_rails/storyboard/near_match.json +12 -14
- data/lib/qube_rails/storyboard/number_boolean.json +4 -3
- data/lib/qube_rails/storyboard/record_search.json +14 -15
- data/lib/qube_rails/storyboard/refusal.json +10 -18
- data/lib/qube_rails/storyboard/rows.json +11 -14
- data/lib/qube_rails/storyboard.rb +8 -3
- data/lib/qube_rails/sync_status.rb +4 -2
- data/lib/qube_rails/version.rb +1 -1
- data/lib/qube_rails/view_helpers.rb +4 -2
- data/lib/qube_rails.rb +2 -2
- metadata +5 -2
data/README.md
CHANGED
|
@@ -52,7 +52,7 @@ Relative to where the engine is mounted (`"/"` above):
|
|
|
52
52
|
|
|
53
53
|
| Route | What it does |
|
|
54
54
|
| --- | --- |
|
|
55
|
-
| `POST quickbooks/connections` | Connect, for the signed-in account (`current_account`). Sends its newest connection that has never connected (`pending` or `setup_cancelled`) back through setup, so clicking Connect again doesn't pile up connections. Makes a new one (the row, then QuBe Sync's connection with the row's webhook URL and `config.connection_type
|
|
55
|
+
| `POST quickbooks/connections` | Connect, for the signed-in account (`current_account`). Sends its newest connection that has never connected (`pending` or `setup_cancelled`) back through setup, so clicking Connect again doesn't pile up connections. Makes a new one (the row, then QuBe Sync's connection with the row's webhook URL and its type, then its `qube_id`, with an optional `name`) when the account has none of that type, or with `new=1`. The type is the `type` param, `realtime` or `standard`, else `config.connection_type` (`"realtime"` by default, since workflows run only on realtime connections); any other `type` answers 422. The row keeps it as `connection_type`. Redirects (303) to the setup. With `simulated=1`, outside production, it makes a new connection to a simulated QuickBooks company file instead, connected as it's made, and redirects back: for testing with no Windows computer. In production that answers 404. |
|
|
56
56
|
| `POST quickbooks/connections/:id/onboarding` | One of the signed-in account's connections, back through setup, with its webhook URL brought up to date (or made at QuBe Sync, for a row QuBe Sync never answered). Another account's connection answers 404. |
|
|
57
57
|
| `DELETE quickbooks/connections/:id` | Disconnects one of the signed-in account's connections: QuBe Sync deletes its connection (already gone counts), then the row goes, with its runs, requests and QuickBooks links. Refused while a run or request hasn't ended; another account's connection answers 404. Show its message with `render "qube_rails/error"`. |
|
|
58
58
|
| `POST webhooks/qube/runs/:id` | A run's webhooks. |
|
|
@@ -61,7 +61,7 @@ Relative to where the engine is mounted (`"/"` above):
|
|
|
61
61
|
| `POST qube/questions/runs/:id` | Your user's answer to the run's question, from the partial. Behind your sign-in and CSRF. |
|
|
62
62
|
| `GET qube/questions/runs/:id/search` | A record field's matches, as JSON. Behind your sign-in. |
|
|
63
63
|
| `POST qube/runs/:id/redeliver` | A run that looks stuck (`Run#looks_stuck?`: confirmed, not ended, and quiet for 10 minutes while running or waiting on a question this app never got): asks QuBe Sync to send its latest event again, from the run status partial's "Check for updates" button. Behind your sign-in and CSRF, and `authorize_question`. |
|
|
64
|
-
| `POST qube/runs/:id/retry_start` | A start QuBe Sync never confirmed, sent again with the same reference, from the run status partial. Behind your sign-in and CSRF, and `authorize_question`. |
|
|
64
|
+
| `POST qube/runs/:id/retry_start` | A start QuBe Sync never confirmed, or one refused as `realtime_required`, sent again with the same reference, from the run status partial. Behind your sign-in and CSRF, and `authorize_question`. |
|
|
65
65
|
| `GET qube/storyboard`, `GET qube/storyboard/:screen` | Every screen the partials show, from sample data, in your layout ([Styling](#styling)). Only while `config.storyboard` is true (404 otherwise); behind your sign-in. Its search (`GET qube/storyboard/:screen/search`) answers from the samples and its forms post to a no-op (`POST qube/storyboard/:screen/answer`): nothing reaches QuBe Sync or the database. |
|
|
66
66
|
|
|
67
67
|
The webhook routes verify the signature (401 if it doesn't check out), answer 404 when the row
|
|
@@ -112,10 +112,11 @@ end
|
|
|
112
112
|
| `authorize_question` | `->(controller, record, run) { true }` when the signed-in user may answer or search that run's question. The run carries its `operation` and its `connection` (whose `owner` connected it). Only `true` allows; anything else answers 404 (search: `[]` with 404), as for a missing run, and is logged. | allows only when `current_account` owns the run's connection (compared by type and id, so a nil or unsaved account never matches) |
|
|
113
113
|
| `enqueue` | `->(delivery) { ... }`, handing `{ kind:, id:, body: }` (kind `"run"` or `"connection"`) to a queue | ActiveJob: `QubeRails::WebhookJob` on `queue` |
|
|
114
114
|
| `queue` | the ActiveJob queue | `:default` |
|
|
115
|
+
| `connection_type` | the type Connect makes connections as: `"realtime"` (workflows run only on these) or `"standard"` (for an app that only queues requests); anything else raises `ArgumentError`. Connect's `type` param overrides it per click. | `"realtime"` |
|
|
115
116
|
| `job_attempts` | how many times `QubeRails::WebhookJob` runs a delivery whose work raised, with a growing wait, before it logs an error and raises to your adapter (read when the job class loads) | `10` |
|
|
116
117
|
| `dedupe` | where each run's taken notification delivery ids are kept: `once(run, delivery_id) { }`, or `seen?(key)` / `remember(key)` | `QubeRails::DatabaseDedupe`: the engine's `qube_notifications` table, in the handler's transaction |
|
|
117
118
|
| `parent_controller` | the controller onboarding and the questions inherit | `"ApplicationController"` |
|
|
118
|
-
| `ui_classes` | your CSS classes for the engine's screens, by piece (`{ button: "
|
|
119
|
+
| `ui_classes` | your CSS classes for the engine's screens, by piece (`{ button: "rounded-md bg-indigo-600 px-3 py-2 text-white" }`), added beside the `qube-` classes ([Styling](#styling)); an unknown piece raises, naming them | `{}` |
|
|
119
120
|
| `storyboard` | whether `GET qube/storyboard` shows every screen with sample data | `Rails.env.development?` |
|
|
120
121
|
| `api_key` | | `QUBE_API_KEY` |
|
|
121
122
|
| `base_url` | | `QUBE_URL`, else `https://qubesync.com` |
|
|
@@ -208,10 +209,14 @@ dropped ...") and returns.
|
|
|
208
209
|
|
|
209
210
|
A `QubeRails::Connection` is one company file: `owner` (your account), `qube_id` (QuBe Sync's
|
|
210
211
|
id, nil until it answers), `name`, `status` (`pending`, `connected`, `setup_cancelled`,
|
|
211
|
-
`stalled`), `stall_reason` and `
|
|
212
|
-
account's.
|
|
212
|
+
`stalled`), `stall_reason`, `revision` and `connection_type` (`realtime`, `standard` or
|
|
213
|
+
`simulated`). `QubeRails::Connection.owned_by(account)` lists an account's.
|
|
213
214
|
|
|
214
|
-
|
|
215
|
+
A connection's type can't be changed through the API: the customer upgrades a standard one to
|
|
216
|
+
realtime from its page in the QuBe Sync dashboard. Its next event carries the new type, and
|
|
217
|
+
`connection.refresh_type!` reads it at once (`GET /api/v2/connections/:id`).
|
|
218
|
+
|
|
219
|
+
Its own events (QUBE_WEBHOOK_URL/connections/<id>) update `status`, `stall_reason`, `connection_type` and `revision`
|
|
215
220
|
when the event is for that connection (`qube_id`) and newer than the last one applied, under the
|
|
216
221
|
row's lock. Then your class runs, with `connection` and `owner`.
|
|
217
222
|
|
|
@@ -314,18 +319,21 @@ module QuickbooksDesktop
|
|
|
314
319
|
})
|
|
315
320
|
end
|
|
316
321
|
|
|
317
|
-
#
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if path == "customer_ref"
|
|
324
|
-
record.customer
|
|
325
|
-
elsif (line = path[/\Ainvoice_line_add\.(\d+)\.item_ref\z/, 1])
|
|
326
|
-
record.lines[line.to_i]&.item
|
|
327
|
-
end
|
|
322
|
+
# Which of your records each QuickBooks record links to, by where the input named it.
|
|
323
|
+
def linked_record(path, _entry)
|
|
324
|
+
if path == "customer_ref"
|
|
325
|
+
record.customer
|
|
326
|
+
elsif (line = path[/\Ainvoice_line_add\.(\d+)\.item_ref\z/, 1])
|
|
327
|
+
record.lines[line.to_i]&.item
|
|
328
328
|
end
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
# How the run ended: event.outcome says which, and event.output has that outcome's own keys
|
|
332
|
+
# (add_transaction's added: record and links). Keep the QuickBooks ids on the connection.
|
|
333
|
+
def ended(event)
|
|
334
|
+
# Every record the add named, by the input's path (output.refs), linked so the next run
|
|
335
|
+
# refers to it by id. A cancelled ending carries the ones settled before it stopped.
|
|
336
|
+
link_references(event) { |path, entry| linked_record(path, entry) }
|
|
329
337
|
return unless event.outcome == "added"
|
|
330
338
|
|
|
331
339
|
txn = event.dig("output", "record") || {}
|
|
@@ -339,8 +347,10 @@ module QuickbooksDesktop
|
|
|
339
347
|
record.update!(status: "failed")
|
|
340
348
|
end
|
|
341
349
|
|
|
342
|
-
# What a running workflow sends along
|
|
350
|
+
# What a running workflow sends along, taken once per delivery_id: add_transaction's
|
|
351
|
+
# "records" (what each pass settled, linked as it comes, before the ending), a sync's pages.
|
|
343
352
|
def notification(event)
|
|
353
|
+
link_references(event) { |path, entry| linked_record(path, entry) } if event.name == "records"
|
|
344
354
|
log_event(event)
|
|
345
355
|
end
|
|
346
356
|
|
|
@@ -362,6 +372,15 @@ A start can fail two ways, and they're handled differently:
|
|
|
362
372
|
|
|
363
373
|
- **Refused** (QuBe Sync answered 4xx: bad input, a workflow that isn't published) or an input that
|
|
364
374
|
raised: nothing was started. The row is marked `failed` and the error raised; start again.
|
|
375
|
+
- **Not realtime**: workflows run on realtime connections (and simulated ones). On a row whose
|
|
376
|
+
`connection_type` is `standard`, `start` raises `QubeRails::RealtimeRequired` before writing a
|
|
377
|
+
run or calling QuBe Sync. When QuBe Sync refuses the start for it anyway (a `422` whose
|
|
378
|
+
`errors.code` is `realtime_required`: the connection was downgraded in the dashboard), the row
|
|
379
|
+
is kept as `realtime_required`, not `failed`, with `error` `{"code", "detail"}`, and
|
|
380
|
+
`RealtimeRequired` is raised with the detail. QuBe Sync stores nothing for that refusal, the
|
|
381
|
+
`Idempotency-Key` included, so once the customer upgrades the connection from its page in the
|
|
382
|
+
QuBe Sync dashboard, `run.retry_start!` (or `start` again, which returns that run) starts it with
|
|
383
|
+
the same reference.
|
|
365
384
|
- **No answer** (a timeout, a 5xx, a dropped connection): the run may have started. The row stays
|
|
366
385
|
`starting`, with its reference and input, and the error is raised. Send it again with
|
|
367
386
|
`run.retry_start!` (or `QuickbooksDesktop::CreateInvoice.retry_start(run)`), never with a new
|
|
@@ -381,7 +400,8 @@ the first call started, as it is now, plus `Idempotent-Replayed: true`, and star
|
|
|
381
400
|
same key with a different call is a `422`; a refused call (`400`, `403`, `404`, `422`) stores no
|
|
382
401
|
key, so retrying it runs the checks again. A key lives as long as its run: finished runs are
|
|
383
402
|
purged 60 days after they end. `retry_start!` returns a run that already has its `qube_run_id`
|
|
384
|
-
as it is, and refuses one that `failed
|
|
403
|
+
as it is, and refuses one that `failed`; one that's `realtime_required` it sends again, unless its
|
|
404
|
+
connection's row still says `standard` (it raises `RealtimeRequired` without calling QuBe Sync). (The gem's client also resends a start that got no
|
|
385
405
|
answer twice itself, within 60 seconds, with the same key.)
|
|
386
406
|
|
|
387
407
|
A `QubeRails::Run` keeps `operation`, `record`, `connection`, `reference`, `revision`, `state`,
|
|
@@ -499,21 +519,36 @@ QuBe Sync still checks every start: a field the operation doesn't take is a 422
|
|
|
499
519
|
## Run status
|
|
500
520
|
|
|
501
521
|
The engine keeps every ending on the run row before your handler runs, under the same lock:
|
|
502
|
-
`state`, `outcome`, a failure's `error` (as the event carried it:
|
|
503
|
-
|
|
522
|
+
`state`, `outcome`, a failure's `error` (as the event carried it: `{code, type, message,
|
|
523
|
+
quickbooks_message, hint}`, where `code` is QuickBooks' status code and `type` a stable name to
|
|
524
|
+
branch on; a run from before QuBe Sync sent that object keeps its sentence, or its code, message and
|
|
525
|
+
detail), a cancel's `cancel_reason`, and `ended_at`. Every event's `headline`, one plain sentence
|
|
526
|
+
for a person ("Added the transaction to QuickBooks as TxnID 1F2-1."), is kept as `run.headline`:
|
|
527
|
+
show it, never parse it. Branch on `event`, `outcome`, `output` and `error`. So a run's result is there
|
|
504
528
|
whether or not your `ended` and `failed` handlers write anything; those are for your own records.
|
|
505
529
|
`run.ended?`, `run.failed?` and `run.cancelled?` say which (a run that completed on a
|
|
506
530
|
`cancelled` outcome, where your app chose to stop, counts as cancelled), and `run.summary_text`
|
|
507
|
-
says it in a sentence for your user: "Added to QuickBooks", "Done", "
|
|
531
|
+
says it in a sentence for your user: "Added to QuickBooks", "Done", "Done, but some didn't go
|
|
532
|
+
through" (an outcome such as `push_records`' `pushed_with_errors`: `run.with_errors?`), "Couldn't sync",
|
|
508
533
|
"Cancelled", "Needs your answer", "Sending to QuickBooks", "Still waiting for QuickBooks"
|
|
509
534
|
or "Syncing with QuickBooks" (the words are I18n's: see [Wording and translations](#wording-and-translations)). `run.reason_text` says why it failed or was cancelled, as a sentence (the error's message, or
|
|
510
|
-
the reason your app gave), and nil otherwise.
|
|
535
|
+
the reason your app gave), and nil otherwise; `run.error_detail` is the error's `hint`, what
|
|
536
|
+
usually fixes it.
|
|
537
|
+
|
|
538
|
+
A run's links work only while they apply: `links.cancel` until it ends (the row's `cancel_url` is
|
|
539
|
+
cleared then), and `links.decisions` and `links.search` while it asks (the row's `links`, cleared
|
|
540
|
+
when it stops asking; `search` only when the question has a record field). Read them from the row,
|
|
541
|
+
and expect nil.
|
|
542
|
+
|
|
543
|
+
A start refused as `realtime_required` reads QuBe Sync's detail (how to upgrade the connection)
|
|
544
|
+
as its summary, has sync status `:failed`, and gets the same "Try sending again" button, for once
|
|
545
|
+
the connection is upgraded.
|
|
511
546
|
|
|
512
547
|
A start QuBe Sync hasn't confirmed for a minute (`run.unconfirmed?`: still `starting`, after a
|
|
513
548
|
start that got no answer) reads "Still waiting for QuickBooks", and the partial offers a "Try
|
|
514
549
|
sending again" button. It posts to `POST qube/runs/:id/retry_start`, behind your sign-in and
|
|
515
550
|
CSRF, which runs the same `authorize_question` policy as the questions (404 otherwise), answers
|
|
516
|
-
409 for a run that isn't `starting
|
|
551
|
+
409 for a run that isn't `starting` (or `realtime_required`), calls `run.retry_start!` (same reference, so a start that did
|
|
517
552
|
land answers with its run) and redirects back with 303.
|
|
518
553
|
|
|
519
554
|
Show the latest run's on the record's page:
|
|
@@ -523,8 +558,9 @@ Show the latest run's on the record's page:
|
|
|
523
558
|
```
|
|
524
559
|
|
|
525
560
|
Its locals are `record` and `operation`. It shows the summary (`.qube-run-summary`, inside
|
|
526
|
-
`.qube-run-status.qube-run-<state
|
|
527
|
-
(`.qube-run-error-detail`),
|
|
561
|
+
`.qube-run-status.qube-run-<state>`, plus `.qube-run-with-errors` for an ending with errors), for a
|
|
562
|
+
failure its message (`.qube-run-reason`) and hint (`.qube-run-error-detail`), for an ended run with
|
|
563
|
+
no reason its headline (`.qube-run-headline`), and nothing for a record with no runs. Its pieces are
|
|
528
564
|
`qube_rails/run_status/*`: see [Styling](#styling) to restyle or replace any of them.
|
|
529
565
|
|
|
530
566
|
## Sync status
|
|
@@ -549,7 +585,8 @@ Per connection, since an invoice can be in one company file and not another.
|
|
|
549
585
|
out on, for a page that doesn't say which.
|
|
550
586
|
|
|
551
587
|
When the run and the link disagree, the newest word wins:
|
|
552
|
-
1. a latest run that hasn't ended: `:sending` (an unconfirmed start too) or `:needs_answer`;
|
|
588
|
+
1. a latest run that hasn't ended: `:sending` (an unconfirmed start too) or `:needs_answer`; a
|
|
589
|
+
start refused as `realtime_required` is `:failed`;
|
|
553
590
|
2. a latest run that failed or was cancelled after the link was made, or with no link:
|
|
554
591
|
`:failed` or `:cancelled`;
|
|
555
592
|
3. a link: `:in_quickbooks`, always with its `qb_id`;
|
|
@@ -593,9 +630,15 @@ cause is known. A question waiting on your user isn't affected. When the connect
|
|
|
593
630
|
resumes, the engine tells the pages of the records with a run still going on it to refresh (by the
|
|
594
631
|
runs' connection index, at most 200), so the status changes without a reload.
|
|
595
632
|
|
|
596
|
-
An answer or a start retry that can't go through (the question changed,
|
|
597
|
-
|
|
598
|
-
|
|
633
|
+
An answer or a start retry that can't go through (the question changed, the start was confirmed
|
|
634
|
+
meanwhile) goes back to the page with the reason in `flash[:qube_rails_error]`, which the partials
|
|
635
|
+
show once, so it shows under Turbo too. When QuBe Sync says the question was answered or asked
|
|
636
|
+
again since (409, or a 400 such as `not_awaiting_input`), the question is forgotten and the run reads
|
|
637
|
+
as running ("Syncing with QuickBooks") until its next webhook. An answer QuBe Sync refuses (422)
|
|
638
|
+
goes back in `flash[:qube_rails_refusal]` (`token`, `choice`, `message`, `values`): the question
|
|
639
|
+
partial shows the message inside the question, refills that choice's text, number, select and
|
|
640
|
+
checkbox fields with what was typed (not a search's pick or a rows field; nothing when it's over
|
|
641
|
+
1,000 characters, for a cookie session), and marks them `aria-invalid`, described by the message.
|
|
599
642
|
|
|
600
643
|
## Questions
|
|
601
644
|
|
|
@@ -619,7 +662,14 @@ column of up to three options, such as create or use, as a segmented control), t
|
|
|
619
662
|
its answers so far call for (each column shown while its `when` holds), stacked in a grid, a search
|
|
620
663
|
per record column (sent with the row). "Set all to:" sets that choice on every record, and "Use for
|
|
621
664
|
all N" under a filled search or select copies it to the other records that ask it and are still
|
|
622
|
-
empty.
|
|
665
|
+
empty. A rows field needs the behaviour script: without it the field and its submit stay hidden and
|
|
666
|
+
a `<noscript>` line says answering needs JavaScript (`question.needs_script`); cancel still works.
|
|
667
|
+
With more than one record it asks one at a time, and the form's button row reads, from the right:
|
|
668
|
+
the submit (on the last record) or Next, Back, and the step count ("2 of 3"), with cancel at the
|
|
669
|
+
row's left. Next is never disabled: pressing it with something missing shows what. "Set all to:"
|
|
670
|
+
is hidden. The other records stay in the form, hidden, so it's still one answer. Its answer
|
|
671
|
+
is `{"records": {row key => {column => value}}}`: each row's `key`, the columns
|
|
672
|
+
that row asks (`rows[].columns`), a number column as a number and a boolean one as `true` or `false`.
|
|
623
673
|
|
|
624
674
|
An answer QuBe Sync can't take (422) shows its reason; one it says has changed (409, or any 400)
|
|
625
675
|
goes back to the page with a message; the run's next webhook says what came of it.
|
|
@@ -641,9 +691,21 @@ your CSP nonce when you have one) and, with `stylesheet: true`, the opt-in style
|
|
|
641
691
|
(`qube_rails.css`). Your asset pipeline serves both: Propshaft as it is, Sprockets through the
|
|
642
692
|
engine's precompile list. Without `stylesheet: true` nothing of ours styles your page.
|
|
643
693
|
|
|
644
|
-
Every rule in `qube_rails.css` is inside `:where()`, so it has no specificity and
|
|
645
|
-
|
|
646
|
-
|
|
694
|
+
Every rule in `qube_rails.css` is inside `:where()`, so it has no specificity, and inside the
|
|
695
|
+
`components` cascade layer. The file starts by declaring `@layer theme, base, components,
|
|
696
|
+
utilities;` (Tailwind's own order), so wherever it loads: any unlayered CSS of yours wins, utility
|
|
697
|
+
classes (`@layer utilities`) win, and a reset in `@layer base` doesn't strip it. It has no reset and
|
|
698
|
+
no global styles.
|
|
699
|
+
|
|
700
|
+
- **Tailwind v4** (preflight in `@layer base`): works as it is, in any load order; your
|
|
701
|
+
`ui_classes` utilities override the engine's look.
|
|
702
|
+
- **Tailwind v3** (unlayered preflight) isn't supported with the engine's stylesheet: preflight's `*`, `button`, `input` and `[type=submit]`
|
|
703
|
+
rules beat a layered stylesheet, so the engine's borders, button backgrounds and paddings are
|
|
704
|
+
reset. Give every button and input piece classes (the example below does the main ones; add
|
|
705
|
+
`pick`, `button_ghost`, `search_result` and `segment`), or move to v4.
|
|
706
|
+
- Bootstrap and other unlayered CSS: its element rules and classes win, as before.
|
|
707
|
+
|
|
708
|
+
Theme it with CSS variables on `:root` or any element around the screens:
|
|
647
709
|
|
|
648
710
|
```css
|
|
649
711
|
:root {
|
|
@@ -672,7 +734,9 @@ so `prefers-color-scheme` carries through. An app whose dark mode is a class sho
|
|
|
672
734
|
Motion is short and only where it says something: a button gives way on press (`scale(0.97)`),
|
|
673
735
|
the search box's matches drop in from the input (150ms; they close at once, and moving through them
|
|
674
736
|
with the keyboard is instant), a rows field's field fades in as it starts to apply, what "Set all to"
|
|
675
|
-
or "Use for
|
|
737
|
+
or "Use for the other records too" fills flashes a tint (a record in a later step flashes as it comes
|
|
738
|
+
on show), a rows field's next record comes in from the side it's
|
|
739
|
+
stepped from (180ms, a few px), and a one-shot error fades in. All of it is transform and
|
|
676
740
|
opacity, on `cubic-bezier(0.23, 1, 0.32, 1)`; with `prefers-reduced-motion: reduce` the fades stay
|
|
677
741
|
and the movement goes. Hover effects apply only on devices with a fine pointer.
|
|
678
742
|
|
|
@@ -681,31 +745,40 @@ and the movement goes. Hover effects apply only on devices with a fine pointer.
|
|
|
681
745
|
`config.ui_classes` adds your CSS framework's classes beside the `qube-` ones, by piece:
|
|
682
746
|
|
|
683
747
|
```ruby
|
|
684
|
-
#
|
|
748
|
+
# Tailwind
|
|
749
|
+
config.ui_classes = {
|
|
750
|
+
button: "rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white hover:bg-indigo-500",
|
|
751
|
+
button_secondary: "rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50",
|
|
752
|
+
input: "rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-indigo-600 focus:outline-none",
|
|
753
|
+
select: "rounded-md border border-gray-300 px-3 py-2 text-sm",
|
|
754
|
+
label: "text-sm font-medium text-gray-900",
|
|
755
|
+
error: "rounded-md bg-red-50 px-3 py-2 text-sm text-red-700"
|
|
756
|
+
}
|
|
757
|
+
# Bootstrap (its form-check-input carries a top margin meant for .form-check; mt-0 lines it up)
|
|
685
758
|
config.ui_classes = {
|
|
686
759
|
button: "btn btn-primary", button_secondary: "btn btn-outline-secondary", input: "form-control",
|
|
687
|
-
select: "form-select", checkbox: "form-check-input", label: "form-label",
|
|
688
|
-
error: "alert alert-danger", status: "alert alert-light", search_result: "list-group-item list-group-item-action"
|
|
760
|
+
select: "form-select", checkbox: "form-check-input mt-0", label: "form-label", error: "alert alert-danger"
|
|
689
761
|
}
|
|
690
|
-
# Tailwind
|
|
691
|
-
config.ui_classes = { button: "rounded bg-indigo-600 px-3 py-1.5 text-white", input: "rounded border-gray-300" }
|
|
692
762
|
```
|
|
693
763
|
|
|
764
|
+
Set `--qube-accent` to your primary colour too (Tailwind's indigo-600 is `#4f46e5`): the engine
|
|
765
|
+
uses it for what has no piece, such as a pick's "Use this one" link and the focus ring.
|
|
766
|
+
|
|
694
767
|
| Piece | Where |
|
|
695
768
|
| --- | --- |
|
|
696
769
|
| `question` | the question's `<section>` |
|
|
697
770
|
| `message`, `details` | its sentence, its label/value table |
|
|
698
771
|
| `choice` | each choice's `<form>` |
|
|
699
|
-
| `button`, `button_secondary`, `button_ghost` | the one primary button (a form choice's submit, or a plain question's first choice; the retry button), the secondary ones (other exits, later forms, redeliver, Apply), and cancel (`button_ghost
|
|
700
|
-
| `picks`, `pick`, `pick_detail`, `pick_action` | the picks' list, each pick's option-row button (never `button`), its detail, its "Use this one" |
|
|
701
|
-
| `choice_footer`, `choice_divider` | the exits' row; the "or" between picks and a form |
|
|
772
|
+
| `button`, `button_secondary`, `button_ghost` | the one primary button (the first offered record's "Use this one", a search's once a match is picked, else a form choice's submit, or a plain question's first choice; the retry button; a rows field's Next, made by the script), the secondary ones (the other offered records' "Use this one", "Not this one", other exits, later forms, redeliver, Apply, a rows field's Back), and the ghosts: cancel, "← Back to the possible match" (`button_ghost`; with none, no class of yours, so they keep the engine's quiet look) |
|
|
773
|
+
| `picks`, `pick`, `pick_detail`, `pick_action` | the picks' list, each pick's option-row button (never `button`), its detail, its "Use this one" (an offered record's also takes the `button` or `button_secondary` piece) |
|
|
774
|
+
| `choice_footer`, `choice_actions`, `choice_divider` | the exits' own row (with picks, or an exit with a description); a form choice's button row (cancel at its start, its submit at its end, with the exits when it's the question's one form); the "or" between picks and a form |
|
|
702
775
|
| `choice_detail`, `choice_description` | a choice's detail (in its button) and description |
|
|
703
776
|
| `field`, `label` | a field's wrapper and its label (and the rows field's) |
|
|
704
777
|
| `input`, `select`, `checkbox` | text, number and search inputs; selects; checkboxes |
|
|
705
778
|
| `search`, `search_results`, `search_result` | a search box's wrapper, its matches' container, each match (made by the script) |
|
|
706
779
|
| `rows`, `row`, `row_header`, `row_fields` | a rows field's list of records, each record, its name, its fields' grid |
|
|
707
780
|
| `segmented`, `segment` | a record's choice as a segmented control, each option |
|
|
708
|
-
| `use_for_all` | the "Use for
|
|
781
|
+
| `use_for_all` | the "Use for the other N records too" button under a field |
|
|
709
782
|
| `status`, `summary`, `detail` | the run status, its sentence, a failure's detail |
|
|
710
783
|
| `stall` | why it waits on a stalled connection |
|
|
711
784
|
| `error` | a one-shot error |
|
|
@@ -724,7 +797,7 @@ operation:` and `render "qube_rails/run_status", record:, operation:` don't chan
|
|
|
724
797
|
| `qube_rails/question/_message`, `_details` | `question` | the sentence; the label/value rows |
|
|
725
798
|
| `qube_rails/question/_picks`, `_pick` | `question`; `question`, `choice` | the picks' list; one pick, a form posting `choice` |
|
|
726
799
|
| `qube_rails/question/_choice` | `question`, `choice` | a form or exit choice: a form posting `choice` and `data[...]` with your CSRF token |
|
|
727
|
-
| `qube_rails/question/_footer` | `question` | the exits' row |
|
|
800
|
+
| `qube_rails/question/_footer` | `question` | the exits' row (in a chain, ending in "Not this one" / "None of these") |
|
|
728
801
|
| `qube_rails/question/_field` | `field`, `control` | a field's wrapper and label around its control (HTML) |
|
|
729
802
|
| `qube_rails/question/fields/_text`, `_number`, `_boolean`, `_select`, `_search`, `_rows` | `field` | one field, by `field.type` |
|
|
730
803
|
| `qube_rails/question/rows/_row` | `rows`, `row` | one record: its name, its choice, its fields |
|
|
@@ -732,22 +805,33 @@ operation:` and `render "qube_rails/run_status", record:, operation:` don't chan
|
|
|
732
805
|
| `qube_rails/question/rows/_segmented` | `field` | a short enum as a segmented control (radios posted as `field.input_name`) |
|
|
733
806
|
| `qube_rails/run_status/_status` | `run_status` | the error, then the status: summary, detail, buttons |
|
|
734
807
|
| `qube_rails/run_status/_summary`, `_detail`, `_stall`, `_retry`, `_redeliver` | `run_status` | each part (`_stall` while its connection is stalled) |
|
|
735
|
-
| `qube_rails/_error` | `message` (optional) | a one-shot error; without `message:`, `flash[:qube_rails_error]` |
|
|
808
|
+
| `qube_rails/_error` | `message`, `id` (optional) | a one-shot error; without `message:`, `flash[:qube_rails_error]` |
|
|
736
809
|
|
|
737
810
|
The locals are view-models, plain Ruby objects. Their fields are the contract, kept stable across
|
|
738
811
|
versions:
|
|
739
812
|
|
|
740
|
-
- `QubeRails::QuestionView`: `picks`, `forms`, `exits
|
|
813
|
+
- `QubeRails::QuestionView`: `picks`, `forms`, `exits` (cancel last), `plain?`, `roles?` (the prompt
|
|
814
|
+
says each choice's role), `matches?` (picks are offered records: "Possible matches"), `joined_form` and
|
|
815
|
+
`joined_exits` (the one form whose button row holds the exits, and those exits), `chain?` (offered
|
|
816
|
+
records with a search, shown a branch at a time), `branch` (`:offered` or `:search` as the page
|
|
817
|
+
loads; nil when it isn't a chain), `branch_part(piece)` (a form's, or `:picks`' or `:footer`'s,
|
|
818
|
+
`"offered"` or `"search"`), `shown_part?(part)`, `offered_count`, `divided?(choice, n)` (an "or"
|
|
819
|
+
before form `n`), `ui_text(key, **options)`
|
|
820
|
+
(the engine's own word `question.<key>`, the one place the question's partials look new words up) (see "Choices" below), `message`, `details` (each `label`, `value`), `choices`, `token`,
|
|
741
821
|
`action_url`, `search_url`, `error` (QuBe Sync's refusal, or nil), `prompt` (as QuBe Sync sent it).
|
|
742
822
|
- `QubeRails::ChoiceView`: `id`, `label`, `detail`, `description`, `fields`, `index`, `action_url`,
|
|
743
|
-
`
|
|
744
|
-
|
|
823
|
+
`role` (QuBe Sync's: `pick`, `search`, `decline`, `cancel` or `answer`, one it doesn't know read as
|
|
824
|
+
`answer`; nil when the prompt has none), `cancel?` (and `secondary?`, the same), `kind` (`:pick`,
|
|
825
|
+
`:form` or `:exit`), `style` (its button's: `:primary`, `:secondary`, `:ghost`; for a pick nil, or
|
|
826
|
+
an offered record's "Use this one"), `button_piece` (its `ui_classes` piece) and `waits_for_pick?`
|
|
827
|
+
(a search's: its submit is hidden until a match is picked).
|
|
745
828
|
- `QubeRails::FieldView`: `name`, `input_name` (post your value under it), `dom_id`, `type` (`text`,
|
|
746
829
|
`number`, `boolean`, `select`, `search` or `rows`), `label`, `required`, `options` (a select's,
|
|
747
830
|
each `value` and `label`), `kind` (a search's record kind), `search_url`, `search_field`, `row_key`,
|
|
748
|
-
`when`, `rows` (a `RowsView`), `disabled`, `
|
|
831
|
+
`when`, `rows` (a `RowsView`), `disabled`, `value` (what it starts at: a column's `default`, else
|
|
832
|
+
nil), `partial`, and `labelled?`, `cell?` (a rows field's) and
|
|
749
833
|
`segmented?` (a cell's enum of up to three options).
|
|
750
|
-
- `QubeRails::RowsView`: `name`, `label
|
|
834
|
+
- `QubeRails::RowsView`: `name`, `label` (blank: no heading), `input_name`, `search_url`, `columns` (FieldViews), `rows`,
|
|
751
835
|
`set_all` (the column "Set all to:" sets, or nil).
|
|
752
836
|
`QubeRails::RowView`: `key`, `label`, `detail`, `values`, `values_json`, `index`, `cells` (the
|
|
753
837
|
columns it asks or already has a value for), `segmented_cells`, `field_cells`.
|
|
@@ -763,14 +847,39 @@ versions:
|
|
|
763
847
|
`data-qube-stall="<reason>"`). `RunStatusView.from_sync(sync, urls, error:, connection:)` takes the
|
|
764
848
|
connection the page is about (the partial's `connection:` local), else the latest run's.
|
|
765
849
|
|
|
766
|
-
Choices show by
|
|
767
|
-
option
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
850
|
+
Choices show by the `role` QuBe Sync gives each (`prompt.choices[].role`). The records it offers
|
|
851
|
+
(`pick`) are option rows, with no heading (the question's message says what they are), each ending in a
|
|
852
|
+
"Use this one" button: the first is the screen's one filled button, the rest secondary.
|
|
853
|
+
|
|
854
|
+
Offered records with a `search` are a chain, shown a branch at a time (`question.chain?`). The
|
|
855
|
+
offered records come first, with the footer row below them: `cancel` at its start and "Not this
|
|
856
|
+
one" (one record) or "None of these" (several) at its end (`question.none_of_these`). That swaps
|
|
857
|
+
them for the search: "← Back to the possible match" (`question.back_to_offered`) above it, then the
|
|
858
|
+
search's form, its field's label leading ("Not listed? Search QuickBooks"), with cancel at the
|
|
859
|
+
start of its button row and `decline` ("It's not in QuickBooks") and its submit at the end. Moving
|
|
860
|
+
to the search focuses its box (which lists the first records); Back focuses the first record; what
|
|
861
|
+
was typed or picked stays. A page showing QuBe Sync's refusal of the search's answer starts on the
|
|
862
|
+
search. Each part carries `data-qube-branch-part` (`offered` or `search`) and the one not on show
|
|
863
|
+
is `hidden`. Without the script the search can't work, so a chain shows the offered records and a
|
|
864
|
+
footer of cancel and the decline, as forms that post; "Not this one" and the search wait for the
|
|
865
|
+
script (which then hides the footer's decline: it belongs to the search).
|
|
866
|
+
|
|
867
|
+
With nothing offered, the search is a section of its own, as a form, the exits in its button row.
|
|
868
|
+
Any search's submit ("Use this one") is hidden until a match is picked, then shows as the primary
|
|
869
|
+
button; after a search that finds nothing (two characters or more, no error), the decline is the
|
|
870
|
+
primary button until a pick or a search that finds matches. Elsewhere `decline` ("It's not in
|
|
871
|
+
QuickBooks") sits in the footer row below the choices, and `cancel` ("Don't add the invoice") at
|
|
872
|
+
the start of that row, as a ghost. An `answer` shows by its shape: one with fields is its own section, its submit the one filled
|
|
873
|
+
button when no record is offered (only the first form's; later ones are secondary); with no picks, a
|
|
874
|
+
plain choice before the first form is an option row (a name clash's "Use the existing record"). A
|
|
875
|
+
question with neither picks nor forms keeps its choices in one row, the first primary. A role the
|
|
876
|
+
engine doesn't know is an `answer`.
|
|
877
|
+
|
|
878
|
+
From a QuBe Sync that sends no roles, choices show by their shape instead: an item of a `choose` list
|
|
879
|
+
(an id ending `:<n>`, no fields) is a quiet option row without a heading, the first form's submit is
|
|
880
|
+
the one filled button, and the rest are exits, cancel a ghost. So a screen never has more than one
|
|
881
|
+
filled button. The form gets `data-qube-choice-kind` and, with roles, `data-qube-choice-role`; the
|
|
882
|
+
button `data-qube-button` (its style).
|
|
774
883
|
|
|
775
884
|
A field override posts its value as `field.input_name`, so the controller reads it as it reads
|
|
776
885
|
ours: a checkbox `"true"`, a number as typed, a rows cell `data[<field>][<row key>][<column>]`.
|
|
@@ -784,26 +893,73 @@ no CSP nonce (it's a file, not an inline script), and loads once however often i
|
|
|
784
893
|
- A search: an element with `data-qube-search="<search URL>"`, `data-qube-field="<field>"` and, in a
|
|
785
894
|
rows table, `data-qube-row="<row key>"`, holding a text input `data-qube-search-input`, a hidden
|
|
786
895
|
input `data-qube-search-value` (the one with the name, which gets the picked `value`) and a
|
|
787
|
-
container `data-qube-search-results`.
|
|
896
|
+
container `data-qube-search-results`. Focusing it empty asks the search URL with `q` empty (the
|
|
897
|
+
list's first active records by name), and so does clearing it; typing two characters or more asks
|
|
898
|
+
it with what's typed; each
|
|
788
899
|
match is a button (classes from `data-qube-result-class`, `role="option"`); picking one (a click,
|
|
789
900
|
or the arrow keys and Enter) fills the hidden input and fires `change` on it and `qube:picked` on
|
|
790
901
|
the box. Escape, a click outside or leaving the box closes the matches. The box gets
|
|
791
902
|
`data-qube-open` while they show, and the input `aria-expanded` and `aria-activedescendant`. Until a
|
|
792
903
|
match is picked, the text input is invalid, so the form isn't sent. Its words come from the box's
|
|
793
|
-
`data-qube-text-no-matches`, `-searching`, `-search-failed
|
|
904
|
+
`data-qube-text-no-matches`, `-searching`, `-search-failed`, `-search-changed` (the search
|
|
905
|
+
answered 409: the question changed) and `-pick-a-match` (English without). A match's detail is
|
|
906
|
+
split into `.qube-detail-part` spans at " · ", so a line breaks between parts. A picked box gets
|
|
907
|
+
`data-qube-picked` and an inline `padding-inline-start` for its check, so your input class's
|
|
908
|
+
padding can't put the check over the text.
|
|
794
909
|
- A rows field: `data-qube-rows` around it; each record `data-qube-row` with `data-qube-values` (JSON);
|
|
795
910
|
each field `data-qube-col="<column>"` with `data-qube-when` (JSON) and, for a required column,
|
|
796
911
|
`data-qube-required`; each input `data-qube-rows-input` (a radio counts when checked). A field
|
|
797
912
|
whose `when` doesn't hold is `hidden` (and `data-qube-hidden`), its inputs disabled and not
|
|
798
|
-
required, so it's neither sent nor asked for; the script toggles all three as answers change.
|
|
913
|
+
required, so it's neither sent nor asked for; the script toggles all three as answers change. A
|
|
914
|
+
column's `default` starts checked (or selected) and counts for `when`. The field and the form's
|
|
915
|
+
submit carry `data-qube-needs-script` and `hidden` until the script shows them. Optional:
|
|
799
916
|
`data-qube-rows-set-all="<column>"` holding buttons `data-qube-set-all="<value>"` (sets that column on
|
|
800
917
|
every record offering the value), and a button `data-qube-use-for-all` in a field (shown, with the
|
|
801
|
-
|
|
802
|
-
records
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
918
|
+
field's `data-qube-text-use-for-all-one` / `-other`, "Use for the other record too" / "Use for the
|
|
919
|
+
other %{count} records too", while the field has a value other records' shown fields lack; copies
|
|
920
|
+
it to them, then shows `<div class="qube-used-for-all" data-qube-used-for-all role="status">` with
|
|
921
|
+
`data-qube-text-used-for-all-one` / `-other` in its place until the value changes). What either
|
|
922
|
+
fills gets `data-qube-filled` for the stylesheet's tint; a record not on show gets it as it's
|
|
923
|
+
shown.
|
|
924
|
+
- Steps: a rows field with two records or more shows one at a time. The script marks the field
|
|
925
|
+
`data-qube-stepped` and `data-qube-step="<n>"` (from 0), the record on show
|
|
926
|
+
`data-qube-step-current`, and hides the others (`hidden` and `display: none`, never removed, so the
|
|
927
|
+
form still posts every record). It marks the end of the form's button row
|
|
928
|
+
(`[data-qube-actions-end]`, see below) `data-qube-step-nav` and adds there, before the submit: the
|
|
929
|
+
step count `<span class="qube-rows-step" data-qube-step-line aria-live="polite">` (the field's
|
|
930
|
+
`data-qube-text-step`, "%{position} of %{count}"; a `%{name}` in your own wording is the record's
|
|
931
|
+
detail, else its name, from the header its `aria-labelledby` names), Back (`data-qube-step-back`,
|
|
932
|
+
`data-qube-button="secondary"`, classes from `data-qube-button-secondary-class`; hidden on the
|
|
933
|
+
first record) and Next (`data-qube-step-next`, `data-qube-button="primary"`, classes from
|
|
934
|
+
`data-qube-button-class`; hidden on the last record, never disabled: pressed with the record
|
|
935
|
+
incomplete it focuses what's missing and the browser says why). A form without that row gets one
|
|
936
|
+
after the records. The form's submit shows on the last record only, and
|
|
937
|
+
`data-qube-rows-set-all` is hidden. Next and Back move the focus to the record's
|
|
938
|
+
first control. A refused submit (a field invalid in a hidden record) and Enter before the last
|
|
939
|
+
record show the first record with a problem; a page whose one-shot error (`role="alert"`) names a
|
|
940
|
+
record opens on it. Words from `data-qube-text-back` and `-next` (English without). These classes are all styled
|
|
941
|
+
by `qube_rails.css` as it was before steps, so an app's copy of it still fits.
|
|
942
|
+
- No submit is ever disabled: a required field left empty, or a search with text but no pick, is
|
|
943
|
+
the browser's own validation on submit (the search input carries `required` and the "Pick one of
|
|
944
|
+
the matches." message), which focuses it and says what's missing.
|
|
945
|
+
- A form choice's button row: `.qube-choice-actions[data-qube-actions]`, holding
|
|
946
|
+
`.qube-choice-actions-start` (cancel) and
|
|
947
|
+
`.qube-choice-actions-end[data-qube-actions-end]` (other exits, then the submit). When a question
|
|
948
|
+
has one form and no picks, its exits' buttons sit in that row and submit their own (hidden,
|
|
949
|
+
empty) forms through the `form` attribute, so it works without the script.
|
|
950
|
+
- A chain (see "Choices"): in a `[data-qube-question]`, a `[data-qube-branch="search"]` or
|
|
951
|
+
`[data-qube-branch="offered"]` button shows that branch: each `[data-qube-branch-part]` not of it
|
|
952
|
+
is hidden (`hidden` and `display: none`), "Not this one" (the `data-qube-branch="search"` button
|
|
953
|
+
without a part of its own) shows on the offered branch, and a `form[data-qube-choice-role=decline]`
|
|
954
|
+
on the search's only. The focus goes to the search's `[data-qube-search-input]`, or to the first
|
|
955
|
+
offered record's button. As the page loads, the branch on show is the search when an `offered`
|
|
956
|
+
part is `hidden`.
|
|
957
|
+
- A search choice's form (`form[data-qube-choice-role=search]`, not in a rows field): its own submit
|
|
958
|
+
shows once a match is picked and hides again when the text changes. A search of two characters or
|
|
959
|
+
more that finds nothing makes the question's decline buttons (`button[data-qube-choice-role=decline]`,
|
|
960
|
+
or a decline form's submit) primary, their classes swapped between the question's
|
|
961
|
+
`data-qube-button-class` and `data-qube-button-secondary-class`; a pick or a search that finds
|
|
962
|
+
matches swaps them back.
|
|
807
963
|
- The storyboard: a button `data-qube-copy="<text>"` copies its text.
|
|
808
964
|
|
|
809
965
|
#### A custom combobox
|
|
@@ -870,7 +1026,9 @@ en:
|
|
|
870
1026
|
| `status.in_quickbooks` | In QuickBooks | the status, linked |
|
|
871
1027
|
| `status.added` | Added to QuickBooks | the status, an add that completed |
|
|
872
1028
|
| `status.done`, `status.done_with` | Done; Done: %{outcome} | the status, completed |
|
|
1029
|
+
| `status.done_with_errors` | Done, but some didn't go through | the status, completed on an outcome with errors (`pushed_with_errors`) |
|
|
873
1030
|
| `status.failed` | Couldn't sync | the status, failed (why is `reason_text`, below it) |
|
|
1031
|
+
| `status.realtime_required` | This company file's connection needs an upgrade to realtime before this can sync. | the status, a start refused as `realtime_required` that carried no detail |
|
|
874
1032
|
| `status.not_started` | it couldn't be sent | a failure's message for a start that never went out |
|
|
875
1033
|
| `status.cancelled` | Cancelled | the status, cancelled (the reason, if any, below it) |
|
|
876
1034
|
| `status.cancel_reason` | it was stopped before it finished | `Run#cancel_reason_text` with no reason |
|
|
@@ -878,6 +1036,7 @@ en:
|
|
|
878
1036
|
| `status.starting` | Sending to QuickBooks | the status, just started |
|
|
879
1037
|
| `status.unconfirmed` | Still waiting for QuickBooks | the status, a start unconfirmed for a minute |
|
|
880
1038
|
| `status.running` | Syncing with QuickBooks | the status, running |
|
|
1039
|
+
| `status.cancelling` | Cancelling… | the status after your user's cancel is posted, until the run's next event (state `cancelling`, the engine's own) |
|
|
881
1040
|
| `status.quiet` | No update from QuickBooks for a while. | above the redeliver button |
|
|
882
1041
|
| `status.check_for_updates` | Check for updates | the redeliver button |
|
|
883
1042
|
| `status.try_again` | Try sending again | the retry button |
|
|
@@ -893,13 +1052,23 @@ en:
|
|
|
893
1052
|
| `errors.disconnect_unreachable` | Couldn't reach QuickBooks' sync service just now. Try disconnecting again in a minute. | a disconnect QuBe Sync didn't answer |
|
|
894
1053
|
| `errors.still_syncing` | Something is still syncing with this company file. Let it finish, or answer its question, then disconnect. | a disconnect while work is going |
|
|
895
1054
|
| `errors.question_changed` | This question changed after the page loaded, so your answer wasn't sent. The page now shows the latest. | an answer to a changed question |
|
|
1055
|
+
| `errors.question_moved_on` | This question was already answered or has changed, so your answer wasn't sent. If QuickBooks needs anything else, it will ask here. | an answer QuBe Sync says came too late (409, or a 400 such as `not_awaiting_input`) |
|
|
896
1056
|
| `errors.answer_refused`, `errors.answer_refused_with` | That answer couldn't be used. Check it and try again.; That answer couldn't be used: %{detail} | an answer QuBe Sync refused (422) |
|
|
897
1057
|
| `question.set_all` | Set all to: | before a rows field's buttons that set every record's choice (each an option's own label) |
|
|
898
|
-
| `question.use_for_all` | Use for
|
|
1058
|
+
| `question.use_for_all` | one: Use for the other record too; other: Use for the other %{count} records too | under a filled field other records ask too (a plain string works too) |
|
|
1059
|
+
| `question.used_for_all` | one: Also filled in on the other record.; other: Also filled in on the other %{count} records. | where that button was, once pressed |
|
|
1060
|
+
| `question.choose` | Choose… | a select's first, empty option |
|
|
1061
|
+
| `question.step` | %{position} of %{count} | a rows field's step count, in the button row before Back (`%{name}`, the record's kind or name, may be added) |
|
|
1062
|
+
| `question.back`, `question.next` | Back; Next | a rows field's step buttons |
|
|
899
1063
|
| `question.or` | or | between picks and a form choice |
|
|
900
1064
|
| `question.use_pick` | Use this one | at the end of each pick's row: what clicking it does |
|
|
1065
|
+
| `question.none_of_these` | one: Not this one; other: None of these | at the end of a chain's footer row: shows the search in place of the offered records |
|
|
1066
|
+
| `question.back_to_offered` | one: ← Back to the possible match; other: ← Back to the %{count} possible matches | above a chain's search: shows the offered records again |
|
|
1067
|
+
| `question.optional` | (optional) | after the label of a field that may be left empty |
|
|
1068
|
+
| `question.needs_script` | Answering this needs JavaScript. Turn it on for this page, or answer from a browser that has it. | in place of a rows field without the script (`<noscript>`) |
|
|
901
1069
|
| `question.pick_a_match` | Pick one of the matches. | a search box with text but no pick, on submit |
|
|
902
1070
|
| `question.no_matches`, `question.searching`, `question.search_failed` | No matches; Searching…; Search isn't available right now. Try again in a moment. | the search box's matches |
|
|
1071
|
+
| `question.search_changed` | This question has changed. Reload the page to see the latest. | the search box's matches, when the search answers 409 |
|
|
903
1072
|
|
|
904
1073
|
`QubeRails.t(key, **options)` looks one up as the engine does. A question's own words (its message,
|
|
905
1074
|
details, choices and field labels) are QuBe Sync's prompt, in English. The route constants
|
|
@@ -944,6 +1113,10 @@ gain `run` and `connection`), move `account_id`, `authorize_question!` and
|
|
|
944
1113
|
`qube_connections` (its owner, `qube_id` and status) and drop the `qube_*` columns from your
|
|
945
1114
|
tables once nothing reads them.
|
|
946
1115
|
|
|
1116
|
+
From qube_rails 0.2.0: `bundle update qube_rails`, then `bin/rails qube_rails:install:migrations`
|
|
1117
|
+
and `bin/rails db:migrate` for `qube_connections.connection_type` and `qube_runs.headline`.
|
|
1118
|
+
Existing connection rows read `realtime` until their next event says their type.
|
|
1119
|
+
|
|
947
1120
|
From qube_rails 0.1.0 (v1): 0.2.0 shares nothing with it. Its models and tables are yours to keep
|
|
948
1121
|
or drop.
|
|
949
1122
|
|