Skip to content

add expression support for organisation instance owner name#3232

Merged
HauklandJ merged 21 commits intofeature/signingfrom
feature/instanceOwnerName
Apr 8, 2025
Merged

add expression support for organisation instance owner name#3232
HauklandJ merged 21 commits intofeature/signingfrom
feature/instanceOwnerName

Conversation

@HauklandJ
Copy link
Copy Markdown
Contributor

@HauklandJ HauklandJ commented Apr 3, 2025

Description

Related Issue(s)

  • closes #{issue number}

Verification/QA

  • Manual functionality testing
    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added/updated
    • Cypress E2E test(s) have been added/updated
    • No automatic tests are needed here (no functional changes/additions)
    • I want someone to help me make some tests
  • UU/WCAG (follow these guidelines until we have our own)
    • I have tested with a screen reader/keyboard navigation/automated wcag validator
    • No testing done/necessary (no DOM/visual changes)
    • I want someone to help me perform accessibility testing
  • User documentation @ altinn-studio-docs
    • Has been added/updated
    • No functionality has been changed/added, so no documentation is needed
    • I will do that later/have created an issue
  • Support in Altinn Studio
    • Issue(s) created for support in Studio
    • This change/feature does not require any changes to Altinn Studio
  • Sprint board
    • The original issue (or this PR itself) has been added to the Team Apps project and to the current sprint board
    • I don't have permissions to do that, please help me out
  • Labels
    • I have added a kind/* label to this PR for proper release notes grouping
    • I don't have permissions to add labels, please help me out

@HauklandJ HauklandJ added backport-ignore This PR is a new feature and should not be cherry-picked onto release branches kind/feature-request New feature or request kind/product-feature Pull requests containing new features and removed kind/feature-request New feature or request labels Apr 3, 2025
Comment thread src/types/shared.ts
@ivarne
Copy link
Copy Markdown
Member

ivarne commented Apr 3, 2025

A (few) shared test(s) https://github.com/Altinn/app-frontend-react/tree/main/src/features/expressions/shared-tests/functions/instanceContext would be nice :)

@HauklandJ HauklandJ requested a review from ivarne April 4, 2025 07:47
@HauklandJ HauklandJ enabled auto-merge (squash) April 4, 2025 07:54
Comment thread src/utils/instanceDataSources.ts Outdated
Comment thread src/utils/instanceDataSources.ts Outdated
@HauklandJ HauklandJ requested a review from bjosttveit April 4, 2025 13:13
@cammiida cammiida added this to the Signering MVP milestone Apr 7, 2025
@cammiida cammiida changed the base branch from main to fix/current-party-2 April 7, 2025 18:12
auto-merge was automatically disabled April 7, 2025 18:12

Head branch was modified

Base automatically changed from fix/current-party-2 to main April 8, 2025 07:40
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 8, 2025

@HauklandJ HauklandJ changed the base branch from main to feature/signing April 8, 2025 10:27
@HauklandJ HauklandJ merged commit 589659e into feature/signing Apr 8, 2025
15 checks passed
@HauklandJ HauklandJ deleted the feature/instanceOwnerName branch April 8, 2025 10:27
Copy link
Copy Markdown
Contributor

@olemartinorg olemartinorg left a comment

Choose a reason for hiding this comment

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

Nice! 🙌 This will also affect text resource variables, so the docs for that should be updated: https://docs.altinn.studio/nb/altinn-studio/reference/ux/texts/#datakilder

Comment thread src/features/instance/InstanceContext.tsx
HauklandJ added a commit that referenced this pull request May 14, 2025
* Signee List Component (#2807)

* WIP

* adds zod

* adds start of signee list component

* makes app table type generic

* renders tag in table for signee status

* adds header styling to signee list table

* adds todos and some error handling

* removes fake prop in schema to trigger parsing error

* moves signee state tag component to its own file

* adds language and error message when process task is not a signing task

* fixes caption helptext display

* added support for caption, description and helptext and sized table to md

* adds support for organisation signature

* adds lang texts for table header

* adds sorting on name column

* updates todos and removes unnecessary accessors

* right aligns the last column

* updates TODOs

* removes not found and unnecessary caption font-size

* smaller improvement to error handling

* adds custom error message to refine

* simplifies error handling

* fixes css classes

* adds support for is loading status in table and signee table

* extracts signee list error component to its own file

* fixes codeql warning and adds test for getSigneeStatus

* moves data fetching function and related code out of component file

* adds api tests

* adds stale time and simplifies signee list query object

* fixes moved import

* fixes org lookup css classes

* adds signee list component unit tests

* code review cleanup

* add datamodelbinding for surname for personlookup (#2866)

* add datamodelbinding for surname for personlookup

* rm surname datamodelbinding and compose fullname

* update validation of person lookup name

* rm surname from datamodelbindings

* validate first and last name

* validate tempName inline

* Update src/layout/PersonLookup/PersonLookupComponent.tsx

Co-authored-by: Camilla Marie Dalan <camillamdalan@gmail.com>

---------

Co-authored-by: Camilla Marie Dalan <camillamdalan@gmail.com>

* Documents to Sign List (#2830)

* WIP signing document list

* adds support for selflinks apps blob url

* adds support for attachment type in table

* moves error component to own file

* supports loading in signing doc list table

* adds error message when component is used in a non signing task

* fixes cypress test

* fixes import error

* moves api stuff out to api file

* adds tests for signing document list component

* code review fixes

* removes filtering of documents to sign and sets filename to datatype if no set filename (#2910)

* scaffold for summary2 for signing components

* add signeelist summary

* add summary for signing documents list

* placeholder for no signatures found

* language support for download button

* use signingDocumentList as summary, use Lang and Paragraph

* fix tests

* Feature/signing cta (#2890)

* Signing panel scaffolding

* fixes tests

* updates eslint rules for test files

* fixes function name casing

* makes panel full width by default and moves full width and conditional wrappers to app-components

* implements functions and cleans up code

* removes reject button in mvp

* renames waiting status in current user status

* replaces signee list staleTime with refetchInterval and added padding to signing panel

* adds deprecated warning to getDataValidationUrl

* uses css classes instead of inline css

* adds text resource defaults

* fixes spacing in panel and alignment of checkbox and label

* adds checkbox label and description config to layout component

* fixes signing document list component test

* adds all text resources as props for override capability

* renames go_to_inbox -> no_action_required

* adds reject button to panel if user has reject rights

* adds text resource binding props and text resource defaults for reject signing process modal

* ignore layout config.ts files for sonarcloud

* renames SubmitPanel -> PanelSubmit

renames SigningPanel -> PanelSigning, NoActionRequiredPanel -> PanelNoActionRequired and AwaitingCurrentUserSignaturePanel -> PanelAwaitingCurrentUserSignature

* splits submit panel in awaiting other signatures panel and submit panel with corresponding text resource changes

* returns no action required panel

* fixes inverted logic error

* QA fixes

* removes redundant tests

* fixes document list test

* remove description for signing document summary

* fetch status from current user, not instance owner (#2931)

* Signing backend validation (#2930)

* runs backend validation on signee list refetch

* invalidates signee list on sign

* Render signe state for signee list summary, await fetching queries before #readyforprint (#2939)

* useEffect instead of useQuery

* separate rendering based on useQuery response

* polish summary

* update ready for print to wait for fetching queries to be idle

* fixes current party id

* fixes signee list cache invalidation on task change

* update apptable to support Lang element to display when there is no data (#2950)

* update apptable to support Lang element to display when there is no data

* update design after consulting with designers

* Update src/language/texts/nn.ts

Co-authored-by: Camilla Marie Dalan <camillamdalan@gmail.com>

---------

Co-authored-by: Camilla Marie Dalan <camillamdalan@gmail.com>

* shows signing button if user has not signed and has signing access (#2974)

* Signing CTA error state (#2936)

* adds error panel when delegation is unsuccessful for one or more signees

* handles both delegation and api errors

* small cleanup

* adds some SigningStatusPanelComponent tests

* updates texts

* uses current party id for message box url in no action required panel

* renames partyId param to instanceOwnerPartyId

* Signing CTA fixes (#3016)

* prevents double clicking submit buttons

* always refetches signeeList on mount

* Fix missing submit button when user can sign, but isn't required (#3030)

* shows submit button in awaiting current user signature panel if can write and no missing signatures

* adds test for new case and fixes structure

* minor wcag improvements

* invalidate all signing queries on sign server action (#3036)

* Updates signee notification status from backend (#3044)

* updates notification status from backend

* notificationSuccessful -> notificationStatus

* updates the signing pdf with styling and signature timestamp (#3045)

* updates the signing pdf with styling and signature timestamp

* uses correct elements and fixes styling

* adds test for signeelistsummary

* makes signature description italic

* adds missing signedTime property in test

* fix test

* uses mutation status for disabling buttons

* updates captions/label sizes for signing and signing summary

* renames returnUrlToMessageBox to getMessageBoxUrl and gets window.location.host inside function

* [Signing] Signee list summary override (#3088)

* adds signee list summary override for title

* fixes and adds new tests

* filters app:owned data elements from shown attachments in local receipt

* updates tests and api

* converts timestamp string to zoned date and formats

* updates yarn.lock

* fix import path for conditionalwrapper

* add expression support for organisation instance owner name (#3232)

* deletes unused hook

* improves PartySelection error message

* gets instance owner party from backend and correctly determines on behalf of in app header

* fixes eslint warning

* adds enabled prop to instance owner query, and improves useInstanceOwner logic and readablility

* gets instance owner party from new data on instance from backend with fallback to finding it in parties

* removes cookie utils

* add expression support for organisation instance owner name

* update tests

* add shared-tests

* expose instace owner name always

* fixes flattening parties and checking if same party by partyId in app header

* fixes sonarqube maintainability complaint

* fixes another sonarqube maintainability complaint

* removes unused query key

* gets instance owner name straight from cache instead of zustand which might have been overwritten

* gets instance owner data from cache instead of performing another query

---------

Co-authored-by: Camilla Marie Dalan <camillamdalan@gmail.com>

* memoize the built instance data sources

* dummy commit

* Allow user to choose which party to sign on behalf of (#3169)

* scaffolding, commented out code, and generally chaos

* update yarn lock

* add onBehalfOf to doPerformAction query

* update schema

* update the org check logic

* update the change handle on the radio group to set the orgnr for the value

* add text resources for signing panel radio group

* rm commented out code

* use fieldset instead of radio group

* pr feedback

* different views for different on behalf of

* make header smaller for single choice org on behalf of

* organisation -> organization for compatibility with new backend

* move onhebalfofchooser, make state nullable (#3273)

* move onhebalfofchooser, make state nullable

* set on behlaf of for single choice

* calculates current user signees based on signee list and authorized orgs

* adds current user to onbehalfofchooser

* fixes summary title override for signee list and documents list

* fixes awaiting current user signature panel logic

* smaller fixes

* makes signing status panel action type component instead

* improves api use and fixes tests

* some restructuring and test cleanup

* makes submit button not disabled, but shows error message instead if clicked and there are missing signatures

* renames SigningStatusPanel -> SigningActions

* renames currentParty -> selectedParty and uses profile instead of selectedParty for signing components

* updates tests with the fix

* British to American English in Signing (#3322)

* switches from british to american spelling of organization

* authorised -> authorized

* Adds error messages instead of disabled button (#3324)

* makes minor improvements and adds error messages instead of disabled button for signing

* fixes tests

* flattens text resources for signing

* removes lang import in app-components

* removes rouge C from selected party provider

* removes unused nodeid prop

* renames file with spelling error

* Feature/signing-bugfix (#3345)

* if user has signed as itself or on behalf of org, disallow role based signing

* update tests

---------

Co-authored-by: Johannes Haukland <42615991+HauklandJ@users.noreply.github.com>
Co-authored-by: HauklandJ <hauklandjohannes@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-ignore This PR is a new feature and should not be cherry-picked onto release branches kind/product-feature Pull requests containing new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants