Skip to content

Commit

Permalink
Changing the namespace agnostic type name
Browse files Browse the repository at this point in the history
  • Loading branch information
kobelb committed Sep 7, 2018
1 parent 71c2122 commit 485d983
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,12 @@
"value": {
"index": ".kibana",
"type": "doc",
"id": "chapo:8121a00-8efd-21e7-1cb3-34ab966434445",
"id": "globaltype:8121a00-8efd-21e7-1cb3-34ab966434445",
"source": {
"type": "chapo",
"type": "globaltype",
"updated_at": "2017-09-21T18:59:16.270Z",
"chapo": {
"name": "El Chapo"
"globaltype": {
"name": "My favorite global object"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
}
}
},
"chapo": {
"globaltype": {
"properties": {
"name": {
"type": "text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function (kibana) {
name: 'namespace_agnostic_type_plugin',
uiExports: {
savedObjectsSchema: {
chapo: {
globaltype: {
isNamespaceAgnostic: true
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"chapo": {
"globaltype": {
"properties": {
"name": {
"type": "text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants

export function createTestSuiteFactory(es, esArchiver, supertest) {
const spaceAwareType = 'visualization';
const notSpaceAwareType = 'chapo';
const notSpaceAwareType = 'globaltype';

const makeCreateTest = (describeFn) => (description, {
auth = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export function deleteTestSuiteFactory(esArchiver: any, supertest: SuperTest<any
} when deleting a non-space-aware doc`, async () =>
await supertest
.delete(
`${getUrlPrefix(spaceId)}/api/saved_objects/chapo/8121a00-8efd-21e7-1cb3-34ab966434445`
`${getUrlPrefix(
spaceId
)}/api/saved_objects/globaltype/8121a00-8efd-21e7-1cb3-34ab966434445`
)
.auth(auth.username, auth.password)
.expect(tests.notSpaceAware.statusCode)
Expand Down Expand Up @@ -114,7 +116,7 @@ export function deleteTestSuiteFactory(esArchiver: any, supertest: SuperTest<any
deleteTest,
expectEmpty,
expectRbacSpaceAwareForbidden: createExpectRbacForbidden('dashboard'),
expectRbacNotSpaceAwareForbidden: createExpectRbacForbidden('chapo'),
expectRbacNotSpaceAwareForbidden: createExpectRbacForbidden('globaltype'),
expectRbacInvalidIdForbidden: createExpectRbacForbidden('dashboard'),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ export function findTestSuiteFactory(esArchiver, supertest) {
},
{
id: `8121a00-8efd-21e7-1cb3-34ab966434445`,
type: 'chapo',
type: 'globaltype',
updated_at: '2017-09-21T18:59:16.270Z',
version: 1,
attributes: {
'name': 'El Chapo'
'name': 'My favorite global object'
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export function updateTestSuiteFactory(esArchiver: any, supertest: SuperTest<any
it(`should return ${tests.notSpaceAware.statusCode} for a non space-aware doc`, async () => {
await supertest
.put(
`${getUrlPrefix(spaceId)}/api/saved_objects/chapo/8121a00-8efd-21e7-1cb3-34ab966434445`
`${getUrlPrefix(
spaceId
)}/api/saved_objects/globaltype/8121a00-8efd-21e7-1cb3-34ab966434445`
)
.auth(auth.username, auth.password)
.send({
Expand Down Expand Up @@ -132,7 +134,7 @@ export function updateTestSuiteFactory(esArchiver: any, supertest: SuperTest<any

expect(resp.body).to.eql({
id: resp.body.id,
type: 'chapo',
type: 'globaltype',
updated_at: resp.body.updated_at,
version: 2,
attributes: {
Expand Down Expand Up @@ -161,7 +163,7 @@ export function updateTestSuiteFactory(esArchiver: any, supertest: SuperTest<any
createExpectLegacyForbidden,
expectDoesntExistRbacForbidden: createExpectRbacForbidden('visualization'),
expectNotSpaceAwareResults,
expectNotSpaceAwareRbacForbidden: createExpectRbacForbidden('chapo'),
expectNotSpaceAwareRbacForbidden: createExpectRbacForbidden('globaltype'),
expectNotFound,
expectSpaceAwareResults,
expectSpaceAwareRbacForbidden: createExpectRbacForbidden('visualization'),
Expand Down

0 comments on commit 485d983

Please sign in to comment.