You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user is on the topic details view / schema, we show a "button" "Request new version/schema". It's a link to the schema request form and it will add the environment to a query:
(please note that the environment for the topic is TST while the related schema environment is TST_SCH -> this is intentionally and will be fixed at some point, we're using the schema-env for the forms at the moment, bc the endpoints still expect them, but will switch to using one env for all)
This env (TST_SCH) is passed to be used as prefilled readonly value in the request-schema form. To make sure we're using a correct environment, we're calling endpoint /getEnvsForSchemaRequests and see if the id or name of the environment is a valid one. If not, we'll redirect the user back to where they come from:
queryFn: () => getEnvironmentsForSchemaRequest(),
onSuccess: (environments) => {
if (presetEnvironment) {
const validEnv = environments.find(
(env) =>
presetEnvironment === env.id || presetEnvironment === env.name
);
// Allows to pass environment name as well as environment id as search param
if (validEnv && isNaN(Number(presetEnvironment))) {
form.setValue("environment", validEnv.id);
return;
}
if (validEnv === undefined) {
navigate(-1);
}
}
},
This is correct - we want to make sure that a user can only fill out and sent the form with a valid env from the URL and not for example use an old link with an env that is no longer valid (or try to just change the value in the url).
BUT we've enabled superadmin user in Klaw to add a lot of settings (which is good 😅 ),. One of those is that superadmin can prevent user from being to able to make a schema request against an environment and instead enforce them to create a schema at the lowest env and work their way up (aka promote the schema).
We want to make that more clear in the UI:
the endpoint /getSchemaOfTopic will add a property to SchemaOverview to determine if a user can actually request a schema on a higher env or if this schema is "promoteable only" (naming will backend do better than me :D)
if this is implemented, the UI will use this property to decide wether to show the button OR a short information about why the button is missing (input from @harshini-rangaswamy is needed for a good text and Mustafa for a useful layout)
The text was updated successfully, but these errors were encountered:
Description
When a user is on the topic details view / schema, we show a "button" "Request new version/schema". It's a link to the schema request form and it will add the environment to a query:
(please note that the environment for the topic is
TST
while the related schema environment isTST_SCH
-> this is intentionally and will be fixed at some point, we're using the schema-env for the forms at the moment, bc the endpoints still expect them, but will switch to using one env for all)This env (
TST_SCH
) is passed to be used as prefilled readonly value in the request-schema form. To make sure we're using a correct environment, we're calling endpoint/getEnvsForSchemaRequests
and see if the id or name of the environment is a valid one. If not, we'll redirect the user back to where they come from:This is correct - we want to make sure that a user can only fill out and sent the form with a valid env from the URL and not for example use an old link with an env that is no longer valid (or try to just change the value in the url).
BUT we've enabled superadmin user in Klaw to add a lot of settings (which is good 😅 ),. One of those is that superadmin can prevent user from being to able to make a schema request against an environment and instead enforce them to create a schema at the lowest env and work their way up (aka promote the schema).
We want to make that more clear in the UI:
/getSchemaOfTopic
will add a property toSchemaOverview
to determine if a user can actually request a schema on a higher env or if this schema is "promoteable only" (naming will backend do better than me :D)The text was updated successfully, but these errors were encountered: