BrowseView: Git Provisioned Read Only Folder Disable Empty State Create Dashboard Button (#111971)
Actionlint / Lint GitHub Actions files (push) Waiting to run Details
Backend Code Checks / Detect whether code changed (push) Waiting to run Details
Backend Code Checks / Validate Backend Configs (push) Blocked by required conditions Details
Backend Unit Tests / Detect whether code changed (push) Waiting to run Details
Backend Unit Tests / Grafana (${{ matrix.shard }}) (1/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana (${{ matrix.shard }}) (2/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana (${{ matrix.shard }}) (3/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana (${{ matrix.shard }}) (4/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana (${{ matrix.shard }}) (5/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana (${{ matrix.shard }}) (6/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana (${{ matrix.shard }}) (7/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana (${{ matrix.shard }}) (8/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana Enterprise (${{ matrix.shard }}) (1/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana Enterprise (${{ matrix.shard }}) (2/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana Enterprise (${{ matrix.shard }}) (3/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana Enterprise (${{ matrix.shard }}) (4/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana Enterprise (${{ matrix.shard }}) (5/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana Enterprise (${{ matrix.shard }}) (6/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana Enterprise (${{ matrix.shard }}) (7/8) (push) Blocked by required conditions Details
Backend Unit Tests / Grafana Enterprise (${{ matrix.shard }}) (8/8) (push) Blocked by required conditions Details
Backend Unit Tests / All backend unit tests complete (push) Blocked by required conditions Details
CodeQL checks / Detect whether code changed (push) Waiting to run Details
CodeQL checks / Analyze (actions) (push) Blocked by required conditions Details
CodeQL checks / Analyze (go) (push) Blocked by required conditions Details
CodeQL checks / Analyze (javascript) (push) Blocked by required conditions Details
Lint Frontend / Detect whether code changed (push) Waiting to run Details
Lint Frontend / Lint (push) Blocked by required conditions Details
Lint Frontend / Typecheck (push) Blocked by required conditions Details
Lint Frontend / Verify API clients (push) Waiting to run Details
Lint Frontend / Verify API clients (enterprise) (push) Waiting to run Details
golangci-lint / Detect whether code changed (push) Waiting to run Details
golangci-lint / go-fmt (push) Blocked by required conditions Details
golangci-lint / lint-go (push) Blocked by required conditions Details
Verify i18n / verify-i18n (push) Waiting to run Details
End-to-end tests / Detect whether code changed (push) Waiting to run Details
End-to-end tests / Build & Package Grafana (push) Blocked by required conditions Details
End-to-end tests / Build E2E test runner (push) Blocked by required conditions Details
End-to-end tests / push-docker-image (push) Blocked by required conditions Details
End-to-end tests / ${{ matrix.suite }} (--flags="--env dashboardScene=false", e2e/old-arch/dashboards-suite, dashboards-suite (old arch)) (push) Blocked by required conditions Details
End-to-end tests / ${{ matrix.suite }} (--flags="--env dashboardScene=false", e2e/old-arch/panels-suite, panels-suite (old arch)) (push) Blocked by required conditions Details
End-to-end tests / ${{ matrix.suite }} (--flags="--env dashboardScene=false", e2e/old-arch/smoke-tests-suite, smoke-tests-suite (old arch)) (push) Blocked by required conditions Details
End-to-end tests / ${{ matrix.suite }} (--flags="--env dashboardScene=false", e2e/old-arch/various-suite, various-suite (old arch)) (push) Blocked by required conditions Details
End-to-end tests / Verify Storybook (Playwright) (push) Blocked by required conditions Details
End-to-end tests / Playwright E2E tests (${{ matrix.shard }}/${{ matrix.shardTotal }}) (1, 8) (push) Blocked by required conditions Details
End-to-end tests / Playwright E2E tests (${{ matrix.shard }}/${{ matrix.shardTotal }}) (2, 8) (push) Blocked by required conditions Details
End-to-end tests / Playwright E2E tests (${{ matrix.shard }}/${{ matrix.shardTotal }}) (3, 8) (push) Blocked by required conditions Details
End-to-end tests / Playwright E2E tests (${{ matrix.shard }}/${{ matrix.shardTotal }}) (4, 8) (push) Blocked by required conditions Details
End-to-end tests / Playwright E2E tests (${{ matrix.shard }}/${{ matrix.shardTotal }}) (5, 8) (push) Blocked by required conditions Details
End-to-end tests / Playwright E2E tests (${{ matrix.shard }}/${{ matrix.shardTotal }}) (6, 8) (push) Blocked by required conditions Details
End-to-end tests / Playwright E2E tests (${{ matrix.shard }}/${{ matrix.shardTotal }}) (7, 8) (push) Blocked by required conditions Details
End-to-end tests / Playwright E2E tests (${{ matrix.shard }}/${{ matrix.shardTotal }}) (8, 8) (push) Blocked by required conditions Details
End-to-end tests / run-azure-monitor-e2e (push) Blocked by required conditions Details
End-to-end tests / All Playwright tests complete (push) Blocked by required conditions Details
End-to-end tests / A11y test (push) Blocked by required conditions Details
End-to-end tests / Publish metrics (push) Blocked by required conditions Details
End-to-end tests / All E2E tests complete (push) Blocked by required conditions Details
Frontend tests / Detect whether code changed (push) Waiting to run Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (1, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (10, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (11, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (12, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (13, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (14, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (15, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (16, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (2, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (3, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (4, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (5, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (6, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (7, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (8, 16) (push) Blocked by required conditions Details
Frontend tests / Unit tests (${{ matrix.shard }} / ${{ matrix.total }}) (9, 16) (push) Blocked by required conditions Details
Frontend tests / Decoupled plugin tests (push) Blocked by required conditions Details
Frontend tests / Packages unit tests (push) Blocked by required conditions Details
Frontend tests / All frontend unit tests complete (push) Blocked by required conditions Details
Integration Tests / Detect whether code changed (push) Waiting to run Details
Integration Tests / Sqlite (${{ matrix.shard }}) (1/4) (push) Blocked by required conditions Details
Integration Tests / Sqlite (${{ matrix.shard }}) (2/4) (push) Blocked by required conditions Details
Integration Tests / Sqlite (${{ matrix.shard }}) (3/4) (push) Blocked by required conditions Details
Integration Tests / Sqlite (${{ matrix.shard }}) (4/4) (push) Blocked by required conditions Details
Integration Tests / Sqlite Without CGo (${{ matrix.shard }}) (1/4) (push) Blocked by required conditions Details
Integration Tests / Sqlite Without CGo (${{ matrix.shard }}) (2/4) (push) Blocked by required conditions Details
Integration Tests / Sqlite Without CGo (${{ matrix.shard }}) (3/4) (push) Blocked by required conditions Details
Integration Tests / Sqlite Without CGo (${{ matrix.shard }}) (4/4) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (1/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (10/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (11/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (12/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (13/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (14/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (15/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (16/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (2/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (3/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (4/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (5/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (6/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (7/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (8/16) (push) Blocked by required conditions Details
Integration Tests / MySQL (${{ matrix.shard }}) (9/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (1/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (10/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (11/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (12/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (13/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (14/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (15/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (16/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (2/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (3/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (4/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (5/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (6/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (7/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (8/16) (push) Blocked by required conditions Details
Integration Tests / Postgres (${{ matrix.shard }}) (9/16) (push) Blocked by required conditions Details
Integration Tests / All backend integration tests complete (push) Blocked by required conditions Details
Reject GitHub secrets / reject-gh-secrets (push) Waiting to run Details
Run dashboard schema v2 e2e / dashboard-schema-v2-e2e (push) Waiting to run Details
Shellcheck / Shellcheck scripts (push) Waiting to run Details
Run Storybook a11y tests / Detect whether code changed (push) Waiting to run Details
Run Storybook a11y tests / Run Storybook a11y tests (push) Blocked by required conditions Details
Swagger generated code / Detect whether code changed (push) Waiting to run Details
Swagger generated code / Verify committed API specs match (push) Blocked by required conditions Details
Dispatch sync to mirror / dispatch-job (push) Waiting to run Details

BrowseView: Disable empty state create dashboard button when repo is read only
This commit is contained in:
Yunwen Zheng 2025-10-02 22:51:45 -04:00 committed by GitHub
parent 2f321982b2
commit 454cd0f385
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View File

@ -206,7 +206,13 @@ const BrowseDashboardsPage = memo(({ queryParams }: { queryParams: Record<string
searchStateManager={stateManager}
/>
) : (
<BrowseView permissions={permissions} width={width} height={height} folderUID={folderUID} />
<BrowseView
permissions={permissions}
width={width}
height={height}
folderUID={folderUID}
isReadOnlyRepo={isReadOnlyRepo}
/>
)
}
</AutoSizer>

View File

@ -33,9 +33,10 @@ interface BrowseViewProps {
width: number;
folderUID: string | undefined;
permissions: BrowseDashboardsPermissions;
isReadOnlyRepo?: boolean;
}
export function BrowseView({ folderUID, width, height, permissions }: BrowseViewProps) {
export function BrowseView({ folderUID, width, height, permissions, isReadOnlyRepo }: BrowseViewProps) {
const status = useBrowseLoadingStatus(folderUID);
const dispatch = useDispatch();
const flatTree = useFlatTreeState(folderUID);
@ -163,6 +164,7 @@ export function BrowseView({ folderUID, width, height, permissions }: BrowseView
href={folderUID ? `dashboard/new?folderUid=${folderUID}` : 'dashboard/new'}
icon="plus"
size="lg"
disabled={isReadOnlyRepo}
>
<Trans i18nKey="browse-dashboards.empty-state.button-title">Create dashboard</Trans>
</LinkButton>
@ -173,7 +175,7 @@ export function BrowseView({ folderUID, width, height, permissions }: BrowseView
: t('browse-dashboards.empty-state.title', "You haven't created any dashboards yet")
}
>
{folderUID && (
{folderUID && !isReadOnlyRepo && (
<Trans i18nKey="browse-dashboards.empty-state.pro-tip">
Add/move dashboards to your folder at{' '}
<TextLink external={false} href="/dashboards">