Skip to content

Commit 968ea62

Browse files
authored
Merge branch 'main' into astandrik.2173
2 parents 31a8ec4 + 0dda6ec commit 968ea62

File tree

79 files changed

+2175
-682
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2175
-682
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Update Calculated Priority
2+
3+
on:
4+
issues:
5+
types: [opened, labeled, unlabeled, edited]
6+
7+
jobs:
8+
update-priority:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Update CalculatedPriority field
12+
uses: actions/github-script@v7
13+
with:
14+
github-token: ${{ secrets.YDB_PLATFORM_BOT_TOKEN_REPO }}
15+
script: |
16+
const labelWeights = {
17+
"prio/high": 1000,
18+
"prio/medium": 500,
19+
"prio/low": 100
20+
};
21+
22+
const issue = context.payload.issue;
23+
const labels = issue.labels.map(l => l.name);
24+
const basePriority = Math.min(...labels.map(l => labelWeights[l] || 10), 1000);
25+
26+
const createdAt = new Date(issue.created_at);
27+
const daysOld = Math.floor((Date.now() - createdAt.getTime()) / (1000 * 60 * 60 * 24));
28+
29+
const finalScore = basePriority + daysOld;
30+
31+
const projectNumber = 24;
32+
const org = "ydb-platform";
33+
34+
const result = await github.graphql(`
35+
query($org: String!, $number: Int!) {
36+
organization(login: $org) {
37+
projectV2(number: $number) {
38+
id
39+
fields(first: 50) {
40+
nodes {
41+
... on ProjectV2Field {
42+
id
43+
name
44+
}
45+
}
46+
}
47+
items(first: 100) {
48+
nodes {
49+
id
50+
content {
51+
... on Issue {
52+
id
53+
number
54+
}
55+
}
56+
}
57+
}
58+
}
59+
}
60+
}
61+
`, { org, number: projectNumber });
62+
63+
const project = result.organization.projectV2;
64+
const field = project.fields.nodes.find(f => f.name === "CalculatedPriority");
65+
if (!field) {
66+
core.setFailed("Field 'CalculatedPriority' not found.");
67+
return;
68+
}
69+
70+
const item = project.items.nodes.find(n => n.content?.number === issue.number);
71+
if (!item) {
72+
console.log(`Issue #${issue.number} not found in project.`);
73+
return;
74+
}
75+
76+
await github.graphql(`
77+
mutation($input: UpdateProjectV2ItemFieldValueInput!) {
78+
updateProjectV2ItemFieldValue(input: $input) {
79+
projectV2Item {
80+
id
81+
}
82+
}
83+
}
84+
`, {
85+
input: {
86+
projectId: project.id,
87+
itemId: item.id,
88+
fieldId: field.id,
89+
value: { number: finalScore }
90+
}
91+
});
92+
93+
console.log(`Updated CalculatedPriority of issue #${issue.number} to ${finalScore}`);

src/components/Drawer/Drawer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ interface DrawerPaneContentWrapperProps {
3232
detectClickOutside?: boolean;
3333
defaultWidth?: number;
3434
isPercentageWidth?: boolean;
35+
hideVeil?: boolean;
3536
}
3637

3738
const DrawerPaneContentWrapper = ({
@@ -45,6 +46,7 @@ const DrawerPaneContentWrapper = ({
4546
className,
4647
detectClickOutside = false,
4748
isPercentageWidth,
49+
hideVeil = true,
4850
}: DrawerPaneContentWrapperProps) => {
4951
const [drawerWidth, setDrawerWidth] = React.useState(() => {
5052
const savedWidth = localStorage.getItem(storageKey);
@@ -113,7 +115,7 @@ const DrawerPaneContentWrapper = ({
113115
<GravityDrawer
114116
onEscape={onClose}
115117
onVeilClick={onClose}
116-
hideVeil
118+
hideVeil={hideVeil}
117119
className={b('container', className)}
118120
>
119121
<DrawerItem
@@ -156,6 +158,7 @@ interface DrawerPaneProps {
156158
drawerControls?: DrawerControl[];
157159
title?: React.ReactNode;
158160
headerClassName?: string;
161+
hideVeil?: boolean;
159162
}
160163

161164
export const DrawerWrapper = ({
@@ -173,6 +176,7 @@ export const DrawerWrapper = ({
173176
drawerControls = [],
174177
title,
175178
headerClassName,
179+
hideVeil,
176180
}: DrawerPaneProps) => {
177181
React.useEffect(() => {
178182
return () => {
@@ -220,6 +224,7 @@ export const DrawerWrapper = ({
220224
<React.Fragment>
221225
{children}
222226
<DrawerPaneContentWrapper
227+
hideVeil={hideVeil}
223228
isVisible={isDrawerVisible}
224229
onClose={onCloseDrawer}
225230
drawerId={drawerId}

src/containers/Storage/EmptyFilter/EmptyFilter.tsx renamed to src/components/EmptyFilter/EmptyFilter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {Button} from '@gravity-ui/uikit';
22

3-
import {EmptyState} from '../../../components/EmptyState';
4-
import {Illustration} from '../../../components/Illustration';
3+
import {EmptyState} from '../EmptyState';
4+
import {Illustration} from '../Illustration';
55

66
import i18n from './i18n';
77

src/containers/Storage/EmptyFilter/i18n/index.ts renamed to src/components/EmptyFilter/i18n/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {registerKeysets} from '../../../../utils/i18n';
1+
import {registerKeysets} from '../../../utils/i18n';
22

33
import en from './en.json';
44
import ru from './ru.json';

src/components/EmptyState/EmptyState.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@use '../../styles/mixins.scss';
22

33
.empty-state {
4+
$block: &;
45
padding: 20px;
56

67
&_size_m {
@@ -13,6 +14,14 @@
1314
'image title'
1415
'image description'
1516
'image actions';
17+
18+
&_size_xs {
19+
width: 321px;
20+
height: 100px;
21+
#{$block}__image {
22+
margin-right: var(--g-spacing-5);
23+
}
24+
}
1625
&_size_s {
1726
width: 460px;
1827
height: 120px;

src/components/EmptyState/EmptyState.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import './EmptyState.scss';
99
const block = cn('empty-state');
1010

1111
const sizes = {
12+
xs: 100,
1213
s: 150,
1314
m: 250,
1415
l: 350,

src/components/EnableFullscreenButton/EnableFullscreenButton.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import {SquareDashed} from '@gravity-ui/icons';
22
import type {ButtonView} from '@gravity-ui/uikit';
3-
import {Button, Icon} from '@gravity-ui/uikit';
3+
import {ActionTooltip, Button, Icon} from '@gravity-ui/uikit';
44

55
import {enableFullscreen} from '../../store/reducers/fullscreen';
66
import {useTypedDispatch} from '../../utils/hooks';
77

8+
import i18n from './i18n';
9+
810
interface EnableFullscreenButtonProps {
911
disabled?: boolean;
1012
view?: ButtonView;
@@ -16,9 +18,11 @@ function EnableFullscreenButton({disabled, view = 'flat-secondary'}: EnableFulls
1618
dispatch(enableFullscreen());
1719
};
1820
return (
19-
<Button onClick={onEnableFullscreen} view={view} disabled={disabled} title="Fullscreen">
20-
<Icon data={SquareDashed} />
21-
</Button>
21+
<ActionTooltip title={i18n('title_fullscreen')}>
22+
<Button onClick={onEnableFullscreen} view={view} disabled={disabled}>
23+
<Icon data={SquareDashed} />
24+
</Button>
25+
</ActionTooltip>
2226
);
2327
}
2428

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"title_fullscreen": "Fullscreen"
3+
}

0 commit comments

Comments
 (0)