-
Notifications
You must be signed in to change notification settings - Fork 398
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
CB-5123. Added backend part, added new parameter licenseStatus to ser… #2831
CB-5123. Added backend part, added new parameter licenseStatus to ser… #2831
Conversation
…us-insufficient-amount-users
/** | ||
* PasswordPolicyResource should be loaded before calling this method | ||
*/ | ||
validatePassword(password: string): ValidationResult { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should add a check here. There is a chance a person would not have read the comment and used this function without the resource had been loaded before
/** | |
* PasswordPolicyResource should be loaded before calling this method | |
*/ | |
validatePassword(password: string): ValidationResult { | |
validatePassword(password: string): ValidationResult { | |
if (!this.passwordPolicyResource.isLoaded()) { | |
throw new Error('Password policy is not loaded yet'); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be outdated but loaded, so we need to know that we need to manage it at place
extraProps: observable.ref, | ||
autoClose: observable.ref, | ||
type: observable.ref, | ||
timestamp: observable.ref, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should close
to be included here? seems like potential bug if mobx does not know that some notification was closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't want users to change this field
this.update = { | ||
hideFolders: false, | ||
hideSchemas: false, | ||
hideVirtualModel: false, | ||
mergeEntities: false, | ||
showOnlyEntities: false, | ||
showSystemObjects: false, | ||
showUtilityObjects: false, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to the INITIAL_UPDATE_STATE
const please
if ( | ||
this.serverConfigResource.configurationMode || | ||
(this.serverLicenseStatusResource?.licenseRequired && !this.serverLicenseStatusResource.licenseValid) | ||
) { | ||
return true; | ||
} | ||
|
||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be simplified
if ( | |
this.serverConfigResource.configurationMode || | |
(this.serverLicenseStatusResource?.licenseRequired && !this.serverLicenseStatusResource.licenseValid) | |
) { | |
return true; | |
} | |
return false; | |
return this.serverConfigResource.configurationMode || | |
(this.serverLicenseStatusResource?.licenseRequired && !this.serverLicenseStatusResource.licenseValid) |
/** | ||
* Quotas should be manually loaded from ServerResourceQuotasResource before using this method | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as for PasswordPolicyResource
comment a bit above
@@ -85,6 +86,7 @@ export class ServerConfigurationAuthenticationBootstrap extends Bootstrap { | |||
return validation.invalidate(); | |||
} | |||
|
|||
await this.passwordPolicyResource.load(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be a better place for this in the load(): void {}
method of this class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we need to keep in mind that resources can be invalidated at any time and load
executed only once on app start, we also don't need this resource to be loaded in app starting process because we only need this data in certain forms
private readonly quotasService: QuotasService, | ||
private readonly cache: ResultSetCacheAction, | ||
) { | ||
super(source); | ||
|
||
function loadQuotas() { | ||
setTimeout(() => serverResourceQuotasResource.load(), 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to run it as soon as possible?
you can also use by the way
queueMicrotask(() => serverResourceQuotasResource.load());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to run it as soon as possible, but we want to prevent onDataOutdated executor from blocking
this.subscriptionDispose = () => { | ||
this.serverResourceQuotasResource.onDataOutdated.removeHandler(loadQuotas); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we add removeHandler
only after dispose
executed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean by that?
} | ||
} | ||
|
||
if (this.isChanged() && !skipConfigUpdate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we can keep this.isChanged()
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need it (it's already in performUpdate arg)
await this.graphQLService.sdk.setDefaultNavigatorSettings({ settings: this.update }); | ||
|
||
this.setData(await this.loader()); | ||
|
||
this.onDataOutdated.execute(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you missed this check here
if (this.isNavigatorSettingsChanged()) { |
await this.graphQLService.sdk.setDefaultNavigatorSettings({ settings: this.update }); | |
this.setData(await this.loader()); | |
this.onDataOutdated.execute(); | |
if (!isChanged()) { | |
return; | |
} | |
await this.graphQLService.sdk.setDefaultNavigatorSettings({ settings: this.update }); | |
this.setData(await this.loader()); | |
this.onDataOutdated.execute(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I'm not cuz performUpdate will call this check again before running the callback
…ent-amount-users' into CB-5123-license-status-insufficient-amount-users
…ver config gql