Skip to content

Comments

Content s formatting#747

Merged
jforsman merged 2 commits intomasterfrom
content_s_formatting
Jan 19, 2026
Merged

Content s formatting#747
jforsman merged 2 commits intomasterfrom
content_s_formatting

Conversation

@jforsman
Copy link
Contributor

No description provided.

@jforsman jforsman requested a review from shundread January 16, 2026 10:25
@jforsman jforsman force-pushed the content_s_formatting branch 2 times, most recently from 44b9ccd to ee32423 Compare January 16, 2026 11:40
Copy link
Contributor

@shundread shundread left a comment

Choose a reason for hiding this comment

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

It's mostly fine, but I have a couple of questions

</>
)}
{content_s && (
{content_s_rows && Array.isArray(content_s_rows) && content_s_rows.length > 0 && (
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: The standalone content_s_rows is needless since Array.isArray already returns false for all falsy values:

> [null, undefined, false, NaN, 0, -0, 0n, "", document.all].map(v => Array.isArray(v))
[false, false, false, false, false, false, false, false, false]
> Array.isArray([])
true

device_plan_id: string;
mount_type_description_fi: string;
content_s: Object;
content_s_rows: Object;
Copy link
Contributor

Choose a reason for hiding this comment

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

according to the documentation of the get_content_s_rows method in traffic_control/models/additional_sign.py this looks like it could be at least some kind of Record<string, object>[] if nothing more specific than that.

Also, prefer object to Object here and on other places where Object is being used: https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So true

<dt>{{ field.verbose_name }}</dt>
<dd>
<dl class="content-s-nested">
{% for title, display_value in additional_sign.object.get_content_s_rows %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be considered excessive to make a template inclusion tag for this? The <dl> is almost identical to the diff above.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also the case for zero rows looks different now. Does this need a special handler for no rows or is it an intentional change? (left is old, right is new)
Screenshot from 2026-01-16 15-55-37

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not intentional.

@jforsman jforsman force-pushed the content_s_formatting branch 2 times, most recently from 4ee80b4 to 8fa41f3 Compare January 19, 2026 09:10
* content_s_rows also added WFS for AddtitionalSignPlan and Real features.
* Show content_s row by row instead of raw data.

Refs: LIIK-881
@jforsman jforsman force-pushed the content_s_formatting branch from 8fa41f3 to c3ef988 Compare January 19, 2026 09:35
@sonarqubecloud
Copy link

@jforsman jforsman requested a review from shundread January 19, 2026 10:52
Copy link
Contributor

@shundread shundread left a comment

Choose a reason for hiding this comment

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

Looks good

@jforsman jforsman merged commit d18f0d0 into master Jan 19, 2026
5 checks passed
@jforsman jforsman deleted the content_s_formatting branch January 19, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants