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

feat(seminars): new application #17288

Open
wants to merge 89 commits into
base: main
Choose a base branch
from

Conversation

sigruntg
Copy link
Member

@sigruntg sigruntg commented Dec 19, 2024

Seminars

Attach a link to issue if relevant

What

New application for Vinnueftirlitið for all of their seminars.

Why

Specify why you need to achieve this

Screenshots / Gifs

image
image
image
image
image
image

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

berglindoma13 and others added 30 commits November 12, 2024 15:03
…is/island.is into feature/new-seminars-application
…is/island.is into feature/new-seminars-application
Copy link
Contributor

coderabbitai bot commented Dec 19, 2024

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

41 files out of 123 files are above the max files limit of 75. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@datadog-island-is
Copy link

datadog-island-is bot commented Jan 6, 2025

Datadog Report

All test runs a1ec7e3 🔗

10 Total Test Services: 0 Failed, 10 Passed
🔻 Test Sessions change in coverage: 10 decreased, 20 increased, 170 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
air-discount-scheme-backend 0 0 0 63 0 17.34s N/A Link
air-discount-scheme-web 0 0 0 2 0 7.83s N/A Link
api 0 0 0 4 0 2.59s N/A Link
api-catalogue-services 0 0 0 23 0 9.09s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 16.55s N/A Link
api-domains-assets 0 0 0 3 0 9.7s N/A Link
api-domains-auth-admin 0 0 0 18 0 10.28s N/A Link
api-domains-communications 0 0 0 5 0 30.57s N/A Link
api-domains-criminal-record 0 0 0 5 0 8.42s N/A Link
api-domains-driving-license 0 0 0 23 0 27.92s N/A Link

🔻 Code Coverage Decreases vs Default Branch (10)

This report shows up to 5 code coverage decreases.

  • message-queue - jest 67.46% (-0.8%) - Details
  • clients-middlewares - jest 75.69% (-0.17%) - Details
  • services-university-gateway - jest 45.23% (-0.06%) - Details
  • application-types - jest 5.32% (-0.04%) - Details
  • application-template-api-modules - jest 30.09% (-0.03%) - Details

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 45.38462% with 71 lines in your changes missing coverage. Please review.

Project coverage is 35.71%. Comparing base (50422b0) to head (6e063f9).
Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
...odules/templates/aosh/seminars/seminars.service.ts 25.00% 33 Missing ⚠️
...s/clients/seminars-ver/src/lib/seminars.service.ts 50.00% 12 Missing ⚠️
libs/application/core/src/lib/fieldBuilders.ts 16.66% 10 Missing ⚠️
...ormationCardFormField/InformationCardFormField.tsx 10.00% 9 Missing ⚠️
apps/api/src/app/app.module.ts 0.00% 2 Missing ⚠️
.../TableRepeaterFormField/TableRepeaterFormField.tsx 0.00% 2 Missing ⚠️
...ication/template-loader/src/lib/templateLoaders.ts 0.00% 1 Missing ⚠️
.../ui-fields/src/lib/LinkFormField/LinkFormField.tsx 0.00% 1 Missing ⚠️
libs/clients/seminars-ver/src/lib/providers.ts 91.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17288      +/-   ##
==========================================
+ Coverage   35.67%   35.71%   +0.04%     
==========================================
  Files        6936     6948      +12     
  Lines      148940   149450     +510     
  Branches    42560    42824     +264     
==========================================
+ Hits        53127    53371     +244     
- Misses      95813    96079     +266     
Flag Coverage Δ
air-discount-scheme-backend 48.27% <100.00%> (+0.02%) ⬆️
air-discount-scheme-web 0.00% <ø> (ø)
api 3.33% <0.00%> (ø)
api-catalogue-services 75.81% <ø> (ø)
api-domains-air-discount-scheme 38.05% <100.00%> (+0.05%) ⬆️
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 48.49% <ø> (ø)
api-domains-communications 39.49% <100.00%> (+0.09%) ⬆️
api-domains-criminal-record 48.11% <100.00%> (+0.07%) ⬆️
api-domains-driving-license 44.89% <100.00%> (+0.03%) ⬆️
api-domains-education 31.33% <100.00%> (+0.06%) ⬆️
api-domains-health-insurance 35.56% <100.00%> (+0.09%) ⬆️
api-domains-mortgage-certificate 35.30% <100.00%> (+0.05%) ⬆️
api-domains-payment-schedule 42.18% <100.00%> (+0.05%) ⬆️
application-api-files 62.10% <100.00%> (+0.13%) ⬆️
application-core 75.20% <33.33%> (-0.41%) ⬇️
application-system-api 38.78% <50.43%> (+0.04%) ⬆️
application-template-api-modules 27.68% <10.14%> (+<0.01%) ⬆️
application-templates-accident-notification 27.54% <16.66%> (-0.07%) ⬇️
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 25.73% <16.66%> (-0.10%) ⬇️
application-templates-driving-license 18.17% <16.66%> (+<0.01%) ⬆️
application-templates-estate 13.68% <16.66%> (+<0.01%) ⬆️
application-templates-example-payment 24.61% <16.66%> (-0.08%) ⬇️
application-templates-financial-aid 14.49% <16.66%> (+0.01%) ⬆️
application-templates-general-petition 23.07% <16.66%> (-0.06%) ⬇️
application-templates-inheritance-report 6.64% <16.66%> (+0.04%) ⬆️
application-templates-marriage-conditions 15.25% <16.66%> (+0.03%) ⬆️
application-templates-mortgage-certificate 43.70% <37.50%> (+<0.01%) ⬆️
application-templates-parental-leave 29.89% <16.66%> (+0.08%) ⬆️
application-types 6.44% <0.00%> (-0.05%) ⬇️
application-ui-components 1.22% <ø> (ø)
application-ui-shell 22.23% <12.00%> (-0.03%) ⬇️
auth-admin-web 2.43% <ø> (ø)
auth-nest-tools 31.69% <ø> (+0.16%) ⬆️
auth-shared 75.00% <ø> (ø)
clients-charge-fjs-v2 29.15% <100.00%> (+0.26%) ⬆️
clients-driving-license 40.99% <100.00%> (+0.07%) ⬆️
clients-driving-license-book 43.98% <100.00%> (+0.05%) ⬆️
clients-financial-statements-inao 49.78% <100.00%> (+0.07%) ⬆️
clients-license-client 1.26% <ø> (ø)
clients-middlewares 72.97% <100.00%> (+0.04%) ⬆️
clients-regulations 43.08% <100.00%> (+0.08%) ⬆️
clients-rsk-company-registry 31.25% <100.00%> (+0.07%) ⬆️
clients-rsk-personal-tax-return 38.32% <ø> (ø)
clients-syslumenn 49.52% <100.00%> (+0.04%) ⬆️
cms 0.39% <ø> (-0.01%) ⬇️
cms-translations 38.81% <100.00%> (+0.08%) ⬆️
content-search-index-manager 95.65% <ø> (ø)
content-search-toolkit 8.16% <ø> (ø)
contentful-apps 4.69% <ø> (ø)
dokobit-signing 62.27% <100.00%> (+0.08%) ⬆️
email-service 60.23% <100.00%> (+0.07%) ⬆️
feature-flags 90.90% <100.00%> (+0.06%) ⬆️
file-storage 46.07% <100.00%> (+0.10%) ⬆️
financial-aid-backend 51.43% <100.00%> (+0.01%) ⬆️
financial-aid-shared 17.88% <ø> (ø)
icelandic-names-registry-backend 54.33% <ø> (ø)
infra-nest-server 48.06% <ø> (ø)
infra-tracing 70.10% <100.00%> (+0.15%) ⬆️
island-ui-core 30.34% <ø> (ø)
judicial-system-api 20.23% <ø> (+0.02%) ⬆️
judicial-system-audit-trail 69.10% <100.00%> (+0.08%) ⬆️
judicial-system-formatters 78.52% <ø> (+0.02%) ⬆️
judicial-system-message 66.72% <100.00%> (+0.12%) ⬆️
judicial-system-message-handler 48.50% <100.00%> (+0.17%) ⬆️
judicial-system-scheduler 71.22% <100.00%> (+0.06%) ⬆️
judicial-system-types 41.54% <ø> (-0.07%) ⬇️
judicial-system-web 27.76% <ø> (-0.02%) ⬇️
license-api 42.97% <100.00%> (-0.04%) ⬇️
localization 10.15% <ø> (ø)
logging 58.02% <ø> (ø)
message-queue 67.05% <ø> (ø)
nest-audit 65.78% <ø> (ø)
nest-aws 51.93% <ø> (ø)
nest-config 76.51% <100.00%> (+0.06%) ⬆️
nest-core 53.16% <ø> (ø)
nest-feature-flags 51.12% <100.00%> (+0.06%) ⬆️
nest-problem 45.64% <ø> (ø)
nest-sequelize 94.44% <ø> (ø)
nest-swagger 51.13% <ø> (ø)
nova-sms 61.61% <100.00%> (+0.09%) ⬆️
portals-admin-regulations-admin 1.80% <ø> (ø)
portals-core 19.58% <ø> (ø)
regulations 16.78% <ø> (ø)
residence-history 85.00% <ø> (ø)
services-auth-admin-api 52.55% <100.00%> (+0.01%) ⬆️
services-auth-delegation-api 58.48% <100.00%> (+<0.01%) ⬆️
services-auth-ids-api 52.59% <100.00%> (+0.02%) ⬆️
services-auth-public-api 49.44% <100.00%> (+0.01%) ⬆️
services-sessions 65.35% <100.00%> (+0.03%) ⬆️
services-university-gateway 49.35% <100.00%> (-0.12%) ⬇️
services-user-notification 46.55% <100.00%> (+0.04%) ⬆️
services-user-profile 56.99% <100.00%> (+0.01%) ⬆️
shared-components 29.49% <ø> (ø)
shared-form-fields 33.37% <ø> (ø)
shared-mocking 58.64% <ø> (ø)
shared-pii 92.85% <ø> (ø)
shared-problem 87.50% <ø> (ø)
shared-utils 27.69% <ø> (ø)
skilavottord-ws 24.26% <ø> (ø)
web 2.39% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...modules/templates/aosh/seminars/seminars.module.ts 100.00% <100.00%> (ø)
...ate-api-modules/src/lib/modules/templates/index.ts 100.00% <100.00%> (ø)
libs/application/types/src/lib/ApplicationTypes.ts 100.00% <100.00%> (ø)
libs/application/types/src/lib/Fields.ts 100.00% <100.00%> (ø)
...ibs/application/types/src/lib/InstitutionMapper.ts 100.00% <ø> (ø)
...ompanySearchController/CompanySearchController.tsx 1.06% <ø> (ø)
libs/clients/seminars-ver/src/index.ts 100.00% <100.00%> (ø)
...bs/clients/seminars-ver/src/lib/seminars.module.ts 100.00% <100.00%> (ø)
libs/feature-flags/src/lib/features.ts 100.00% <100.00%> (ø)
...island-ui/core/src/lib/AsyncSearch/AsyncSearch.tsx 65.74% <ø> (ø)
... and 13 more

... and 39 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50422b0...6e063f9. Read the comment docs.

@sigruntg sigruntg marked this pull request as ready for review January 7, 2025 10:47
@@ -57,6 +57,7 @@ export interface AsyncSearchProps {
errorMessage?: string
hasError?: boolean
white?: boolean
isCompanySearch?: boolean
Copy link
Member

Choose a reason for hiding this comment

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

This seems really specific. If I'm understanding this correctly, you are applying different styles to the input based on this prop, right? Are the new styles based on the design system?

I'd really like some more clarity on this 🙏☺️

Copy link
Member Author

Choose a reason for hiding this comment

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

This is for an old component that I'm reusing (I made it myself years ago). But it seems it was never used next to a normal input field. So the style of the async search is completely different than a input field and it seemed really wonky. So this would compliment rest of the styles used in the application system. (CompanySearch is used in a few application in the application system, hence the name)

'createCharge.data.id',
) ?? ''
await this.seminarsClientService
.registerSeminar(auth, {
Copy link
Member

Choose a reason for hiding this comment

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

Extract-a payload-ið yfir í sína eigin breytu upp á lesanleika ?

@@ -0,0 +1,7 @@
# application-templates-aosh-seminars
Copy link
Member

Choose a reason for hiding this comment

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

Gera smá README skjal svipað og nýrri umsóknir ?

)

setBeforeSubmitCallback?.(async () => {
setIsCompanyValid(true)
Copy link
Member

Choose a reason for hiding this comment

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

Er þetta sett true of snemma ? spyr af því það er svo kallað í getIsCompanyValidCallback fyrir neðan.


export const getFields = () => import('./fields/')

export { SeminarAnswers } from './shared/types'
Copy link
Member

Choose a reason for hiding this comment

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

Þessu er export-að 2x með sama nafninu sem skapar warnings í console, bæði í browser og terminal. Þyrfti að breyta öðru nafninu.

params: {
organizationId: InstitutionNationalIds.VINNUEFTIRLITID,
},
externalDataId: 'payment',
Copy link
Member

Choose a reason for hiding this comment

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

Tveir providers með sama externalDataId 'payment'. Býr til duplicate key villu í console.


export const prerequisitesSection = buildSection({
id: 'externalData',
title: '',
Copy link
Member

@Ballioli Ballioli Jan 7, 2025

Choose a reason for hiding this comment

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

Bæta við tabTitle attribute útaf það eru engin sections þá verður nafnið á tab í browser tómt.

export const paymentArrangement = {
general: defineMessages({
sectionTitle: {
id: 'aosh.sr.application:paymentArrangement.general.sectionTitle',
Copy link
Member

Choose a reason for hiding this comment

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

Misræmi á contentful key í þessum file og í hinum, "aosh.sr" vs. "aosh.sem"

@@ -401,4 +402,8 @@ export const ApplicationConfigurations = {
slug: 'nyskraning-taekis',
translation: ['aosh.rnm.application'],
},
[ApplicationTypes.SEMINAR_REGISTRATION]: {
slug: 'vinnueftirlitid-namskeid',
translation: ['aosh.sr.application'],
Copy link
Member

Choose a reason for hiding this comment

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

Translation matchar ekki messages file-a. "aosh.sem" á flestum message file-um

export class SeminarsResolver {
constructor(private readonly seminarsService: SeminarsService) {}

@Scopes(ApiScope.vinnueftirlitid)
Copy link
Member

Choose a reason for hiding this comment

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

Set the scope over the resolver instead per endpoint

SeminarsClientModule,
ConfigModule.forRoot({
isGlobal: true,
load: [SeminarsClientConfig],
Copy link
Member

Choose a reason for hiding this comment

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

should be unecessary to import the config here if added to apps/application-system/api/src/app/app.module.ts

if (!data) {
throw new TemplateApiError(
{
summary: `Ekkert námskeið fannst með þessu númeri: ${seminarQueryId}.`,
Copy link
Member

@johannaagma johannaagma Jan 7, 2025

Choose a reason for hiding this comment

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

get from messages? (applies to all TemplateApiError here)

application,
auth,
}: TemplateApiModuleActionProps): Promise<void> {
const answers = application.answers as unknown as SeminarAnswers
Copy link
Member

Choose a reason for hiding this comment

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

Dont use "as"?

courseId: seminarQueryId,
paymentContact: {
email:
answers.paymentArrangement.individualOrCompany === 'company'
Copy link
Member

Choose a reason for hiding this comment

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

compare to enum/const?

this.individualApi.withMiddleware(new AuthMiddleware(user as Auth))

async getSeminar(auth: User, courseId: string): Promise<CourseDTO> {
return await this.courseApiWithAuth(auth).apiCourseCourseIdGet({
Copy link
Member

Choose a reason for hiding this comment

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

unecessary await

}

async isCompanyValid(auth: User, nationalId: string): Promise<CompanyDTO> {
return await this.companyApiWithAuth(auth).apiCompanyGet({
Copy link
Member

Choose a reason for hiding this comment

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

unecessary await

auth: User,
registration: ApiRegistrationPostRequest,
): Promise<void> {
return await this.registrationApiWithAuth(auth).apiRegistrationPost(
Copy link
Member

Choose a reason for hiding this comment

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

unecessary await

nationalIds: Array<string>,
courseID: string,
): Promise<Array<IndividualDTO>> {
return await this.individualApiWithAuth(auth).apiIndividualGet({
Copy link
Member

Choose a reason for hiding this comment

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

unecessary await

@@ -1130,6 +1139,7 @@
"@island.is/user-monitoring": ["libs/user-monitoring/src/index.ts"],
"@island.is/web/*": ["apps/web/*"],
"@island.is/web/component*": ["apps/web/component*/real.ts"],
"api/domains/aosh": ["libs/api/domains/aosh/src/index.ts"],
Copy link
Member

Choose a reason for hiding this comment

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

remove?

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.

6 participants