From fc6345467d59d24a4c867e1452176416b7df2804 Mon Sep 17 00:00:00 2001 From: Jose Felix Date: Mon, 8 Jan 2024 15:41:41 -0400 Subject: [PATCH] feat: Add Announcement Banner Schema and JSON (#7) * feat: add announcement banner schema and json * feat: set is chain halted as true * feat: add start and end date to top announcement banner * feat: add 'isChainHalted' to top announcement banner * feat: remove "isChainHalted" property from "swap-rotating-banner" schema and add "isChainHalted" property to "top-announcement-banner" schema * Update top announcement banner settings * Remove unnecessary code in top-announcement-banner.json --- cms/top-announcement-banner.json | 13 ++++ schemas/top-announcement-banner.schema.json | 67 +++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 cms/top-announcement-banner.json create mode 100644 schemas/top-announcement-banner.schema.json diff --git a/cms/top-announcement-banner.json b/cms/top-announcement-banner.json new file mode 100644 index 0000000..973e8cd --- /dev/null +++ b/cms/top-announcement-banner.json @@ -0,0 +1,13 @@ +{ + "$schema": "../schemas/top-announcement-banner.schema.json", + "isChainHalted": false, + "banner": { + "enTextOrLocalizationPath": "This is a test of the top announcement banner.", + "link": { + "enTextOrLocalizationKey": "Click here to learn more.", + "isExternal": true, + "url": "https://www.google.com" + }, + "localStorageKey": "top-announcement-banner-test" + } +} diff --git a/schemas/top-announcement-banner.schema.json b/schemas/top-announcement-banner.schema.json new file mode 100644 index 0000000..1c5c702 --- /dev/null +++ b/schemas/top-announcement-banner.schema.json @@ -0,0 +1,67 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "isChainHalted": { + "type": "boolean" + }, + "banner": { + "type": ["object", "null"], + "properties": { + "localStorageKey": { + "type": "string" + }, + "pageRoute": { + "type": "string", + "$comment": "Leave undefined to include all pages." + }, + "enTextOrLocalizationPath": { + "type": "string", + "$comment": "English text or key into localization jsons." + }, + "link": { + "type": "object", + "properties": { + "enTextOrLocalizationKey": { + "type": "string", + "$comment": "English text or key into localization jsons." + }, + "url": { + "type": "string" + }, + "isExternal": { + "type": "boolean", + "$comment": "External to Osmosis. Show disclaimer before linking out of app." + } + }, + "$comment": "Link to external page.", + "required": ["url"] + }, + "isWarning": { + "type": "boolean", + "$comment": "Use orange styling, persist on page reloads." + }, + "persistent": { + "type": "boolean", + "$comment": "Will always show on page reload. Use with caution. (Warnings persist)" + }, + "bg": { + "type": "string", + "$comment": "Custom Background color." + }, + "startDate": { + "type": "string", + "format": "date-time", + "$comment": "ISO 8601 date-time string. Banner will not show until this date." + }, + "endDate": { + "type": "string", + "format": "date-time", + "$comment": "ISO 8601 date-time string. Banner will not show after this date." + } + }, + "required": ["enTextOrLocalizationPath"] + } + }, + "required": ["banner", "isChainHalted"] +}