Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
114ca07
[BUGFIX] fix edit variable panel's custom all value text field to han…
zhuje Feb 18, 2026
15f90d0
Release v0.53.0-rc.3 (#65)
Nexucis Feb 20, 2026
fac8185
[BUGFIX] fix edit variable panel's custom all value text field to han…
zhuje Feb 22, 2026
889d936
[BUGFIX] fix edit variable panel's custom all value text field
zhuje Feb 23, 2026
552de2a
Fix (#62)
OrReuben Feb 24, 2026
c3da52b
[BUGFIX] fix edit variable panel's custom all value text field with S…
zhuje Feb 24, 2026
9dc75e1
Release v0.53.0 (#68)
Nexucis Feb 25, 2026
86a2f4a
[BUGFIX] fix edit variable panel's custom all value text field with S…
zhuje Feb 26, 2026
47b5808
Merge pull request #64 from perses/ou1159-custom-all-varaible
zhuje Feb 26, 2026
5a5beb5
Bump github.com/perses/perses from 0.53.0-rc.0.0.20260113112038-1e65a…
dependabot[bot] Mar 2, 2026
8a8fd8b
Bump the actions group with 2 updates (#71)
dependabot[bot] Mar 2, 2026
6dbdfcc
[FEATURE]: add csv export util under plugin sys to be avilable to all…
shahrokni Mar 2, 2026
68aad63
Merge pull request #74 from perses/feat/move_csv_export_to_plugin_sys
shahrokni Mar 2, 2026
ac94be6
[IGNORE] fix vulnerable dependencies (#73)
jgbernalp Mar 3, 2026
271ffba
[BUGFIX] panel: enforce bg color to panel actions (move + menu) (#75)
Gladorme Mar 3, 2026
4222532
[BUGFIX] Threshold color picker goes crazy when holding the mouse cli…
adrianSepiol Mar 3, 2026
4d322c2
Merge pull request #77 from adrianSepiol/fix-threshold-editor
ibakshay Mar 3, 2026
0425188
[BUGFIX] dashboards: update preview when a query is deleted (#79)
Gladorme Mar 4, 2026
8f4c08b
[BUGFIX] sync timezone using date fns tz
shahrokni Mar 9, 2026
f603951
Merge pull request #83 from perses/fix/sync-datae-fns-tz
shahrokni Mar 9, 2026
9e46b40
[IGNORE] update serialize-javascript dependency (#84)
jgbernalp Mar 9, 2026
6bb6e09
Prepare release v0.53.1 (#87)
shahrokni Mar 10, 2026
e2ffac0
[IGNORE] add unit tests for the dashboard timezone (#86)
shahrokni Mar 10, 2026
3b5b11a
[ENHANCEMENT] theme: add support for color-scheme (#78)
Gladorme Mar 11, 2026
f8cd4b7
[IGNORE]: fix a wrong rebase (#92)
shahrokni Mar 18, 2026
62f0c58
[ENHANCEMENT]: Support Dashboards links for internal and external nav…
prakhar29jain Mar 27, 2026
b10e7df
[change] use perses/spec in shared component (#91)
Nexucis Mar 30, 2026
1ba2d5a
feat(theme): update typography from Lato to Inter for better readabil…
nicolastakashi Apr 8, 2026
83c9cd7
Merge pull request #98 from perses/chore/font-switch-proposal
nicolastakashi Apr 8, 2026
b09305d
Fix Grafana dateTimeAsIso unit migration
abelyakin Apr 10, 2026
3e04c05
feat(keyboard-shortcut): initial commit
ibakshay Apr 11, 2026
903ff0b
feat(keyboard-shortcut): make it configurable via flag
ibakshay Apr 11, 2026
9e068ec
Merge pull request #102 from abelyakin/improve-unit-migration
AntoineThebaud Apr 11, 2026
5291c17
feat(keyboard-shotcuts): remove user configurable keyboard shortcut
ibakshay Apr 13, 2026
d43ece6
Merge branch 'main' into ibakshay/keyboard-shortcut
ibakshay Apr 13, 2026
1cee6df
feat(keyboard-shortcut): simplify the implementation
ibakshay Apr 13, 2026
eed276b
feat(keyboard-shortcut): add zoom in and zoom out
ibakshay Apr 14, 2026
2dad8ca
[BREAKINGCHANE] remove dashbaord resource dependecy (#97)
shahrokni Apr 14, 2026
5698f23
[BUGFIX] dashboards: keep scrollbar active when using OverflowMenu (#93)
Gladorme Apr 14, 2026
6cea1b5
[BUGFIX] Dashboard: remove unmountOnExit flag of the row collapse (#80)
shahrokni Apr 14, 2026
7d7d1b7
feat(keyboard-shortcuts): simplify the code
ibakshay Apr 14, 2026
a9e16d7
adjust test
ibakshay Apr 14, 2026
195637a
[IGNORE]: remove comments that are not required
ibakshay Apr 14, 2026
cc085ee
[FEATURE]: add snackbar when a dashboard gets refreshed
ibakshay Apr 15, 2026
607b893
feat(keyboard-shortcuts): small improvements
ibakshay Apr 15, 2026
5cb6289
Merge branch 'main' into ibakshay/keyboard-shortcut
ibakshay Apr 15, 2026
c49d82a
feat(keyboard-shortcut): fix lint
ibakshay Apr 15, 2026
24c4271
add stop propogation
ibakshay Apr 17, 2026
a668593
remove shared keybindings for plugins to use. will be done in a follo…
ibakshay Apr 17, 2026
7680465
fix review comments
ibakshay Apr 17, 2026
6af884e
make panelKey inline.
ibakshay Apr 17, 2026
c33d955
rename interface
ibakshay Apr 17, 2026
1bb386c
add a comment for setFocusedPanel
ibakshay Apr 17, 2026
0f0c088
add the new import
ibakshay Apr 17, 2026
bce3594
Merge pull request #105 from perses/ibakshay/keyboard-shortcut
ibakshay Apr 20, 2026
ef83df6
[IGNORE] update plugin runtime requirement for perses related depende…
jgbernalp Apr 20, 2026
cbef638
[IGNORE] fix vulnerable ui dependencies (#107)
jgbernalp Apr 20, 2026
d17dad3
Add optional projectName prop to ViewExplore (#104)
rickardsjp Apr 20, 2026
1705c5b
Add createVolumeQuery to LogQueryPlugin and extract shared volume int…
rickardsjp Apr 20, 2026
a4de6a6
Prepare release v0.54.0-beta.0 (#111)
shahrokni Apr 21, 2026
28802ec
[IGNORE] remove some core dependencies (#113)
shahrokni Apr 21, 2026
022cc25
[IGNORE] add missed licnese header of defaults file (#114)
shahrokni Apr 21, 2026
a9cd755
[ENHANCEMENT] Add support for sub-rows, fuzzy filtering and column fi…
adrianSepiol Apr 22, 2026
d8f5606
[IGNORE] remove some of the core dependencies (#115)
shahrokni Apr 22, 2026
0687f36
[FEATURE] add request headers and query params interpolation (#118)
jgbernalp Apr 24, 2026
33e931f
[IGNORE] remove some core dependecies (#116)
shahrokni Apr 24, 2026
5072f9e
[ENHANCEMENT]: add keyboard utility (#117)
ibakshay Apr 24, 2026
5d0a50b
Prepare release v0.54.0-beta.1 (#121)
shahrokni Apr 28, 2026
89f0a38
[IGNORE] remove core dependencies (#123)
shahrokni Apr 28, 2026
b02f976
[FEATURE] Table: add column resizing (#119)
adrianSepiol Apr 29, 2026
bbec01e
[BUGFIX] Variable Preview doesn't work when creating multiple variabl…
adrianSepiol Apr 30, 2026
a6e2513
[IGNORE] remove unused dependencies (#129)
jgbernalp May 6, 2026
20aa959
[ENHANCEMENT] expand rows on search. Add expand/collapse all. (#132)
adrianSepiol May 8, 2026
7da5e3f
[ENHANCEMENT] make fuzzy search match threshold configurable in table…
adrianSepiol May 8, 2026
25edc6b
[BREAKINGCHANGE] fetch plugin based on version (#128)
shahrokni May 15, 2026
75525ac
Bump perses/github-actions from 0.11.0 to 0.12.0 in the actions group…
dependabot[bot] May 18, 2026
dc28e65
[FEATURE] add alert and silence queries to data queries (#127)
jgbernalp May 22, 2026
44e8b68
[ENHANCEMENT] Display GMT offset next to time range selector (#106)
DeeBi9 May 22, 2026
8a78bde
[FEATURE] enable column resizing for the legend table (#125)
adrianSepiol May 22, 2026
8b35d8b
[ENHANCEMENT] set font-weight of bold to default value (#140)
andreasgerstmayr May 26, 2026
335619a
[ENHANCEMENT] add client package (#137)
shahrokni May 27, 2026
60f6d4e
Bump golangci/golangci-lint-action in the actions group (#139)
dependabot[bot] May 27, 2026
eb160c6
Prepare release v0.54.0-beta.2 (#142)
shahrokni May 28, 2026
250d5bb
[ENHANCEMENT] add some missing functionalities from core (#144)
shahrokni May 28, 2026
f939492
Prepare release v0.54.0-beta.3 (#145)
shahrokni May 28, 2026
94dae1e
[BREAKINGCHANGE] remove httpproxy (#147)
shahrokni May 29, 2026
0401ecb
Add folder API types to @perses-dev/client (#153)
ayanarukasar Jun 9, 2026
6746076
[ENHANCEMENT] Expose @perses-dev/spec in plugin-system (#151)
ayanarukasar Jun 9, 2026
1c615c5
[BUGFIX] queryParams with variable substitution produces malformed pr…
zhuje Jun 9, 2026
d8f4f38
[ENHANCEMENT] add remaining types from core (#154)
shahrokni Jun 10, 2026
914a007
Prepare release v0.54.0-beta.4 (#158)
shahrokni Jun 10, 2026
fba7223
[ENHANCEMENT] maintain and update the shared package (#159)
shahrokni Jun 10, 2026
8f96480
Prepare release v0.54.0-beta.5 (#161)
shahrokni Jun 10, 2026
059ec12
BUGFIX: Update default datasource to not be preselected when null (#148)
ModupeD Jun 11, 2026
61fcbf1
[IGNORE] update vulnerable dependencies and update concurrently to v …
jgbernalp Jun 11, 2026
e136f2b
[FEATURE] Add annotation support (#120)
Gladorme Jun 11, 2026
874b63b
Prepare release 0.54.0-beta.6 (#164)
Gladorme Jun 11, 2026
7190254
[IGNORE] Fix typo QueryQuery (#167)
Gladorme Jun 12, 2026
fd1aa32
[BREAKINGCHANGE] relocate some defenitions from dashbaords to client …
shahrokni Jun 12, 2026
fac9a61
[ignore] bump perses/spec (#169)
Nexucis Jun 16, 2026
d784af2
[IGNORE] update vulnerable dependencies and remove unused packages (#…
jgbernalp Jun 16, 2026
f066409
[BUGFIX] Add method into DatasourceStore to return datasource spec (#…
zhuje Jun 16, 2026
f9afeb8
Prepare release 0.54.0-beta.7 (#174)
zhuje Jun 16, 2026
802a364
[ENHANCEMENT] remove duplicate proxy CUE definitions (#165)
ayanarukasar Jun 18, 2026
b5e8497
[BUGFIX] plugin-system: Expose some utils + fix imports (#175)
Gladorme Jun 18, 2026
91c631c
bump perses/spec (#178)
Nexucis Jun 19, 2026
5912e58
Release v0.54.0-beta.8 (#179)
Nexucis Jun 19, 2026
29bac1a
Bump actions/checkout from 6 to 7 in the actions group (#180)
dependabot[bot] Jun 22, 2026
f93c2be
[FEATURE] add setMetadata function to dashboard store (#182)
jgbernalp Jun 24, 2026
bc87296
[FEATURE]: add timezone logic to the dashboard toolbar (#177)
shahrokni Jun 24, 2026
2540513
[ENHANCEMENT] add user preference timezone to the dahboard view props…
shahrokni Jun 25, 2026
ccc48f4
[IGNORE] update vulnerable dependencies (#185)
jgbernalp Jun 26, 2026
b01b430
[FEATURE/BREAKINGCHANGE] DataQueriesProvider: use full queryDefinitio…
Gladorme Jun 26, 2026
6926e03
Prepare release v0.54.0-beta.9 (#187)
Gladorme Jun 26, 2026
41b0b13
[BUGFIX]: fix prometheus queryParam interpolation does not work for c…
zhuje Jun 28, 2026
842ae0a
Prepare release v0.54.0-beta.10 (#188)
zhuje Jun 29, 2026
b11002a
[BUGFIX] add double backslash behind special charachters when uisng r…
shahrokni Jul 2, 2026
f7d2333
Prepare release v0.54.0-beta.11 (#192)
shahrokni Jul 2, 2026
89f81f5
[IGNORE] bump the plugin runtime dependencies (#193)
rickardsjp Jul 2, 2026
0145604
[BREAKINGCHANGE] move PanelEditorValues and panel editor schemas out …
adrianSepiol Jul 6, 2026
9668451
Bump golangci/golangci-lint-action in the actions group (#196)
dependabot[bot] Jul 7, 2026
452c208
[BUGFIX] fix timeseries tooltip hover for stacked and grouped charts …
ibakshay Jul 7, 2026
180780e
[ENHANCEMENT] EChart: extract timezone-aware axis label formatter (#190)
andreasgerstmayr Jul 9, 2026
5e546ba
[BUGFIX] fix race condition with initial query plugin spec (#199)
andreasgerstmayr Jul 16, 2026
a12a5db
[ignore] update perses/spec to beta.9 (#200)
Nexucis Jul 16, 2026
9bd2cb0
Release v0.54.0-rc.0 (#201)
Nexucis Jul 16, 2026
472a289
[IGNORE] fix vulnerable dependencies (#203)
jgbernalp Jul 20, 2026
100357f
Release v0.54.0-rc.1 (#205)
Nexucis Jul 21, 2026
88594e0
Release v0.54.0 (#207)
Nexucis Jul 29, 2026
42ba30d
Upgrade Perses 0.54
vicmiletsky Aug 4, 2026
dba27b7
Fix types
vicmiletsky Aug 5, 2026
178676e
Perf updates
vicmiletsky Aug 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- uses: perses/github-actions@v0.12.0
- uses: ./.github/perses-ci/actions/setup_environment
with:
Expand All @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- uses: perses/github-actions@v0.12.0
- uses: ./.github/perses-ci/actions/setup_environment
with:
Expand All @@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- uses: perses/github-actions@v0.12.0
- uses: ./.github/perses-ci/actions/setup_environment
with:
Expand All @@ -66,7 +66,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- uses: perses/github-actions@v0.12.0
- uses: ./.github/perses-ci/actions/setup_environment
with:
Expand All @@ -86,7 +86,7 @@ jobs:
# GITHUB_TOKEN: ${{ github.TOKEN }}
# steps:
# - name: checkout
# uses: actions/checkout@v6
# uses: actions/checkout@v7
# - uses: perses/github-actions@v0.12.0
# - uses: ./.github/perses-ci/actions/setup_environment
# with:
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/cue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- main
- main-logzio
pull_request:
merge_group:
release:
Expand All @@ -20,32 +19,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- uses: perses/github-actions@v0.12.0
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_go: true
enable_cue: true
cue_version: 'v0.15.1'
cue_version: "v0.15.4"
- name: check that CUE schemas evaluate correctly
run: make cue-eval
- name: run the unit tests for CUE schemas
run: make cue-test

publish-module:
name: 'publish CUE module to Central Registry'
needs: 'validate-schemas'
name: "publish CUE module to Central Registry"
needs: "validate-schemas"
runs-on: ubuntu-latest
if: ${{ github.event.release.tag_name }}
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- uses: perses/github-actions@v0.12.0
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_go: true
enable_cue: true
cue_version: 'v0.15.1'
cue_version: "v0.15.4"
- name: Login to Central Registry # to allow publishing the module
run: cue login --token=${{ secrets.CUE_REG_TOKEN }}
- name: Publish the module
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.ref_name != 'main' }}

jobs:

Check failure on line 14 in .github/workflows/go.yml

View check run for this annotation

Cycode Security / Cycode: CI/CD

.github/workflows/go.yml#L14

GitHub workflows use uncertified CI/CD modules found
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- uses: perses/github-actions@v0.12.0
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_go: true
enable_go_cache: false
enable_npm: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v9.2.1
uses: golangci/golangci-lint-action@v9.3.0
Comment thread
cycode-security[bot] marked this conversation as resolved.
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v2.12.2
Expand All @@ -35,7 +35,7 @@
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- uses: perses/github-actions@v0.12.0
- uses: ./.github/perses-ci/actions/setup_environment
with:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2025 The Perses Authors
# Copyright The Perses Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@perses-dev/client",
"version": "0.54.0-beta.3",
"version": "0.54.0",
"description": "Functions as an API client or Data fetching Layer for interacting with a backend service",
"license": "Apache-2.0",
"homepage": "https://github.com/perses/perses/blob/main/README.md",
Expand All @@ -15,7 +15,7 @@
"main": "dist/cjs/index.js",
"types": "dist/index.d.ts",
"dependencies": {
"@perses-dev/spec": "0.2.0-beta.2",
"@perses-dev/spec": "0.2.0",
"zod": "^3.21.4"
},
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { ProjectMetadata } from '@perses-dev/client';
import { DashboardSpec } from '@perses-dev/spec';

export type DashboardKind = 'Dashboard' | 'EphemeralDashboard';

/* TODO: As discussed we can keep this intermediary type until we decide on a new location for it. */
export type DashboardMetaData = {
name: string;
project: string;
createdAt?: string;
updatedAt?: string;
version?: number;
};

/* TODO: There is an open and ongoing issue whether the meta-data should be removed or not.
Such a decision would affect DashbaordProvider and buildDatasourceProxyUrl
https://github.com/perses/perses/issues/4016
*/
export interface DashboardResource {
kind: DashboardKind;
spec: DashboardSpec;
metadata: DashboardMetaData;
metadata: ProjectMetadata;
}
29 changes: 29 additions & 0 deletions client/src/model/ephemeralDashboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright The Perses Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import { ProjectMetadata } from '@perses-dev/client';
import { DashboardSelector, DashboardSpec, DurationString } from '@perses-dev/spec';

export interface EphemeralDashboardResource {
kind: 'EphemeralDashboard';
metadata: ProjectMetadata;
spec: EphemeralDashboardSpec;
}

export interface EphemeralDashboardSpec extends DashboardSpec {
ttl: DurationString;
}

export interface EphemeralDashboardInfo extends DashboardSelector {
ttl: DurationString;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import React, { createContext, useContext, ReactNode } from 'react';
import { ProjectMetadata } from './resource';

interface QueryCountProviderProps {
queryCount: number;
children: ReactNode;
export interface FolderDisplay {
name?: string;
}

const QueryCountContext = createContext<number>(0);
export interface FolderSpec {
display?: FolderDisplay;
items?: FolderItem[];
}

export const QueryCountProvider: React.FC<QueryCountProviderProps> = ({ queryCount, children }) => {
return <QueryCountContext.Provider value={queryCount}>{children}</QueryCountContext.Provider>;
};
export interface FolderItem {
kind: 'Folder' | 'Dashboard';
name: string;
items?: FolderItem[];
}

export const useQueryCountContext = (): number => {
return useContext(QueryCountContext);
};
export interface FolderResource {
kind: 'Folder';
metadata: ProjectMetadata;
spec: FolderSpec;
}
6 changes: 0 additions & 6 deletions client/src/model/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,4 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { HTTPProxy } from '@perses-dev/spec';

export type RequestHeaders = Record<string, string>;
export interface HTTPDatasourceSpec {
directUrl?: string;
proxy?: HTTPProxy;
}
8 changes: 8 additions & 0 deletions client/src/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
// limitations under the License.

export * from './datasource';
export * from './folder';
export * from './kind';
export * from './resource';
export * from './datasource-api';
export * from './http';
export * from './secret';
export * from './role';
export * from './roleBindings';
export * from './user';
export * from './ephemeralDashboard';
export * from './variable';
export * from './dashboard';
11 changes: 11 additions & 0 deletions client/src/model/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { Display } from '@perses-dev/spec';
import { Kind } from './kind';

export function isProjectMetadata(metadata: Metadata | ProjectMetadata): metadata is ProjectMetadata {
Expand All @@ -36,6 +37,16 @@ export interface Resource {
spec?: any;
}

export interface ProjectResource {
kind: 'Project';
metadata: Metadata;
spec?: ProjectSpec;
}

export interface ProjectSpec {
display?: Display;
}

export function getMetadataProject(metadata: ProjectMetadata | Metadata): string | undefined {
return 'project' in metadata ? metadata.project : undefined;
}
68 changes: 68 additions & 0 deletions client/src/model/role.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright The Perses Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import { Kind, Metadata, ProjectMetadata } from '@perses-dev/client';

export type Action = 'create' | 'read' | 'update' | 'delete' | '*';
export const ACTIONS = ['*', 'create', 'read', 'update', 'delete'];
export type Scope = Kind | '*';
export const PROJECT_SCOPES = [
'*',
'Dashboard',
'Datasource',
'EphemeralDashboard',
'Folder',
'Project',
'Role',
'RoleBinding',
'Secret',
'Variable',
];

export const GLOBAL_SCOPES = [
'GlobalDatasource',
'GlobalRole',
'GlobalRoleBinding',
'GlobalSecret',
'GlobalVariable',
'User',
];

export interface Permission {
actions: Action[];
scopes: Scope[];
}

export interface RoleSpec {
permissions: Permission[];
}

/**
* A role that belongs to a project.
*/
export interface RoleResource {
kind: 'Role';
metadata: ProjectMetadata;
spec: RoleSpec;
}

/**
* A global role that doesn´t belong to a project.
*/
export interface GlobalRoleResource {
kind: 'GlobalRole';
metadata: Metadata;
spec: RoleSpec;
}

export type Role = RoleResource | GlobalRoleResource;
Loading
Loading