Skip to content
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

fix: ability to create 404 page via Registry UI #289

Merged
merged 3 commits into from
May 5, 2021

Conversation

nightnei
Copy link
Contributor

No description provided.

@nightnei nightnei requested a review from StyleT April 29, 2021 10:13
routeId2 && await request.delete(example.url + routeId2);
}
});
// it('should not create record with the same orderPos', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove or uncomment

Copy link
Contributor Author

@nightnei nightnei Apr 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was commented temporary, I have uncommented

return knex.schema.alterTable('routes', table => {
table.integer('orderPos', 10).nullable().alter(); // alter table don't affect only uniq constraint, so you don't need and it's disallowed to set unique('routes_orderpos_unique') here
table.string('route', 255).nullable().alter();
table.boolean('next').nullable().alter();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you make it null? Just fallback to false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

if (isMySQL(knex)) {
return knex.schema.alterTable('routes', table => {
table.integer('orderPos', 10).nullable().alter(); // alter table don't affect only uniq constraint, so you don't need and it's disallowed to set unique('routes_orderpos_unique') here
table.string('route', 255).nullable().alter();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed opts:

  • rm specialRole & put special ID to route
  • keep for now as is

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

special:404

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -45,7 +45,7 @@ const commonAppRoute = {
specialRole: Joi.string().valid('404'),
orderPos: Joi.number(),
route: Joi.string().trim().max(255),
next: Joi.bool().default(false),
next: Joi.bool(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is a breaking one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

@nightnei nightnei force-pushed the registryUi404Creating branch 5 times, most recently from ea507a2 to cd75ab1 Compare April 30, 2021 10:45
@@ -24,7 +24,7 @@ module.exports = (configsInjector, newrelic, registryService) => async (
throw new Error('Can\'t match route base template to config map');
}

const routeName = currRoute.route.replace(/^\/(.+)/, '$1');
const routeName = currRoute.route?.replace(/^\/(.+)/, '$1');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make sure that we always name NR transaction

@nightnei nightnei merged commit 2c98a06 into master May 5, 2021
@nightnei nightnei deleted the registryUi404Creating branch May 5, 2021 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants