-
-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Frontend: Add GeneratorButton styled with HistoryStore
- Loading branch information
Showing
39 changed files
with
670 additions
and
372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
src/main/webapp/app/springboot/primary/Generator.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 148 additions & 0 deletions
148
src/main/webapp/app/springboot/primary/generator/ServiceProjection.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
import { Service } from '@/common/domain/Service'; | ||
|
||
export type ServiceProjection = | ||
| 'aop-logging' | ||
| 'angular' | ||
| 'download' | ||
| 'initialization' | ||
| 'frontend-maven-plugin' | ||
| 'jacoco-check-minimal-coverage' | ||
| 'java-base' | ||
| 'logstash' | ||
| 'maven-java' | ||
| 'mariadb' | ||
| 'mysql' | ||
| 'mongodb' | ||
| 'mongock' | ||
| 'postgresql' | ||
| 'sonar-java-backend' | ||
| 'sonar-java-backend-and-frontend' | ||
| 'spring-boot' | ||
| 'spring-boot-actuator' | ||
| 'spring-boot-jwt' | ||
| 'spring-boot-jwt-with-basic-authentication' | ||
| 'spring-boot-mvc-with-tomcat' | ||
| 'spring-boot-webflux-netty' | ||
| 'react' | ||
| 'react-styled' | ||
| 'vue' | ||
| 'vue-styled' | ||
| 'unknown'; | ||
|
||
export const toServiceProjection = (service: Service): ServiceProjection => { | ||
switch (service) { | ||
case Service.AOP_LOGGING: | ||
return 'aop-logging'; | ||
case Service.ANGULAR: | ||
return 'angular'; | ||
case Service.DOWNLOAD: | ||
return 'download'; | ||
case Service.INITIALIZATION: | ||
return 'initialization'; | ||
case Service.FRONTEND_MAVEN_PLUGIN: | ||
return 'frontend-maven-plugin'; | ||
case Service.JACOCO_CHECK_MINIMAL_COVERAGE: | ||
return 'jacoco-check-minimal-coverage'; | ||
case Service.JAVA_BASE: | ||
return 'java-base'; | ||
case Service.LOGSTASH: | ||
return 'logstash'; | ||
case Service.MAVEN_JAVA: | ||
return 'maven-java'; | ||
case Service.MARIADB: | ||
return 'mariadb'; | ||
case Service.MYSQL: | ||
return 'mysql'; | ||
case Service.MONGODB: | ||
return 'mongodb'; | ||
case Service.MONGOCK: | ||
return 'mongock'; | ||
case Service.POSTGRESQL: | ||
return 'postgresql'; | ||
case Service.SONAR_JAVA_BACKEND: | ||
return 'sonar-java-backend'; | ||
case Service.SONAR_JAVA_BACKEND_AND_FRONTEND: | ||
return 'sonar-java-backend-and-frontend'; | ||
case Service.SPRINGBOOT: | ||
return 'spring-boot'; | ||
case Service.SPRINGBOOT_ACTUATOR: | ||
return 'spring-boot-actuator'; | ||
case Service.SPRINGBOOT_JWT: | ||
return 'spring-boot-jwt'; | ||
case Service.SPRINGBOOT_JWT_WITH_BASIC_AUTHENTICATION: | ||
return 'spring-boot-jwt-with-basic-authentication'; | ||
case Service.SPRINGBOOT_MVC_WITH_TOMCAT: | ||
return 'spring-boot-mvc-with-tomcat'; | ||
case Service.SPRINGBOOT_WEBFLUX_NETTY: | ||
return 'spring-boot-webflux-netty'; | ||
case Service.REACT: | ||
return 'react'; | ||
case Service.REACT_STYLED: | ||
return 'react-styled'; | ||
case Service.VUE: | ||
return 'vue'; | ||
case Service.VUE_STYLED: | ||
return 'vue-styled'; | ||
case Service.UNKNOWN: | ||
return 'unknown'; | ||
} | ||
}; | ||
|
||
export const fromServiceProjection = (serviceProjection: ServiceProjection): Service => { | ||
switch (serviceProjection) { | ||
case 'aop-logging': | ||
return Service.AOP_LOGGING; | ||
case 'angular': | ||
return Service.ANGULAR; | ||
case 'download': | ||
return Service.DOWNLOAD; | ||
case 'initialization': | ||
return Service.INITIALIZATION; | ||
case 'frontend-maven-plugin': | ||
return Service.FRONTEND_MAVEN_PLUGIN; | ||
case 'jacoco-check-minimal-coverage': | ||
return Service.JACOCO_CHECK_MINIMAL_COVERAGE; | ||
case 'java-base': | ||
return Service.JAVA_BASE; | ||
case 'logstash': | ||
return Service.LOGSTASH; | ||
case 'maven-java': | ||
return Service.MAVEN_JAVA; | ||
case 'mariadb': | ||
return Service.MARIADB; | ||
case 'mysql': | ||
return Service.MYSQL; | ||
case 'mongodb': | ||
return Service.MONGODB; | ||
case 'mongock': | ||
return Service.MONGOCK; | ||
case 'postgresql': | ||
return Service.POSTGRESQL; | ||
case 'sonar-java-backend': | ||
return Service.SONAR_JAVA_BACKEND; | ||
case 'sonar-java-backend-and-frontend': | ||
return Service.SONAR_JAVA_BACKEND_AND_FRONTEND; | ||
case 'spring-boot': | ||
return Service.SPRINGBOOT; | ||
case 'spring-boot-actuator': | ||
return Service.SPRINGBOOT_ACTUATOR; | ||
case 'spring-boot-jwt': | ||
return Service.SPRINGBOOT_JWT; | ||
case 'spring-boot-jwt-with-basic-authentication': | ||
return Service.SPRINGBOOT_JWT_WITH_BASIC_AUTHENTICATION; | ||
case 'spring-boot-mvc-with-tomcat': | ||
return Service.SPRINGBOOT_MVC_WITH_TOMCAT; | ||
case 'spring-boot-webflux-netty': | ||
return Service.SPRINGBOOT_WEBFLUX_NETTY; | ||
case 'react': | ||
return Service.REACT; | ||
case 'react-styled': | ||
return Service.REACT_STYLED; | ||
case 'vue': | ||
return Service.VUE; | ||
case 'vue-styled': | ||
return Service.VUE_STYLED; | ||
case 'unknown': | ||
return Service.UNKNOWN; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 1 addition & 6 deletions
7
...ry/angular-generator/AngularGenerator.vue → ...or/angular-generator/AngularGenerator.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
...ain/webapp/app/springboot/primary/generator/generator-button/GeneratorButton.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { computed, defineComponent, inject } from 'vue'; | ||
import { DefaultButtonVue } from '@/common/primary/default-button'; | ||
import { StoreGeneric } from 'pinia'; | ||
import { fromServiceProjection, ServiceProjection } from '@/springboot/primary/generator/ServiceProjection'; | ||
|
||
export default defineComponent({ | ||
name: 'GeneratorButtonComponent', | ||
|
||
components: { | ||
DefaultButtonVue, | ||
}, | ||
|
||
props: { | ||
label: { | ||
type: String, | ||
required: true, | ||
}, | ||
service: { | ||
type: String, | ||
required: true, | ||
}, | ||
selectorPrefix: { | ||
type: String, | ||
required: true, | ||
}, | ||
}, | ||
|
||
setup(props) { | ||
const historyStore = inject('historyStore') as StoreGeneric; | ||
|
||
const hasCalledService = computed(() => historyStore.hasCalledService(fromServiceProjection(props.service as ServiceProjection))); | ||
|
||
return { | ||
hasCalledService, | ||
}; | ||
}, | ||
}); |
11 changes: 11 additions & 0 deletions
11
src/main/webapp/app/springboot/primary/generator/generator-button/GeneratorButton.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<template> | ||
<DefaultButtonVue | ||
:id="`generator-button-${service}`" | ||
:label="label" | ||
:icon="hasCalledService ? 'arrow-clockwise' : undefined" | ||
:outlined="hasCalledService" | ||
:data-selector="`${selectorPrefix}.add-${service}-button`" | ||
/> | ||
</template> | ||
|
||
<script lang="ts" src="./GeneratorButton.component.ts"></script> |
4 changes: 4 additions & 0 deletions
4
src/main/webapp/app/springboot/primary/generator/generator-button/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import GeneratorButtonComponent from './GeneratorButton.component'; | ||
import GeneratorButtonVue from './GeneratorButton.vue'; | ||
|
||
export { GeneratorButtonComponent, GeneratorButtonVue }; |
4 changes: 2 additions & 2 deletions
4
...t-generator/ProjectGenerator.component.ts → ...t-generator/ProjectGenerator.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/main/webapp/app/springboot/primary/generator/project-generator/ProjectGenerator.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template> | ||
<div id="v-pills-init" class="tab-pane fade show active" role="tabpanel" aria-labelledby="v-pills-home-tab"> | ||
<div class="d-flex flex-column gap-3"> | ||
<div> | ||
<GeneratorButtonVue :label="'Init'" :service="'initialization'" :selector-prefix="selectorPrefix" @click.prevent="initProject" /> | ||
</div> | ||
<div> | ||
<GeneratorButtonVue | ||
v-if="buildTool === 'maven'" | ||
:label="'Maven'" | ||
:service="'maven-java'" | ||
:selector-prefix="selectorPrefix" | ||
@click.prevent="addMaven" | ||
/> | ||
<GeneratorButtonVue | ||
:label="'JaCoCo'" | ||
:service="'jacoco-check-minimal-coverage'" | ||
:selector-prefix="selectorPrefix" | ||
@click.prevent="addJaCoCo" | ||
/> | ||
<GeneratorButtonVue | ||
:label="'Sonar Backend'" | ||
:service="'sonar-java-backend'" | ||
:selector-prefix="selectorPrefix" | ||
@click.prevent="addSonarBackend" | ||
/> | ||
<GeneratorButtonVue | ||
:label="'Sonar Backend+Frontend'" | ||
:service="'sonar-java-backend-and-frontend'" | ||
:selector-prefix="selectorPrefix" | ||
@click.prevent="addSonarBackendFrontend" | ||
/> | ||
</div> | ||
<div> | ||
<GeneratorButtonVue :label="'Java Base'" :service="'java-base'" :selector-prefix="selectorPrefix" @click.prevent="addJavaBase" /> | ||
</div> | ||
<div> | ||
<GeneratorButtonVue | ||
:label="'Frontend Maven Plugin'" | ||
:service="'frontend-maven-plugin'" | ||
:selector-prefix="selectorPrefix" | ||
@click.prevent="addFrontendMavenPlugin" | ||
/> | ||
</div> | ||
<div> | ||
<GeneratorButtonVue | ||
v-if="project.folder !== ''" | ||
:label="'Download'" | ||
:service="'download'" | ||
:selector-prefix="selectorPrefix" | ||
@click.prevent="download" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" src="./ProjectGenerator.component.ts"></script> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.