diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..91258ed --- /dev/null +++ b/.gitattributes @@ -0,0 +1,205 @@ +# These files are text and should be normalized (convert crlf => lf) +# See https://help.github.com/articles/dealing-with-line-endings/ +# And especially https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/ + +## GITATTRIBUTES FOR WEB PROJECTS +# +# These settings are for any web project. +# +# Details per file setting: +# text These files should be normalized (i.e. convert CRLF to LF). +# binary These files are binary and should be left untouched. +# +# Note that binary is a macro for -text -diff. +###################################################################### + +## AUTO-DETECT +## Handle line endings automatically for files detected as +## text and leave all files detected as binary untouched. +## This will handle all files NOT defined below. +* text=auto + +# Java sources +*.java text diff=java +*.kt text diff=kotlin +*.groovy text diff=java +*.scala text diff=java +*.gradle text diff=java +*.gradle.kts text diff=kotlin + +## SOURCE CODE +*.bat text eol=crlf +*.coffee text +*.css text +gradlew text eol=lf +*.htm text +*.html text +*.inc text +*.ini text +*.js text +*.json text +*.jsx text +*.less text +*.od text +*.onlydata text +*.php text +*.pl text +*.py text +*.rb text +*.sass text +*.scm text +*.scss text +*.sh text eol=lf +Dockerfile text eol=lf +*.sql text +*.styl text +*.tag text +*.ts text +*.tsx text +*.xml text +*.xhtml text + +## DOCKER +*.dockerignore text +Dockerfile text + +## DOCUMENTATION +*.markdown text +*.md text +*.mdwn text +*.mdown text +*.mkd text +*.mkdn text +*.mdtxt text +*.mdtext text +*.txt text +AUTHORS text +CHANGELOG text +CHANGES text +CONTRIBUTING text +COPYING text +copyright text +*COPYRIGHT* text +INSTALL text +license text +LICENSE text +NEWS text +readme text +*README* text +TODO text + +## TEMPLATES +*.dot text +*.ejs text +*.haml text +*.handlebars text +*.hbs text +*.hbt text +*.jade text +*.latte text +*.mustache text +*.njk text +*.phtml text +*.tmpl text +*.tpl text +*.twig text + +## LINTERS +.csslintrc text +.eslintrc text +.htmlhintrc text +.jscsrc text +.jshintrc text +.jshintignore text +.stylelintrc text + +## CONFIGS +*.bowerrc text +*.cnf text +*.conf text +*.config text +.browserslistrc text +.editorconfig text +.gitattributes text +.gitconfig text +.htaccess text +*.npmignore text +*.yaml text +*.yml text +browserslist text +Makefile text +makefile text + +## HEROKU +Procfile text +.slugignore text + +## GRAPHICS +*.ai binary +*.bmp binary +*.eps binary +*.gif binary +*.ico binary +*.jng binary +*.jp2 binary +*.jpg binary +*.jpeg binary +*.jpx binary +*.jxr binary +*.pdf binary +*.png binary +*.psb binary +*.psd binary +*.svg text +*.svgz binary +*.tif binary +*.tiff binary +*.wbmp binary +*.webp binary + +## AUDIO +*.kar binary +*.m4a binary +*.mid binary +*.midi binary +*.mp3 binary +*.ogg binary +*.ra binary + +## VIDEO +*.3gpp binary +*.3gp binary +*.as binary +*.asf binary +*.asx binary +*.fla binary +*.flv binary +*.m4v binary +*.mng binary +*.mov binary +*.mp4 binary +*.mpeg binary +*.mpg binary +*.ogv binary +*.swc binary +*.swf binary +*.webm binary + +## ARCHIVES +*.7z binary +*.gz binary +*.jar binary +*.rar binary +*.tar binary +*.zip binary + +## FONTS +*.ttf binary +*.eot binary +*.otf binary +*.woff binary +*.woff2 binary + +## EXECUTABLES +*.exe binary +*.pyc binary \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..87d5ecb --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,67 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Java CI with Gradle + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + + - name: Build with Gradle Wrapper + run: ./gradlew build + + # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). + # If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version. + # + # - name: Setup Gradle + # uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + # with: + # gradle-version: '8.9' + # + # - name: Build with Gradle 8.9 + # run: gradle build + + dependency-submission: + + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. + # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 diff --git a/build.gradle b/build.gradle index f761f27..13c5053 100644 --- a/build.gradle +++ b/build.gradle @@ -30,9 +30,6 @@ ext { } spotless { - // optional: limit format enforcement to just the files changed by this feature branch - ratchetFrom 'origin/main' - format 'misc', { // define the files to apply `misc` to target '*.gradle', '.gitattributes', '.gitignore' diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/FhirClientView.java b/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/FhirClientView.java index 909835a..f3ed5f1 100644 --- a/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/FhirClientView.java +++ b/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/FhirClientView.java @@ -72,12 +72,13 @@ public FhirClientView(FhirClient fhirClient) { patientDetails.setReadOnly(true); Button restartFlowButton = new Button("Restart"); - restartFlowButton.addClickListener( - event -> getUI().ifPresent(ui -> ui.navigate(""))); + restartFlowButton.addClickListener(event -> getUI().ifPresent(ui -> ui.navigate(""))); add( new H1("FHIR Client"), - new Text("Now that the Access Token was obtained, use it to read data from the FHIR server."), + new Text( + "Now that the Access Token was obtained, use it to read data from the FHIR" + + " server."), accessToken, patientId, getPatientDetails, diff --git a/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/HomeView.java b/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/HomeView.java index 9c3f046..7944d40 100644 --- a/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/HomeView.java +++ b/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/HomeView.java @@ -1,3 +1,4 @@ +/* (C)2024 */ package ro.vidi.smart_on_fhir_tutorial.view; import com.vaadin.flow.component.Text; @@ -12,14 +13,11 @@ public class HomeView extends VerticalLayout { public HomeView() { Button standaloneProviderLaunchFlow = new Button("Start Standalone Provider Launch Flow"); - standaloneProviderLaunchFlow.addClickListener(event -> getUI().ifPresent( - ui -> ui.navigate("smart-start"))); + standaloneProviderLaunchFlow.addClickListener( + event -> getUI().ifPresent(ui -> ui.navigate("smart-start"))); add( new H1("Welcome"), new Text("This Sample application will guide you trough the SMART on FHIR flow."), - standaloneProviderLaunchFlow - ); - + standaloneProviderLaunchFlow); } - } diff --git a/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/SmartCallbackView.java b/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/SmartCallbackView.java index 97ff7ed..8c7d223 100644 --- a/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/SmartCallbackView.java +++ b/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/SmartCallbackView.java @@ -93,8 +93,7 @@ public SmartCallbackView(FhirClient fhirClient, OidcClient oidcClient) { """)); Button restartFlowButton = new Button("Restart"); - restartFlowButton.addClickListener( - event -> getUI().ifPresent(ui -> ui.navigate(""))); + restartFlowButton.addClickListener(event -> getUI().ifPresent(ui -> ui.navigate(""))); accessFhirInfo = new Button("Access FHIR Data"); accessFhirInfo.setEnabled(false); @@ -129,7 +128,9 @@ public SmartCallbackView(FhirClient fhirClient, OidcClient oidcClient) { add( new H1("SMART Callback"), - new Text("Now that the authorization code was obtained, exchange it for an access token to be used when accessing the FHIR data."), + new Text( + "Now that the authorization code was obtained, exchange it for an access" + + " token to be used when accessing the FHIR data."), authorizationCode, encodedState, getAccessTokenButton, diff --git a/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/SmartStartView.java b/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/SmartStartView.java index 0f71c93..c424d8c 100644 --- a/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/SmartStartView.java +++ b/src/main/java/ro/vidi/smart_on_fhir_tutorial/view/SmartStartView.java @@ -172,7 +172,9 @@ public SmartStartView(FhirClient fhirClient, OidcClient oidcClient) { add( new H1("SMART Start"), - new Text("Configure the FHIR Server URL, discover the Auth URLs, then start the authorization flow."), + new Text( + "Configure the FHIR Server URL, discover the Auth URLs, then start the" + + " authorization flow."), fhirServerUrlLayout, discoverMetadataLayout, metadataAccordion,