-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Spaces] - Introducing Space Identifier, Forgetting URL Context #21295
Conversation
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
@@ -39,7 +39,7 @@ export class SpacesSavedObjectsClient { | |||
*/ | |||
async create(type, attributes = {}, options = {}) { | |||
|
|||
const spaceId = await this._getSpaceId(); | |||
const spaceId = this._spaceId; |
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.
This change is 🥇
@@ -244,34 +244,6 @@ export class SpacesSavedObjectsClient { | |||
return await this._client.update(type, id, attributes, updateOptions); | |||
} | |||
|
|||
async _getSpaceId() { |
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.
Bye!!!!
let pathToCheck = requestBasePath; | ||
|
||
if (serverBasePath && serverBasePath !== '/' && requestBasePath.startsWith(serverBasePath)) { | ||
pathToCheck = requestBasePath.substr(serverBasePath.length); | ||
} | ||
// Look for `/s/space-url-context` in the base path | ||
const matchResult = pathToCheck.match(/^\/s\/([a-z0-9\-]+)/); | ||
const matchResult = pathToCheck.match(/^\/s\/([a-z0-9_\-]+)/); |
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.
Did we mean to add an _
here? I'm not seeing an _
being allowed in the spaceSchema id
.
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.
ah yep, that was a partial change that I didn't finish. thanks!
}); | ||
}); | ||
|
||
test('PUT /space should update an exisitng space with the provided ID', async () => { |
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.
nit: existing
is misspelled.
@@ -173,9 +262,11 @@ describe('Spaces API', () => { | |||
}); | |||
|
|||
test('POST space/{id}/select should respond with the new space location when a baseUrl is provided', async () => { |
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.
nit: the name of this test (which this PR didn't change) kind of throws me off, because the baseUrl
is being pulled from server.config()
but the test description made me think it was being grabbed from the payload itself.
💔 Build Failed |
From the end-user perspective, this is a simple rebranding of the URL Context.
Internally, the space identifier is now used to represent both the url path of the space, as well as that space's document id in the kibana index.
This provides the following benefits:
As an added bonus, the Space Description is now optional 🎉