-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
UI: [VAULT-21527] Mirage setup #24000
Merged
kiannaquach
merged 5 commits into
ui/VAULT-19096/customizable-banners
from
ui/VAULT-21527/setup-mirage
Nov 14, 2023
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
321e09a
Initial get setup
kiannaquach 7a781d7
Add more endpoints w/ mock data
kiannaquach a4d92b2
Merge branch 'ui/VAULT-19096/customizable-banners' into ui/VAULT-2152…
kiannaquach dfe40e2
Add post
kiannaquach 6ccc297
Add store to dependcies array
kiannaquach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
export default function (server) { | ||
server.get('/sys/config/ui/custom-messages', (schema, request) => { | ||
if (request.queryParams.authenticated === 'true') { | ||
return { | ||
data: { | ||
'key-info': { | ||
'01234567-89ab-cdef-0123-456789abcdef': { | ||
title: 'Authenticated custom message title', | ||
type: 'modal', | ||
authenticated: true, | ||
start_time: '2023-10-15T02:36:43.986212308Z', | ||
end_time: '2024-10-15T02:36:43.986212308Z', | ||
active: true, | ||
}, | ||
'76543210-89ab-cdef-0123-456789abcdef': { | ||
title: 'Authenticated custom message title two', | ||
type: 'banner', | ||
authenticated: true, | ||
start_time: '2021-10-15T02:36:43.986212308Z', | ||
end_time: '2021-11-15T02:36:43.986212308Z', | ||
active: false, | ||
}, | ||
}, | ||
keys: ['01234567-89ab-cdef-0123-456789abcdef', '76543210-89ab-cdef-0123-456789abcdef'], | ||
}, | ||
}; | ||
} | ||
|
||
return { | ||
data: { | ||
'key-info': { | ||
'8d6ba39-5c23-50af-3d79-76c26a2845f49': { | ||
title: 'Unauthenticated custom message title', | ||
type: 'modal', | ||
authenticated: false, | ||
start_time: '2023-10-15T02:36:43.986212308Z', | ||
end_time: '2024-10-15T02:36:43.986212308Z', | ||
active: true, | ||
}, | ||
'281e580-da16-89c5-4666-16480e4b7c11d': { | ||
title: 'Unauthenticated custom message title two', | ||
type: 'banner', | ||
authenticated: false, | ||
start_time: '2021-10-15T02:36:43.986212308Z', | ||
end_time: '2021-11-15T02:36:43.986212308Z', | ||
active: false, | ||
}, | ||
}, | ||
keys: ['8d6ba39-5c23-50af-3d79-76c26a2845f49', '281e580-da16-89c5-4666-16480e4b7c11d'], | ||
}, | ||
}; | ||
}); | ||
|
||
server.post('/sys/config/ui/custom-messages', () => { | ||
return { | ||
id: '01234567-89ab-cdef-0123-456789abcdef', | ||
data: { | ||
active: true, | ||
start_time: '2023-10-15T02:36:43.986212308Z', | ||
end_time: '2024-10-15T02:36:43.986212308Z', | ||
type: 'modal', | ||
authenticated: false, | ||
}, | ||
}; | ||
}); | ||
|
||
server.get('/sys/internal/ui/unauthenticated-messages', () => { | ||
return { | ||
data: { | ||
'key-info': { | ||
'01234567-89ab-cdef-0123-456789abcdef': { | ||
title: 'Unauthenticated Title One', | ||
message: | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nulla augue, placerat quis risus blandit, molestie imperdiet massa. Sed blandit rutrum odio quis varius. Fusce purus orci, maximus ac libero.', | ||
type: 'modal', | ||
authenticated: false, | ||
start_time: '2023-10-15T02:36:43.986212308Z', | ||
end_time: '2024-10-15T02:36:43.986212308Z', | ||
options: {}, | ||
}, | ||
'76543210-89ab-cdef-0123-456789abcdef': { | ||
title: 'Unauthenticated Title Two', | ||
message: | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nulla augue, placerat quis risus blandit, molestie imperdiet massa. Sed blandit rutrum odio quis varius. Fusce purus orci, maximus ac libero.', | ||
type: 'banner', | ||
authenticated: false, | ||
start_time: '2021-10-15T02:36:43.986212308Z', | ||
end_time: '2031-10-15T02:36:43.986212308Z', | ||
options: {}, | ||
}, | ||
}, | ||
keys: ['01234567-89ab-cdef-0123-456789abcdef', '76543210-89ab-cdef-0123-456789abcdef'], | ||
}, | ||
}; | ||
}); | ||
|
||
server.get('/sys/internal/ui/authenticated-messages', () => { | ||
return { | ||
data: { | ||
'key-info': { | ||
'6543210-89ab-cdef-0123-456780abcieh': { | ||
title: 'Authenticated Title One', | ||
message: | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nulla augue, placerat quis risus blandit, molestie imperdiet massa. Sed blandit rutrum odio quis varius. Fusce purus orci, maximus ac libero.', | ||
type: 'modal', | ||
authenticated: true, | ||
start_time: '2023-10-15T02:36:43.986212308Z', | ||
end_time: '2024-10-15T02:36:43.986212308Z', | ||
options: {}, | ||
}, | ||
'00123858-89ab-cdef-0123-789037ejhdgt': { | ||
title: 'Authenticated Title One', | ||
message: | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nulla augue, placerat quis risus blandit, molestie imperdiet massa. Sed blandit rutrum odio quis varius. Fusce purus orci, maximus ac libero.', | ||
type: 'banner', | ||
authenticated: true, | ||
start_time: '2021-10-15T02:36:43.986212308Z', | ||
end_time: '2031-10-15T02:36:43.986212308Z', | ||
options: {}, | ||
}, | ||
}, | ||
keys: ['6543210-89ab-cdef-0123-456780abcieh', '00123858-89ab-cdef-0123-789037ejhdgt'], | ||
}, | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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've tested this by trying to fetch from this endpoint in the custom-message route and noticed that queryParams properties get returned as strings.