From 3e5a8f8e683312b530bfd1671fd9d2670ecca91b Mon Sep 17 00:00:00 2001 From: Jodie Muramoto Date: Thu, 18 Oct 2018 13:35:15 -0700 Subject: [PATCH 01/15] SHIBUI-930: Updated dropdown values for 'Max Validity Interval' to be more in alignment with proper usage; --- .../filebacked-http-filters.schema.json | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ui/src/assets/schema/provider/filebacked-http-filters.schema.json b/ui/src/assets/schema/provider/filebacked-http-filters.schema.json index 7672a580e..20cf1fef0 100644 --- a/ui/src/assets/schema/provider/filebacked-http-filters.schema.json +++ b/ui/src/assets/schema/provider/filebacked-http-filters.schema.json @@ -21,15 +21,13 @@ "widget": { "id": "datalist", "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" + "1H", + "8H", + "1D", + "5D", + "7D", + "14D", + "30D" ] }, "default": null, @@ -127,4 +125,4 @@ } } } -} \ No newline at end of file +} From dcea4cd489589516072620a7b8bab9be6c4dd010 Mon Sep 17 00:00:00 2001 From: Jodie Muramoto Date: Thu, 18 Oct 2018 15:17:22 -0500 Subject: [PATCH 02/15] SHIBUI-931: Corrected info text for useDefaultPredicateRegistry, satisfyAnyPredicates from the Shibboleth wiki; (cherry picked from commit 1c9ae89c1b8159bab64dfa17251860517bf9b0f5) --- backend/src/main/resources/i18n/messages_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/resources/i18n/messages_en.properties b/backend/src/main/resources/i18n/messages_en.properties index 964ef0e77..24ab60914 100644 --- a/backend/src/main/resources/i18n/messages_en.properties +++ b/backend/src/main/resources/i18n/messages_en.properties @@ -426,7 +426,7 @@ tooltip.backing-file=Specifies where the backing file is located. If the remote tooltip.backup-file-init-refresh-delay=Delay duration after which to schedule next HTTP refresh when initialized from the backing file. tooltip.require-valid-metadata=Whether candidate metadata found by the resolver must be valid in order to be returned (where validity is implementation specific, but in SAML cases generally depends on a validUntil attribute.) If this flag is true, then invalid candidate metadata will not be returned. tooltip.fail-fast-init=Whether to fail initialization of the underlying MetadataResolverService (and possibly the IdP as a whole) if the initialization of a metadata provider fails. When false, the IdP may start, and will continue to attempt to reload valid metadata if configured to do so, but operations that require valid metadata will fail until it does. -tooltip.use-default-predicate-reg=Whether to fail initialization of the underlying MetadataResolverService (and possibly the IdP as a whole) if the initialization of a metadata provider fails. When false, the IdP may start, and will continue to attempt to reload valid metadata if configured to do so, but operations that require valid metadata will fail until it does. +tooltip.use-default-predicate-reg=Flag which determines whether the default CriterionPredicateRegistry will be used if a custom one is not supplied explicitly. tooltip.satisfy-any-predicates=Flag which determines whether predicates used in filtering are connected by a logical 'OR' (true) or by logical 'AND' (false). tooltip.enable-provider-upon-saving=Enable Metadata Provider upon saving? From e973dc5308b2090b9683f9feaf6dd72dd5bc33a3 Mon Sep 17 00:00:00 2001 From: Jj! Date: Fri, 26 Oct 2018 12:42:50 -0500 Subject: [PATCH 03/15] [SHIBUI-955] --- .../assets/schema/provider/filebacked-http-filters.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/assets/schema/provider/filebacked-http-filters.schema.json b/ui/src/assets/schema/provider/filebacked-http-filters.schema.json index 20cf1fef0..f9a616084 100644 --- a/ui/src/assets/schema/provider/filebacked-http-filters.schema.json +++ b/ui/src/assets/schema/provider/filebacked-http-filters.schema.json @@ -52,7 +52,7 @@ "title": "label.certificate-file", "description": "tooltip.certificate-file", "type": "string", - "widget": "textarea", + "widget": "textline", "default": "" } }, From 05c7d9c5f546529e0267ae0cd1232ecde5de5797 Mon Sep 17 00:00:00 2001 From: Jj! Date: Fri, 26 Oct 2018 12:49:08 -0500 Subject: [PATCH 04/15] [SHIBUI-930] rearrange, fix format --- .../provider/filebacked-http-filters.schema.json | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ui/src/assets/schema/provider/filebacked-http-filters.schema.json b/ui/src/assets/schema/provider/filebacked-http-filters.schema.json index f9a616084..a1e1b48eb 100644 --- a/ui/src/assets/schema/provider/filebacked-http-filters.schema.json +++ b/ui/src/assets/schema/provider/filebacked-http-filters.schema.json @@ -21,13 +21,11 @@ "widget": { "id": "datalist", "data": [ - "1H", - "8H", - "1D", - "5D", - "7D", - "14D", - "30D" + "PT0S", + "PT14D", + "PT7D", + "PT1D", + "PT12H" ] }, "default": null, From 6e159f7ad5610cb33ed6a6c3f91128696e461c4c Mon Sep 17 00:00:00 2001 From: Jj! Date: Fri, 26 Oct 2018 13:39:56 -0500 Subject: [PATCH 05/15] [nojira] update comments add default properties notes --- .../src/main/resources/application.properties | 2 + docs/DEFAULTPROPERTIES.md | 72 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 docs/DEFAULTPROPERTIES.md diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index e91e8370d..f683d33ae 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -42,6 +42,7 @@ spring.jpa.properties.hibernate.format_sql=false spring.jpa.hibernate.use-new-id-generator-mappings=true +# Set the following property to periodically write out the generated metadata files # shibui.metadata-dir=/opt/shibboleth-idp/metadata/generated shibui.logout-url=/dashboard @@ -56,5 +57,6 @@ shibui.logout-url=/dashboard ### # metadata-providers.xml write configuration +# Set the following property to periodically write out metadata providers configuration # shibui.metadataProviders.target=file:/opt/shibboleth-idp/conf/shibui-metadata-providers.xml # shibui.metadataProviders.taskRunRate=30000 diff --git a/docs/DEFAULTPROPERTIES.md b/docs/DEFAULTPROPERTIES.md new file mode 100644 index 000000000..ebbf693d1 --- /dev/null +++ b/docs/DEFAULTPROPERTIES.md @@ -0,0 +1,72 @@ +# Default properties + +This is a reflection of the default `application.properties` file included in the distribution. Note that lines +beginning with `#` are commented out. + +Please refer to the Spring Boot documentation [https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html] +for more information. + +```properties +# Server Configuration +#server.port=8080 + +# Logging Configuration +#logging.config=classpath:log4j2.xml + +logging.level.org.springframework=INFO +logging.level.edu.internet2.tier.shibboleth.admin.ui=INFO + +# Database Credentials +spring.datasource.username=shibui +spring.datasource.password=shibui + +# Database Configuration H2 +spring.datasource.url=jdbc:h2:mem:shibui;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE +spring.datasource.platform=h2 +spring.datasource.driverClassName=org.h2.Driver +spring.jpa.database-platform=org.hibernate.dialect.H2Dialect +spring.h2.console.enabled=true + + +# Database Configuration PostgreSQL +#spring.datasource.url=jdbc:postgresql://localhost:5432/shibui +#spring.datasource.driverClassName=org.postgresql.Driver +#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect + +#Maria/MySQL DB +#spring.datasource.url=jdbc:mariadb://localhost:3306/shibui +#spring.datasource.driverClassName=org.mariadb.jdbc.Driver +#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDBDialect + +# Liquibase properties +spring.liquibase.enabled=false +#spring.liquibase.change-log=classpath:edu/internet2/tier/shibboleth/admin/ui/database/masterchangelog.xml + +# Hibernate properties +# for production never ever use create, create-drop. It's BEST to use validate +spring.jpa.hibernate.ddl-auto=update +spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=false + +spring.jpa.hibernate.use-new-id-generator-mappings=true + +# Set the following property to periodically write out the generated metadata files +# shibui.metadata-dir=/opt/shibboleth-idp/metadata/generated +shibui.logout-url=/dashboard + +# spring.profiles.active=default + +#shibui.default-password= + +#Actuator endpoints (info) +# Un-comment to get full git details exposed like author, abbreviated SHA-1, commit message +#management.info.git.mode=full + +### +# metadata-providers.xml write configuration + +# Set the following property to periodically write out metadata providers configuration +# shibui.metadataProviders.target=file:/opt/shibboleth-idp/conf/shibui-metadata-providers.xml +# shibui.metadataProviders.taskRunRate=30000 +``` \ No newline at end of file From 6a560c643f63ab2e73b44f56c2800ec9f3f79204 Mon Sep 17 00:00:00 2001 From: Jj! Date: Sat, 27 Oct 2018 12:12:54 -0500 Subject: [PATCH 06/15] [nojira] pull out specific docs for metadata providers and sources generation --- docs/METADATAPROVIDERS.md | 16 ++++++++++++++++ docs/METADATASOURCES.md | 15 +++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 docs/METADATAPROVIDERS.md create mode 100644 docs/METADATASOURCES.md diff --git a/docs/METADATAPROVIDERS.md b/docs/METADATAPROVIDERS.md new file mode 100644 index 000000000..547dc6c3e --- /dev/null +++ b/docs/METADATAPROVIDERS.md @@ -0,0 +1,16 @@ +# Metadata providers + +The application can generate a `metadata-providers.xml` configuration appropriate for use in the Shibboleth IdP. +There are 2 ways to access this configuration: through a web endpoint or a file. + +1. Web endpoint + + A request can be made to the `${ui.baseUrl}/api/MetadataResolvers` to get the + current configuration + +2. File export + + A file can be periodically written to disk. Set the application property `shibui.metadataProviders.target`, + pointing to a spring file resource. Note that there is no value set by default, and nothing will be written + out by default. A file, once defined, will be written every 30 seconds by default. To change the rate, set the + `shibui.metadataProviders.taskRunRate` application property, in milliseconds. \ No newline at end of file diff --git a/docs/METADATASOURCES.md b/docs/METADATASOURCES.md new file mode 100644 index 000000000..1e628c46d --- /dev/null +++ b/docs/METADATASOURCES.md @@ -0,0 +1,15 @@ +# Metdata Sources + +Metadata sources in the UI are individual metadata artifacts describing single entities, typically +relying parties. There are 2 ways to access these artifacts. + +1. MDQ + + _To be written_ + +2. File export + + Files can be periodically written to disk. Define the application property `shibui.metadata-dir`, + and the files will be written out by default every 30 seconds. Note that there is no default value + set for this property and no file will be written by default. To change the run rate, set the + `shibui.taskRunRate` application property, in milliseconds. \ No newline at end of file From e3e18e6fb8d2789027709910e49e15575cc93a83 Mon Sep 17 00:00:00 2001 From: Jj! Date: Mon, 29 Oct 2018 10:20:44 -0500 Subject: [PATCH 07/15] [nojira] change version number --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 60c4a518e..9c3c0f18e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ name=shibui group=edu.internet2.tier.shibboleth.admin.ui -version=1.5.0-SNAPSHOT +version=1.4.1-SNAPSHOT shibboleth.version=3.4.0 opensaml.version=3.4.0 From 6d217552c624a495e58dcc2c2fd6a60926eaa21b Mon Sep 17 00:00:00 2001 From: Jj! Date: Mon, 29 Oct 2018 10:51:33 -0500 Subject: [PATCH 08/15] [nojira] extra note --- backend/src/main/resources/application.properties | 4 ++-- docs/DEFAULTPROPERTIES.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index f683d33ae..7626d004c 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -42,7 +42,7 @@ spring.jpa.properties.hibernate.format_sql=false spring.jpa.hibernate.use-new-id-generator-mappings=true -# Set the following property to periodically write out the generated metadata files +# Set the following property to periodically write out the generated metadata files. There is no default value; the following is just an example # shibui.metadata-dir=/opt/shibboleth-idp/metadata/generated shibui.logout-url=/dashboard @@ -57,6 +57,6 @@ shibui.logout-url=/dashboard ### # metadata-providers.xml write configuration -# Set the following property to periodically write out metadata providers configuration +# Set the following property to periodically write out metadata providers configuration. There is no default value; the following is just an example # shibui.metadataProviders.target=file:/opt/shibboleth-idp/conf/shibui-metadata-providers.xml # shibui.metadataProviders.taskRunRate=30000 diff --git a/docs/DEFAULTPROPERTIES.md b/docs/DEFAULTPROPERTIES.md index ebbf693d1..75916235a 100644 --- a/docs/DEFAULTPROPERTIES.md +++ b/docs/DEFAULTPROPERTIES.md @@ -51,7 +51,7 @@ spring.jpa.properties.hibernate.format_sql=false spring.jpa.hibernate.use-new-id-generator-mappings=true -# Set the following property to periodically write out the generated metadata files +# Set the following property to periodically write out the generated metadata files. There is no default value; the following is just an example # shibui.metadata-dir=/opt/shibboleth-idp/metadata/generated shibui.logout-url=/dashboard @@ -66,7 +66,7 @@ shibui.logout-url=/dashboard ### # metadata-providers.xml write configuration -# Set the following property to periodically write out metadata providers configuration +# Set the following property to periodically write out metadata providers configuration. There is no default value; the following is just an example # shibui.metadataProviders.target=file:/opt/shibboleth-idp/conf/shibui-metadata-providers.xml # shibui.metadataProviders.taskRunRate=30000 ``` \ No newline at end of file From 8122a26cb58cf95bd10643a8c28a723e8c5a045f Mon Sep 17 00:00:00 2001 From: Jj! Date: Mon, 29 Oct 2018 10:57:05 -0500 Subject: [PATCH 09/15] [nojira] fix formats --- .../schema/provider/filebacked-http-filters.schema.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/src/assets/schema/provider/filebacked-http-filters.schema.json b/ui/src/assets/schema/provider/filebacked-http-filters.schema.json index a1e1b48eb..eb65584ac 100644 --- a/ui/src/assets/schema/provider/filebacked-http-filters.schema.json +++ b/ui/src/assets/schema/provider/filebacked-http-filters.schema.json @@ -22,10 +22,10 @@ "id": "datalist", "data": [ "PT0S", - "PT14D", - "PT7D", - "PT1D", - "PT12H" + "P14D", + "P7D", + "P1D", + "P12H" ] }, "default": null, From 3ce04ef49a463daef14750c55d178bd844b6cb89 Mon Sep 17 00:00:00 2001 From: Jj! Date: Mon, 29 Oct 2018 11:05:38 -0500 Subject: [PATCH 10/15] [nojira] update documentation --- docs/METADATAPROVIDERS.md | 8 +++++++- docs/METADATASOURCES.md | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/METADATAPROVIDERS.md b/docs/METADATAPROVIDERS.md index 547dc6c3e..32d02149b 100644 --- a/docs/METADATAPROVIDERS.md +++ b/docs/METADATAPROVIDERS.md @@ -13,4 +13,10 @@ There are 2 ways to access this configuration: through a web endpoint or a file. A file can be periodically written to disk. Set the application property `shibui.metadataProviders.target`, pointing to a spring file resource. Note that there is no value set by default, and nothing will be written out by default. A file, once defined, will be written every 30 seconds by default. To change the rate, set the - `shibui.metadataProviders.taskRunRate` application property, in milliseconds. \ No newline at end of file + `shibui.metadataProviders.taskRunRate` application property, in milliseconds. + +## Docker considerations + +If writing the file out, one should use a mount in the docker container for the destination. While a bind mount +might be easiest, if running on a Windows host, one might run into problems. This is easily avoided by using a +volume instead. Refer to [https://docs.docker.com/storage/] for more information. \ No newline at end of file diff --git a/docs/METADATASOURCES.md b/docs/METADATASOURCES.md index 1e628c46d..2ec2563b6 100644 --- a/docs/METADATASOURCES.md +++ b/docs/METADATASOURCES.md @@ -12,4 +12,10 @@ relying parties. There are 2 ways to access these artifacts. Files can be periodically written to disk. Define the application property `shibui.metadata-dir`, and the files will be written out by default every 30 seconds. Note that there is no default value set for this property and no file will be written by default. To change the run rate, set the - `shibui.taskRunRate` application property, in milliseconds. \ No newline at end of file + `shibui.taskRunRate` application property, in milliseconds. + +## Docker considerations + +If writing the files out, one should use a mount in the docker container for the destination. While a bind mount +might be easiest, if running on a Windows host, one might run into problems. This is easily avoided by using a +volume instead. Refer to [https://docs.docker.com/storage/] for more information. \ No newline at end of file From ab99f9a73cfc2ba83dd8fe52202abf42d78f30fa Mon Sep 17 00:00:00 2001 From: Jj! Date: Mon, 29 Oct 2018 11:21:30 -0500 Subject: [PATCH 11/15] [nojira] fix duration --- .../assets/schema/provider/filebacked-http-filters.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/assets/schema/provider/filebacked-http-filters.schema.json b/ui/src/assets/schema/provider/filebacked-http-filters.schema.json index eb65584ac..ee7b8208d 100644 --- a/ui/src/assets/schema/provider/filebacked-http-filters.schema.json +++ b/ui/src/assets/schema/provider/filebacked-http-filters.schema.json @@ -25,7 +25,7 @@ "P14D", "P7D", "P1D", - "P12H" + "PT12H" ] }, "default": null, From 629322ad673f91774afe88b469fcafcf45054ac6 Mon Sep 17 00:00:00 2001 From: Jj! Date: Mon, 29 Oct 2018 13:11:23 -0500 Subject: [PATCH 12/15] [v1.4.1] --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 9c3c0f18e..94c15eea8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ name=shibui group=edu.internet2.tier.shibboleth.admin.ui -version=1.4.1-SNAPSHOT +version=1.4.1 shibboleth.version=3.4.0 opensaml.version=3.4.0 From d6a401e22f4b6052b7311d50ffc089e0cd8bee91 Mon Sep 17 00:00:00 2001 From: Jj! Date: Mon, 29 Oct 2018 17:19:37 -0500 Subject: [PATCH 13/15] update for next development cycle --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 94c15eea8..60c4a518e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ name=shibui group=edu.internet2.tier.shibboleth.admin.ui -version=1.4.1 +version=1.5.0-SNAPSHOT shibboleth.version=3.4.0 opensaml.version=3.4.0 From e4498de132466bf1187f0013d1cfd62eff4163e2 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Thu, 8 Nov 2018 08:54:19 -0700 Subject: [PATCH 14/15] SHIBUI-947 Fixed issue with modal --- backend/src/main/resources/i18n/messages_en.properties | 1 + backend/src/main/resources/metadata-sources-ui-schema.json | 1 + .../manager/container/dashboard-resolvers-list.component.ts | 2 +- .../resolver/container/resolver-wizard-step.component.ts | 6 +++--- .../resolver/container/resolver-wizard.component.ts | 5 ++--- .../metadata/resolver/effect/draft-collection.effects.ts | 2 +- ui/src/app/wizard/component/wizard.component.html | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/backend/src/main/resources/i18n/messages_en.properties b/backend/src/main/resources/i18n/messages_en.properties index 3d4670252..bf1d807bf 100644 --- a/backend/src/main/resources/i18n/messages_en.properties +++ b/backend/src/main/resources/i18n/messages_en.properties @@ -215,6 +215,7 @@ label.entity-id=Entity ID label.service-provider-name=Service Provider Name label.organization=Organization label.contacts=Contacts +label.contact=Contact label.mdui=MDUI Information label.service-provider-sso-descriptor=Service Provider Sso Descriptor label.service-enabled=Service Enabled diff --git a/backend/src/main/resources/metadata-sources-ui-schema.json b/backend/src/main/resources/metadata-sources-ui-schema.json index c06e299a6..e2a2298dd 100644 --- a/backend/src/main/resources/metadata-sources-ui-schema.json +++ b/backend/src/main/resources/metadata-sources-ui-schema.json @@ -370,6 +370,7 @@ }, "definitions": { "Contact": { + "title": "label.contact", "type": "object", "required": [ "name", diff --git a/ui/src/app/metadata/manager/container/dashboard-resolvers-list.component.ts b/ui/src/app/metadata/manager/container/dashboard-resolvers-list.component.ts index 8f8caca24..e6577886d 100644 --- a/ui/src/app/metadata/manager/container/dashboard-resolvers-list.component.ts +++ b/ui/src/app/metadata/manager/container/dashboard-resolvers-list.component.ts @@ -72,7 +72,7 @@ export class DashboardResolversListComponent implements OnInit { edit(entity: MetadataEntity): void { if (entity.isDraft()) { - this.router.navigate(['metadata', 'resolver', 'new'], { + this.router.navigate(['metadata', 'resolver', 'new', 'blank', 'org-info'], { queryParams: { id: entity.getId() } diff --git a/ui/src/app/metadata/resolver/container/resolver-wizard-step.component.ts b/ui/src/app/metadata/resolver/container/resolver-wizard-step.component.ts index 0021727b2..566291404 100644 --- a/ui/src/app/metadata/resolver/container/resolver-wizard-step.component.ts +++ b/ui/src/app/metadata/resolver/container/resolver-wizard-step.component.ts @@ -1,6 +1,6 @@ import { Component, OnDestroy } from '@angular/core'; import { Observable, Subject } from 'rxjs'; -import { withLatestFrom, map, distinctUntilChanged, skipWhile } from 'rxjs/operators'; +import { withLatestFrom, map, distinctUntilChanged, skipWhile, filter } from 'rxjs/operators'; import { Store } from '@ngrx/store'; import * as fromResolver from '../reducer'; @@ -60,7 +60,7 @@ export class ResolverWizardStepComponent implements OnDestroy { }, definition })), - skipWhile(({ model, definition }) => !definition || !model), + filter(({ model, definition }) => (definition && model)), map(({ model, definition }) => definition.formatter(model)) ); @@ -76,7 +76,7 @@ export class ResolverWizardStepComponent implements OnDestroy { this.valueChangeEmitted$.pipe( withLatestFrom(this.definition$), - skipWhile(([ changes, definition ]) => !definition || !changes), + filter(([ changes, definition ]) => (!!definition && !!changes)), map(([ changes, definition ]) => definition.parser(changes.value)), withLatestFrom(this.store.select(fromResolver.getSelectedDraft)), map(([changes, original]) => ({ ...original, ...changes })) diff --git a/ui/src/app/metadata/resolver/container/resolver-wizard.component.ts b/ui/src/app/metadata/resolver/container/resolver-wizard.component.ts index ba2221fda..d6cac6053 100644 --- a/ui/src/app/metadata/resolver/container/resolver-wizard.component.ts +++ b/ui/src/app/metadata/resolver/container/resolver-wizard.component.ts @@ -26,9 +26,8 @@ import { SetDefinition, SetIndex, SetDisabled, ClearWizard } from '../../../wiza import * as fromWizard from '../../../wizard/reducer'; import { LoadSchemaRequest } from '../../../wizard/action/wizard.action'; import { UnsavedEntityComponent } from '../../domain/component/unsaved-entity.dialog'; -import { ModalService } from '../../../core/service/modal.service'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { UpdateChanges, Clear } from '../action/entity.action'; +import { Clear } from '../action/entity.action'; @Component({ selector: 'resolver-wizard-page', @@ -172,7 +171,7 @@ export class ResolverWizardComponent implements OnDestroy, CanComponentDeactivat currentState: RouterStateSnapshot, nextState: RouterStateSnapshot ): Observable { - if (nextState.url.match('blank')) { return of(true); } + if (nextState.url.match('blank') && !!nextState.root.queryParams.id) { return of(true); } if (Object.keys(this.changes).length > 0) { let modal = this.modalService.open(UnsavedEntityComponent); modal.componentInstance.message = 'resolver'; diff --git a/ui/src/app/metadata/resolver/effect/draft-collection.effects.ts b/ui/src/app/metadata/resolver/effect/draft-collection.effects.ts index 024c923eb..f6e203381 100644 --- a/ui/src/app/metadata/resolver/effect/draft-collection.effects.ts +++ b/ui/src/app/metadata/resolver/effect/draft-collection.effects.ts @@ -120,7 +120,7 @@ export class DraftCollectionEffects { ) ), tap(() => { - this.store.dispatch(new ClearWizard()); + // this.store.dispatch(new ClearWizard()); this.store.dispatch(new Clear()); }) ); diff --git a/ui/src/app/wizard/component/wizard.component.html b/ui/src/app/wizard/component/wizard.component.html index 4f5a6e5c6..c3612bec2 100644 --- a/ui/src/app/wizard/component/wizard.component.html +++ b/ui/src/app/wizard/component/wizard.component.html @@ -1,4 +1,4 @@ -