Skip to content

feat: remove custom institution type; align create/edit with API school-type rules#258

Merged
mrmaloof merged 4 commits intodevelopfrom
feat/remove-custom-institutions
Apr 20, 2026
Merged

feat: remove custom institution type; align create/edit with API school-type rules#258
mrmaloof merged 4 commits intodevelopfrom
feat/remove-custom-institutions

Conversation

@chapmanhk
Copy link
Copy Markdown
Contributor

@chapmanhk chapmanhk commented Apr 10, 2026

changes

  • Create / edit institution flows
    • Remove Custom as an institution type in the UI.
    • Align forms with API rules: exactly one of PDP / Edvise (ES) / Legacy; conditional fields (e.g. pdp_id only when PDP); schema / allowed-email handling consistent with the hardened API (Avoid client-driven allowed_schemas that mixed custom behavior with UNKNOWN; school type + API schema groups are the source of truth

context

The backend is dropping custom institutions; the admin UI must not offer Custom and must send payloads the API accepts. This pairs with the edvise-api PR - datakind/edvise-api#228

https://app.asana.com/1/6325821815997/project/1208486153653829/task/1213791624909790?focus=true

testing

Tested deployed feature branch on dev with its associated edvise-api feature branch: confirmed that custom is removed and that school creation is working as intended.

questions

  • None

- Require exactly one of PDP, Edvise, or Legacy on create
- Drop allowed_schemas/UNKNOWN from payloads; label fieldset Institution type

Made-with: Cursor
- CreateInst: send pdp_id only when PDP is selected; fix allowed_emails empty check
- EditInst: require exactly one of PDP, Edvise, or Legacy before submit

Made-with: Cursor
Keep only custom-removal edits on the edit page (no Custom option, no UNKNOWN allowed_schemas, Institution type label). Drop the exactly-one-type client check added for API parity; edit flow is out of scope for this PR.

Made-with: Cursor
@chapmanhk chapmanhk requested a review from mrmaloof April 10, 2026 15:53
Copy link
Copy Markdown
Contributor

@mrmaloof mrmaloof left a comment

Choose a reason for hiding this comment

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

As I understand it, an Institution may have only one type of PDP, Edvise, or Legacy. How about we use a <select> or <input type="radio"> control on the Create Institution screen to enforce a single choice?

Replace mutually exclusive PDP / Edvise / Legacy checkboxes with radio controls
so only one type can be selected. Create page leaves type unset until submit
and shows the PDP ID field only when PDP is selected.

Edit page loads the current institution via GET /current-institution-api
(proxied to the backend) and uses the same radio pattern with optional id
fields per type.

Remove EditInstApi from RequireInstitution skip list so PATCH uses the
session institution id. Add getCurrentInstitutionDetails controller and
route; normalize JSON response from the HTTP client for the browser.

Made-with: Cursor
@chapmanhk chapmanhk requested a review from mrmaloof April 20, 2026 17:28
@mrmaloof mrmaloof merged commit 6ca041c into develop Apr 20, 2026
1 check passed
@mrmaloof mrmaloof deleted the feat/remove-custom-institutions branch April 20, 2026 17:34
mrmaloof added a commit that referenced this pull request May 6, 2026
* Revert "Revert "feat: Edvise and Legacy institution type options""

* refactor: remove mock response

* fix(tests): repair CreateTeamTest and migrate PHPUnit config

Assert the non-personal owned team by personal_team flag; string UUID primary keys make latest('id') lexicographic, not chronological.

Migrate phpunit.xml to the PHPUnit 10.5 schema to clear the deprecated configuration warning.

Made-with: Cursor

* fix: wait long enough for backend validate-upload through Laravel proxy

- constructInstRequest: use Http::timeout from BACKEND_HTTP_TIMEOUT_SECONDS
  (default 300s) so large CSV validation is not cut off at Laravel's ~30s default.
- FileUpload: axios validate POST timeout 300s; axiosErrorMessage() for
  error/detail/message so UI never shows [Validation] undefined.
- Document BACKEND_HTTP_TIMEOUT_SECONDS in .env.example.

Made-with: Cursor

* refactor: apply long HTTP timeout only to validate-upload proxy

- Use BACKEND_HTTP_DEFAULT_TIMEOUT_SECONDS (default 30) for most institution API calls.
- Use BACKEND_HTTP_VALIDATE_TIMEOUT_SECONDS (default 300) only when url_piece starts
  with /input/validate-upload.
- Fall back to deprecated BACKEND_HTTP_TIMEOUT_SECONDS if validate-specific var unset.
- Update .env.example and FileUpload comment.

Made-with: Cursor

* chore: drop unused BACKEND_HTTP_TIMEOUT_SECONDS fallback

Made-with: Cursor

* refactor: align proxy timeout and upload errors with engineering principles

- Extract institutionBackendTimeoutSeconds(); name fallback seconds as class consts.
- Rename formatAxiosErrorMessage, VALIDATE_UPLOAD_TIMEOUT_MS, clearer identifiers.

Made-with: Cursor

* ci: raise Node heap for vite build in precommit-tests

Avoids OOM on large bundle (matches local NODE_OPTIONS=8192).

Made-with: Cursor

* fix: don't show download model card unless we have inst_id and model_run_id

* refactor: inline model run link

* chore: remove development document

* feat: model card download file name

* feat: change logo link to app-home (#252)

* fix: Improve set institution handling for DataKinders (#257)

* refactor: make set inst_id DRY

* refactor: remove DataKinder specific inst_id

* chore: remove unused file

* refactor: setup institution and user props

* feat: Security audit: Laravel 13, dependency hygiene, and frontend toolchain (#259)

* chore(deps): update npm and Composer lockfiles

* chore(deps): update axios

* chore(deps): update lavavel

* chore(deps): update lavavel

* chore: remove duplicate socialite/ Laravel app (single composer SSoT)

The socialite/ directory was a second full Laravel skeleton with its own
composer.json/lock, unrelated to laravel/socialite (Composer package).
OAuth uses the root app and laravel/socialite from the main composer.json.

Made-with: Cursor

* chore(deps): update npm and Composer lockfiles

* chore(deps): update xlxs

* chore(deps): update vite

* chore(deps): update vite

* chore(deps): update eslint

* chore(deps): remove unused sass

* chore(deps): update livewire

* chore(deps): update inertiajs

* chore(deps): update ziggy-js

* chore(deps): remove unused GeocoderControl and its mapbox dependencies

* chore: update tailwind. remove postcss

* fix: resolve react-ga4 initialize with CJS default export

* fix: resolve react-player initialize with CJS default export

* fix: simplify layout

* fix: tailwind nav cleanup

* refactor: cleanup navigation styles

* chore: format

* refactor: cleanup navigation

* feat: Add instiution name to layout for DataKinders (#255)

* refactor: rename GetInstitution -> GetInstitutionId

* feat: add GetInstitution helper

* chore: remove unused imports

* refactor: remove unsed files

* refactor: remove unsed files

* feat: add institution name to layout for DataKinders

* style: default link styles

* refactor: remove unused imports

* style: don't center institution name

* fix: post-merge regressions (missing GetinstitutionId + Plotly) (#261)

* fix: use GetInstitution

* fix(charts): unwrap react-plotly default export for Vite

* fix: get inst_id from institution

* refactor: format

* fix: update home link to "welcome" (#263)

* feat: remove custom institution type; align create/edit with API school-type rules (#258)

* feat(ui): remove Custom institution type from create/edit flows

- Require exactly one of PDP, Edvise, or Legacy on create
- Drop allowed_schemas/UNKNOWN from payloads; label fieldset Institution type

Made-with: Cursor

* feat(ui): align institution admin with API school-type rules

- CreateInst: send pdp_id only when PDP is selected; fix allowed_emails empty check
- EditInst: require exactly one of PDP, Edvise, or Legacy before submit

Made-with: Cursor

* revert(ui): restore EditInst submit rules from before admin-align work

Keep only custom-removal edits on the edit page (no Custom option, no UNKNOWN allowed_schemas, Institution type label). Drop the exactly-one-type client check added for API parity; edit flow is out of scope for this PR.

Made-with: Cursor

* Use radios for institution school type on create and edit admin pages

Replace mutually exclusive PDP / Edvise / Legacy checkboxes with radio controls
so only one type can be selected. Create page leaves type unset until submit
and shows the PDP ID field only when PDP is selected.

Edit page loads the current institution via GET /current-institution-api
(proxied to the backend) and uses the same radio pattern with optional id
fields per type.

Remove EditInstApi from RequireInstitution skip list so PATCH uses the
session institution id. Add getCurrentInstitutionDetails controller and
route; normalize JSON response from the HTTP client for the browser.

Made-with: Cursor

* fix: Login sync: do not write empty institution id when check-self has none (DataKinder path) (#265)

* fix: remove version ID from Create Model screen (#264)

* fix: remove version ID from create model screen

* refactor: formatter

* feature: create general Alert component, update set institution alerts (#262)

* refactor: remove redundant set-inst visit

* refactor: replace ErrorAlert with more general Alert component

* refactor: remove unused components

* refactor: simplify set institution message

* chore: format

* fix(a11y): add h1 headings for document outline compliance (#260)

* fix(a11y): add h1 headings for document outline compliance

* refactor: remove unused imports

* chore: format

* feat: deploy qa (staging) environment for QA on next release (#266)

* build: define version number

* ci: make cloudbuild config more general

* ci: add --trust-builder option

* revert: undo --trust-builder

* ci: add --trust-builder option

* build: don't rely on $LOCATION. use $_REGION=us-east4

* build: trigger migrations on _MIGRATE_JOB

* refactor: DRY up image

* build: edvise-qa migration test

* build: undo _IMAGE substitutions, some variables not expanded

* fix: MySQL syntax in create_users_table migration

* build: pass database name to migration via _MIGRATE_DB variable

* build: remove default _STATIC_BUCKET

* build: custom nginx.conf

* Revert "build: custom nginx.conf"

This reverts commit 4629a27.

* build: Deploy Laravel on Cloud Run with Docker (nginx + PHP-FPM) instead of buildpacks

* build: cp static assets

* build: Fix mixed content on HTTPS behind GCLB by trusting proxies and forcing HTTPS URLs

* build: sync qa database

* build: sync qa db

* build: sync qa database

* build: update Slack webhook

* build: sync qa database

* build: DB migrations for dev and qa

* build: generic db migration for dev and qa

* feat: add standby file

* build: use TCP db connection

* build: sync qa db

* build: use maria db for copying db

* chore(docker): split scripts into own copy layer

* chore(cloudbuild): enable DOCKER_BUILDKIT for docker build

* build: improve db test

* revert: split docker build

* build: output db query to logs for verification

* build: mariadb-dump check

* build: add safety check for DB sync

* chore(release): bump version to 1.0.0

* chore(release): update and display version number
refactor: give footer components better names

* chore(release): don't display version on public footer

* chore: remove unused standby file

* fix(a11y): default link style (#267)

* docs: add initial CHANGELOG.md for 1.0.0 release

* fix: remove duplicate declarations in FileUpload after merge

---------

Co-authored-by: Hannah Ofstedahl <98632391+chapmanhk@users.noreply.github.com>
Co-authored-by: Hannah Ofstedahl <hannahxchapman@yahoo.com>
Co-authored-by: Larry Kilroy <67176442+kilroyzhere@users.noreply.github.com>
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