Skip to content

Commit

Permalink
Merge pull request #57 from virtualidentityag/feat/1604-Move_calcom_u…
Browse files Browse the repository at this point in the history
…rl_to_application_level_settings

Add calendar app and budibase url to application settings
  • Loading branch information
adnanalicic authored Sep 22, 2022
2 parents 4fc3f4a + 8a5dae6 commit 731e4ce
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 2 deletions.
6 changes: 6 additions & 0 deletions api/applicationsettingsservice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ components:
budibaseAuthClientId:
allOf:
- $ref: '#/components/schemas/SettingDTO'
budibaseUrl:
allOf:
- $ref: '#/components/schemas/SettingDTO'
calendarAppUrl:
allOf:
- $ref: '#/components/schemas/SettingDTO'

FeatureToggleDTO:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public ApplicationSettingsDTO toDTO(ApplicationSettingsEntity applicationSetting
toSettingDTO(applicationSettings.getMainTenantSubdomainForSingleDomainMultitenancy()))
.useOverviewPage(toFeatureToggleDTO(applicationSettings.getUseOverviewPage()))
.calcomUrl(toSettingDTO(applicationSettings.getCalcomUrl()))
.budibaseAuthClientId(toSettingDTO(applicationSettings.getBudibaseAuthClientId()));
.budibaseAuthClientId(toSettingDTO(applicationSettings.getBudibaseAuthClientId()))
.budibaseUrl(toSettingDTO(applicationSettings.getBudibaseUrl()))
.calendarAppUrl(toSettingDTO(applicationSettings.getCalendarAppUrl()));
}

private SettingDTO toSettingDTO(Object setting) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import de.caritas.cob.consultingtypeservice.api.model.ApplicationSettingsEntity;
import de.caritas.cob.consultingtypeservice.api.repository.ApplicationSettingsRepository;
import de.caritas.cob.consultingtypeservice.schemas.model.BudibaseAuthClientId;
import de.caritas.cob.consultingtypeservice.schemas.model.BudibaseUrl;
import de.caritas.cob.consultingtypeservice.schemas.model.CalcomUrl;
import de.caritas.cob.consultingtypeservice.schemas.model.CalendarAppUrl;
import de.caritas.cob.consultingtypeservice.schemas.model.DisableVideoAppointments;
import de.caritas.cob.consultingtypeservice.schemas.model.EnableWalkthrough;
import de.caritas.cob.consultingtypeservice.schemas.model.MainTenantSubdomainForSingleDomainMultitenancy;
Expand Down Expand Up @@ -61,6 +63,8 @@ private ApplicationSettingsEntity createDefaultApplicationSettings() {
entity.setUseOverviewPage(new UseOverviewPage().withValue(false).withReadOnly(false));
entity.setCalcomUrl(new CalcomUrl().withValue("calcomUrl").withReadOnly(false));
entity.setBudibaseAuthClientId(new BudibaseAuthClientId().withValue("budibaseAuthClientId").withReadOnly(false));
entity.setBudibaseUrl(new BudibaseUrl().withValue("budibaseUrl").withReadOnly(false));
entity.setCalendarAppUrl(new CalendarAppUrl().withValue("calendarAppUrl").withReadOnly(false));
return entity;
}
}
32 changes: 31 additions & 1 deletion src/main/resources/schemas/application-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,37 @@
"value",
"readOnly"
]
}
},
"budibaseUrl": {
"type": "object",
"properties": {
"value": {
"type": "string"
},
"readOnly": {
"type": "boolean"
}
},
"required": [
"value",
"readOnly"
]
},
"calendarAppUrl": {
"type": "object",
"properties": {
"value": {
"type": "string"
},
"readOnly": {
"type": "boolean"
}
}
},
"required": [
"value",
"readOnly"
]
},
"required": [
"multitenancyWithSingleDomainEnabled",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ void getApplicationSettings_Should_ReturnApplicationSettings_When_UserIsNotAuthe
.andExpect(jsonPath("$.budibaseAuthClientId.readOnly").value(false))
.andExpect(jsonPath("$.calcomUrl.value").value("calcomUrl"))
.andExpect(jsonPath("$.calcomUrl.readOnly").value(false))
.andExpect(jsonPath("$.budibaseUrl.value").value("budibaseUrl"))
.andExpect(jsonPath("$.budibaseUrl.readOnly").value(false))
.andExpect(jsonPath("$.calendarAppUrl.value").value("calendarAppUrl"))
.andExpect(jsonPath("$.calendarAppUrl.readOnly").value(false))
.andExpect(jsonPath("$.useOverviewPage.value").value(false))
.andExpect(jsonPath("$.useOverviewPage.readOnly").value(false));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import de.caritas.cob.consultingtypeservice.api.model.ApplicationSettingsDTO;
import de.caritas.cob.consultingtypeservice.api.model.ApplicationSettingsEntity;
import de.caritas.cob.consultingtypeservice.schemas.model.BudibaseAuthClientId;
import de.caritas.cob.consultingtypeservice.schemas.model.BudibaseUrl;
import de.caritas.cob.consultingtypeservice.schemas.model.CalcomUrl;
import de.caritas.cob.consultingtypeservice.schemas.model.CalendarAppUrl;
import de.caritas.cob.consultingtypeservice.schemas.model.DisableVideoAppointments;
import de.caritas.cob.consultingtypeservice.schemas.model.EnableWalkthrough;
import de.caritas.cob.consultingtypeservice.schemas.model.MainTenantSubdomainForSingleDomainMultitenancy;
Expand Down Expand Up @@ -60,6 +62,8 @@ void toDTO_Should_ConvertToDTOAllSettings() {
assertThat(applicationSettingsDTO.getBudibaseAuthClientId().getReadOnly()).isEqualTo(false);
assertThat(applicationSettingsDTO.getBudibaseAuthClientId().getValue()).isEqualTo("budibaseAuthClientId");
assertThat(applicationSettingsDTO.getCalcomUrl().getValue()).isEqualTo("calcomUrl");
assertThat(applicationSettingsDTO.getBudibaseUrl().getValue()).isEqualTo("budibaseUrl");
assertThat(applicationSettingsDTO.getCalendarAppUrl().getValue()).isEqualTo("calendarAppUrl");
assertThat(applicationSettingsDTO.getCalcomUrl().getReadOnly()).isEqualTo(false);
assertThat(applicationSettingsDTO.getUseOverviewPage().getValue()).isFalse();
assertThat(applicationSettingsDTO.getUseOverviewPage().getReadOnly()).isFalse();
Expand All @@ -75,6 +79,8 @@ private ApplicationSettingsEntity giveApplicationSettings() {
settings.setMainTenantSubdomainForSingleDomainMultitenancy(new MainTenantSubdomainForSingleDomainMultitenancy().withReadOnly(false).withValue("app"));
settings.setBudibaseAuthClientId(new BudibaseAuthClientId().withReadOnly(false).withValue("budibaseAuthClientId"));
settings.setCalcomUrl(new CalcomUrl().withReadOnly(false).withValue("calcomUrl"));
settings.setBudibaseUrl(new BudibaseUrl().withReadOnly(false).withValue("budibaseUrl"));
settings.setCalendarAppUrl(new CalendarAppUrl().withReadOnly(false).withValue("calendarAppUrl"));
settings.setUseOverviewPage(new UseOverviewPage().withReadOnly(false).withValue(false));
return settings;
}
Expand Down

0 comments on commit 731e4ce

Please sign in to comment.