-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathHello.tsx
48 lines (44 loc) · 1.51 KB
/
Hello.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React from 'react';
import { css } from '@emotion/css';
import { useStyles2 } from '@grafana/ui';
import { GrafanaTheme2 } from '@grafana/data';
import { testIds } from '../components/testIds';
import { PluginPage } from '@grafana/runtime';
export function Hello() {
const s = useStyles2(getStyles);
return (
<PluginPage>
<div data-testid={testIds.hello.container}>
<h2>👋 Welcome!</h2>
<p>
This mock plugin uses <span className={s.orange}>Role-Based Access Control (RBAC)</span> to control access to
the following pages:
<ul className={s.list}>
<li>
📄 Research Documents: Accessible to individuals with the{' '}
<span className={s.orange}>myorg-appwithrbac-app.papers:read</span> permission, which is granted by
default to <span className={s.orange}>Viewers</span>.
</li>
<li>
🔒 Patents: Accessible to individuals with the{' '}
<span className={s.orange}>myorg-appwithrbac-app.patents:read</span> permission, which is granted by
default to <span className={s.orange}>Administrators</span> only.
</li>
</ul>
</p>
</div>
</PluginPage>
);
}
const getStyles = (theme: GrafanaTheme2) => ({
list: css({
boxSizing: 'border-box',
display: 'flex',
flexDirection: 'column',
listStyleType: 'none',
padding: theme.spacing(1),
}),
orange: css({
color: '#fbad37',
}),
});