-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate remaining announcements documentation, env sample, and docker…
… compose (#2406) * Migrate remaining announcements documentation Signed-off-by: Kurt King <[email protected]> * migrate env and docker-compose Signed-off-by: Kurt King <[email protected]> --------- Signed-off-by: Kurt King <[email protected]>
- Loading branch information
Showing
18 changed files
with
290 additions
and
17 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,45 @@ | ||
# [Backstage](https://backstage.io) | ||
# Announcements plugin for Backstage | ||
|
||
This is your newly scaffolded Backstage App, Good Luck! | ||
The Announcements plugin manages and displays announcements within Backstage. | ||
|
||
To start the app, run: | ||
## Features | ||
|
||
```sh | ||
yarn install | ||
yarn dev | ||
``` | ||
This plugin provides: | ||
|
||
To generate knip reports for this app, run: | ||
- a component to display the latest announcement as a banner, if there is one | ||
- a component to display the latest announcements, for example on a homepage | ||
- pages to list, view, create, edit and delete announcements | ||
- an admin portal to manage announcements | ||
- integration with the [`@backstage/plugin-search`](https://github.com/backstage/backstage/tree/master/plugins/search) plugin | ||
- integration with the [`@backstage/plugin-permission-backend`](https://github.com/backstage/backstage/tree/master/plugins/permission-backend) plugin | ||
- integration with the [`@backstage/plugin-events-backend`](https://github.com/backstage/backstage/tree/master/plugins/events-backend) plugin | ||
- integration with the [`@backstage/plugin-signals-backend`](https://github.com/backstage/backstage/tree/master/plugins/signals-backend) plugin | ||
|
||
```sh | ||
yarn backstage-repo-tools knip-reports | ||
``` | ||
You will find installation instructions in each plugin's readme file. | ||
|
||
## How does it look? | ||
|
||
### Latest announcement banner | ||
|
||
![Latest announcement banner](./images/announcement_banner.png) | ||
|
||
### Announcements card | ||
|
||
![Announcements card](./images/announcements_card.png) | ||
|
||
### Announcements page | ||
|
||
![Announcements page](./images/announcements_page.png) | ||
|
||
### Announcements search | ||
|
||
![Announcements search results](./images/announcements_search.png) | ||
|
||
### Admin Portal | ||
|
||
![Announcements admin portal](./images/announcements_admin_portal.png) | ||
|
||
## Previously maintained by | ||
|
||
- [procore-oss](https://github.com/procore-oss/backstage-plugin-announcements) | ||
- [K-Phoen](https://github.com/K-Phoen/backstage-plugin-announcements) |
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,8 @@ | ||
services: | ||
psql: | ||
image: postgres | ||
environment: | ||
POSTGRES_USER: ${POSTGRES_USER} | ||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | ||
ports: | ||
- ${POSTGRES_PORT}:5432 |
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,4 @@ | ||
POSTGRES_HOST=localhost | ||
POSTGRES_PORT=5432 | ||
POSTGRES_USER=postgres | ||
POSTGRES_PASSWORD=postgres |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions
6
workspaces/announcements/plugins/announcements-backend/README.md
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
36 changes: 36 additions & 0 deletions
36
workspaces/announcements/plugins/announcements-node/docs/events.md
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,36 @@ | ||
# Support for events | ||
|
||
The announcements plugin supports the Backstage Event system. | ||
|
||
```ts | ||
import { createBackend } from '@backstage/backend-defaults'; | ||
|
||
const backend = createBackend(); | ||
backend.add(import('@backstage/events-backend')); | ||
backend.add(import('@backstage-community/plugin-announcements-backend')); | ||
|
||
backend.start(); | ||
``` | ||
|
||
## Topic | ||
|
||
All events are published to the `announcements` topic. | ||
|
||
## Event actions | ||
|
||
The following event actions are supported | ||
|
||
### Announcements | ||
|
||
All announcement payloads include the entire contents of the announcement | ||
|
||
- 'create_announcement': Create a new announcement | ||
- 'update_announcement': Update an existing announcement | ||
- 'delete_announcement': Delete an existing announcement | ||
|
||
### Categories | ||
|
||
All category payloads include the category slug. | ||
|
||
- 'create_category': Create a new category | ||
- 'delete_category': Delete an existing category |
20 changes: 20 additions & 0 deletions
20
workspaces/announcements/plugins/announcements-node/docs/signals.md
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,20 @@ | ||
# Support for signals | ||
|
||
The announcements plugin supports delivering announcements to the frontend in near real-time using the [@backstage/plugins-signals](https://github.com/backstage/backstage/tree/master/plugins/signals) plugin. This is currently supported in the `<NewAnnouncementBanner />` [component](../../announcements/docs/latest-announcement-banner.md). | ||
|
||
## Installation | ||
|
||
> [!IMPORTANT] | ||
> This feature requires the `@backstage/plugin-events-backend` plugin to be installed and running. | ||
```ts | ||
import { createBackend } from '@backstage/backend-defaults'; | ||
|
||
const backend = createBackend(); | ||
backend.add(import('@backstage/events-backend')); | ||
... | ||
backend.add(import('@backstage/signals-backend')); | ||
backend.add(import('@backstage-community/plugin-announcements-backend')); | ||
|
||
backend.start(); | ||
``` |
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
21 changes: 21 additions & 0 deletions
21
workspaces/announcements/plugins/announcements/docs/announcement-timeline.md
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,21 @@ | ||
# Display announcements in a timeline | ||
|
||
Adding the `AnnouncementsTimeline` component to a page will display a raw timeline of the latest announcements. | ||
|
||
```ts | ||
import { AnnouncementsTimeline } from '@backstage-community/plugin-announcements'; | ||
|
||
export const TimelineExampleCard = () => { | ||
return ( | ||
<Content> | ||
<Grid container> | ||
<Grid item md={6}> | ||
<InfoCard> | ||
<AnnouncementsTimeline /> | ||
</InfoCard> | ||
</Grid> | ||
</Grid> | ||
</Content> | ||
); | ||
}; | ||
``` |
25 changes: 25 additions & 0 deletions
25
workspaces/announcements/plugins/announcements/docs/latest-announcement-banner.md
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,25 @@ | ||
# Display a banner for the latest announcement | ||
|
||
Adding the `NewAnnouncementBanner` component to a page will display a banner with the title and excerpt of the latest unseen announcement. This banner will update in near real-time when a new announcement is created if your Backstage instance is configured to support signals. | ||
|
||
**Note:** if there are no announcements or the latest announcement has already been seen by the user, nothing will be displayed. | ||
|
||
```ts | ||
import { NewAnnouncementBanner } from '@backstage-community/plugin-announcements'; | ||
|
||
export const HomePage = () => { | ||
return ( | ||
<Page themeId="home"> | ||
<Header title="NewAnnouncementBanner" /> | ||
|
||
<Content> | ||
<Grid container> | ||
<Grid item md={12}> | ||
<NewAnnouncementBanner /> | ||
</Grid> | ||
</Grid> | ||
</Content> | ||
</Page> | ||
); | ||
}; | ||
``` |
24 changes: 24 additions & 0 deletions
24
...spaces/announcements/plugins/announcements/docs/latest-announcements-on-page.md
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,24 @@ | ||
# Display latest announcements on a page | ||
|
||
Adding the `AnnouncementsCard` component to a page will display a Card with the latest announcements. | ||
Announcements yet unseen by the user will be prefixed by a specific icon. | ||
|
||
```ts | ||
import { AnnouncementsCard } from '@backstage-community/plugin-announcements'; | ||
|
||
export const HomePage = () => { | ||
return ( | ||
<Page themeId="home"> | ||
<Header title="AnnouncementsCard" /> | ||
|
||
<Content> | ||
<Grid container> | ||
<Grid item md={6}> | ||
<AnnouncementsCard max={3} /> | ||
</Grid> | ||
</Grid> | ||
</Content> | ||
</Page> | ||
); | ||
}; | ||
``` |
50 changes: 50 additions & 0 deletions
50
...spaces/announcements/plugins/search-backend-module-announcements/docs/search.md
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,50 @@ | ||
# Integration with `@backstage/plugin-search` | ||
|
||
## Installation | ||
|
||
Add the module to your backend app: | ||
|
||
```bash | ||
yarn add --cwd packages/backend @backstage-community/plugin-search-backend-module-announcements | ||
``` | ||
|
||
Update `packages/backend/src/index.ts` to import the announcements search module and register it with the backend: | ||
|
||
```ts | ||
// ... | ||
const backend = createBackend(); | ||
|
||
// ... | ||
|
||
backend.add(import('@backstage-community/plugin-announcements-backend')); | ||
backend.add( | ||
import('@backstage-community/plugin-search-backend-module-announcements'), | ||
); | ||
// ... | ||
``` | ||
|
||
## Adding search support to the frontend | ||
|
||
```tsx | ||
import { AnnouncementSearchResultListItem } from '@backstage-community/plugin-announcements'; | ||
import RecordVoiceOverIcon from '@material-ui/icons/RecordVoiceOver'; | ||
|
||
// ... | ||
<SearchType.Accordion | ||
name="Result Type" | ||
defaultValue="software-catalog" | ||
types={[ | ||
// ... | ||
{ | ||
value: 'announcements', | ||
name: 'Announcements', | ||
icon: <RecordVoiceOverIcon />, | ||
}, | ||
]} | ||
/> | ||
|
||
<SearchResult> | ||
// ... | ||
<AnnouncementSearchResultListItem /> | ||
</SearchResult> | ||
``` |