Skip to content

feat: add organisation select#3

Merged
caebr merged 19 commits into
cd-bundfrom
feat/select-organisation
Nov 4, 2025
Merged

feat: add organisation select#3
caebr merged 19 commits into
cd-bundfrom
feat/select-organisation

Conversation

@caebr
Copy link
Copy Markdown
Collaborator

@caebr caebr commented Oct 20, 2025

A new organisation field was added to the publiccode standard and the publiccode parser, see publiccodeyml/publiccode.yml#256

This change adds a dropdown to select an organisation from a given list (of all offices of the departements of the Swiss Federation).

@caebr caebr requested a review from mburri October 20, 2025 16:36
@caebr caebr self-assigned this Oct 20, 2025
@mburri
Copy link
Copy Markdown
Collaborator

mburri commented Oct 21, 2025

Some observations:
* the generated yaml uses the wrong version as seen in the screenshot below. Should be 0.5 now ✓ done

image
  • org selection works but the combobox is a bit clumsy to use
    • searches only work for the start of the string. E.g. "Bundesarchiv" yields no results ✓ done
    • the string (unset) is hard to delete! ✓ done
  • unrelated to this PR: the input field labels look "off". The gap between the label and its input field is bigger than the gap to the label of the next input field below. This is confusing.

Comment thread src/wasm/go.mod Outdated
go 1.23.9

require github.com/italia/publiccode-parser-go/v4 v4.3.7
require github.com/italia/publiccode-parser-go/v5 v5.1.1
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You might want to use v5.2.1 as it fixes a regression.

italia/publiccode-parser-go@v5.1.1...v5.2.1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the hint.

Copy link
Copy Markdown

@bfabio bfabio Oct 22, 2025

Choose a reason for hiding this comment

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

@caebr you're welcome! You might also want to star & watch the publiccode-parser-go repo to get notified of new releases.

@caebr caebr force-pushed the feat/select-organisation branch from 9c3ad0c to a22edeb Compare October 22, 2025 08:23
@bfabio
Copy link
Copy Markdown

bfabio commented Oct 22, 2025

FYI, I just opened this upstream: italia#525

It'd be nice to upstream something generic.

Also, I guess you might be interested in joining efforts with them to implement the new publiccode.yml 0.5.0 spec: italia#526 😉

@caebr caebr marked this pull request as ready for review October 24, 2025 12:55
@caebr caebr requested a review from olibrian as a code owner October 24, 2025 12:55
Comment thread package.json
"prebuild": "npm run build:wasm && npm run build:licenses",
"build:providers-oembed": "tsx scripts/getProvidersOembed.ts src/generated/providers-oembed.json",
"build:licenses": "mkdir -p src/generated && tsx scripts/genLicenseList.ts src/generated/licenses.json",
"build:organisations": "tsx src/app/data/generateOrganisations.ts",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think that there should be a note in the readme that this script should be run.

or run it as a post install script

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The script is documented in the following README.

I added an additional post install script.

[setValue]
);

const updateOrganisation = useCallback(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is the usage of useCallback necessary here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, see https://legacy.reactjs.org/docs/hooks-faq.html#is-it-safe-to-omit-functions-from-the-list-of-dependencies

I did not move the function inside useEffect to keep the code consistent with resetMaintenance.

@caebr caebr merged commit 5e592bf into cd-bund Nov 4, 2025
4 checks passed
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.

3 participants