Skip to content
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

When reviewing lists, shouldn't say "you've told us about" said thing #148

Open
BryceStevenWilley opened this issue Jan 27, 2023 · 4 comments
Labels
bite-sized Small stuff that could be completed in a few hours bug Something isn't working

Comments

@BryceStevenWilley
Copy link
Contributor

Happens currently if you are editing jobs, see below image:

Text on the screen: "What is your job title? You've already told us about Cashier". Cashier is pre-filled in a field called "Job name"

Happens because it's a check for len(x.complete_elements()) > 0 on the list. Not sure if it'll work but my best attempt at fixing now would be

% if len(x.complete_elements()) > 0`
You've already told about ${ comma_and([item for idx, item in enumerate(x.complete_elements()) if idx != i ]) } 
% endif

Needs to go in several places though, in this repo and maybe in docassemble-AssemblyLine as well.

@BryceStevenWilley BryceStevenWilley added bug Something isn't working bite-sized Small stuff that could be completed in a few hours labels Jan 27, 2023
@nonprofittechy
Copy link
Member

I think a better fix is redefining the complete attribute for this list, no?

@BryceStevenWilley
Copy link
Contributor Author

That doesn't work unfortunately. This is currently the Edit table for ALJobs:

generic object: ALJobList
table: x.table
rows: x
columns:
  - Title: |
      row_item.source
  - Employer: |
      row_item.employer.name if hasattr(row_item.employer.name, "first") else ""
  - Annual Income: |
      currency(row_item.gross_total())
edit:
  - source
  - employer.name.first
  - value
confirm: True

If we add - complete, the complete attribute, at the beginning of the edit: list, the only thing that happens is that it re-runs the code block that sets complete, which I think it just gets through without exception, since all of the other values are already set. You end up at the same screen with the same issue, and the complete variable is still set to true. There's no way to reconsider the complete attribute for the list items and all of their other values at the same time from the table that I can tell.

@plocket
Copy link
Collaborator

plocket commented Feb 2, 2023

Is there a way to tell where the question is being triggered from? Something in the url args?

Tangentially, do any AL review questions have this problem? If not, they might in the future as we've mentioned wanting to list previous answers when we're collecting items.

@BryceStevenWilley
Copy link
Contributor Author

Is there a way to tell where the question is being triggered from? Something in the url args?

No, I don't think so, not as a formal API, and I wouldn't trust any informal information we get from docassemble to be stable.

do any AL review questions have this problem?

Yes, I think this is likely happening in AL core too, mentioned at the bottom of the issue description:

Needs to go in several places though, in this repo and maybe in docassemble-AssemblyLine as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bite-sized Small stuff that could be completed in a few hours bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants