Skip to content

Commit 0bb75f9

Browse files
committed
EPMRPP-112475 || EPMRPP-113543 || EPMRPP-113542 || Add rename project event and fix table layout
1 parent 2840896 commit 0bb75f9

File tree

8 files changed

+52
-13
lines changed

8 files changed

+52
-13
lines changed

app/src/common/constants/actionTypes.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const CREATE_INTEGRATION = 'createIntegration';
4343
export const UPDATE_INTEGRATION = 'updateIntegration';
4444
export const DELETE_INTEGRATION = 'deleteIntegration';
4545
export const UPDATE_PROJECT = 'updateProject';
46+
export const UPDATE_PROJECT_NAME = 'updateProjectName';
4647
export const UPDATE_NOTIFICATIONS = 'emailConfig';
4748
export const NOTIFICATION_RULE = 'notificationRule';
4849
export const UPDATE_NOTIFICATION_SETTINGS = 'updateNotificationSettings';
@@ -85,6 +86,7 @@ export const ACTIONS_WITH_IMPORT = 'importActions';
8586
export const ACTIONS_WITH_LAUNCH = 'launchActions';
8687
export const ACTIONS_UPDATE_TEST_ITEM = 'updateTestItemActions';
8788
export const ACTIONS_WITH_NOTIFICATIONS = 'notificationsActions';
89+
export const ACTIONS_WITH_PROJECT = 'projectActions';
8890

8991
export const GROUP_TO_ACTION_MAP = {
9092
[ACTIONS_WITH_BTS_ISSUES]: [POST_ISSUE, LINK_ISSUE, UNLINK_ISSUE],
@@ -98,6 +100,7 @@ export const GROUP_TO_ACTION_MAP = {
98100
[ACTIONS_WITH_IMPORT]: [START_IMPORT, FINISH_IMPORT],
99101
[ACTIONS_UPDATE_TEST_ITEM]: [UPDATE_ITEM, ANALYZE_ITEM],
100102
[ACTIONS_WITH_NOTIFICATIONS]: [NOTIFICATION_RULE_FILTERING_OPTION, EMAIL_CONFIG_FILTERING_OPTION],
103+
[ACTIONS_WITH_PROJECT]: [UPDATE_PROJECT, UPDATE_PROJECT_NAME],
101104
};
102105

103106
export const ACTION_TO_GROUP_MAP = {
@@ -138,4 +141,7 @@ export const ACTION_TO_GROUP_MAP = {
138141

139142
[UPDATE_ITEM]: ACTIONS_UPDATE_TEST_ITEM,
140143
[ANALYZE_ITEM]: ACTIONS_UPDATE_TEST_ITEM,
144+
145+
[UPDATE_PROJECT]: ACTIONS_WITH_PROJECT,
146+
[UPDATE_PROJECT_NAME]: ACTIONS_WITH_PROJECT,
141147
};

app/src/common/constants/localization/eventsLocalization.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ import {
8585
UPDATE_NOTIFICATION_SETTINGS,
8686
UPDATE_NOTIFICATION_RULE,
8787
DELETE_NOTIFICATION_RULE,
88+
UPDATE_PROJECT_NAME,
8889
} from 'common/constants/actionTypes';
8990

9091
export const actionMessages = defineMessages({
@@ -169,6 +170,10 @@ export const actionMessages = defineMessages({
169170
id: 'EventActions.updateProject',
170171
defaultMessage: 'Update project',
171172
},
173+
[UPDATE_PROJECT_NAME]: {
174+
id: 'EventActions.updateProjectName',
175+
defaultMessage: 'Rename project',
176+
},
172177
[UPDATE_DEFECT]: {
173178
id: 'EventActions.updateDefect',
174179
defaultMessage: 'Update defect',

app/src/controllers/instance/actionCreators.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const fetchProjectDataAction = () => ({
2020
type: FETCH_PROJECT_DATA,
2121
});
2222

23-
export const fetchOrganizationEventsDataAction = () => ({
23+
export const fetchOrganizationEventsDataAction = (payload) => ({
2424
type: FETCH_ORGANIZATION_EVENTS_DATA,
25+
payload,
2526
});

app/src/controllers/instance/sagas.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import { all, select, put, takeEvery } from 'redux-saga/effects';
1818
import { projectKeySelector, fetchProjectAction } from 'controllers/project';
19+
import { withActiveOrganization } from 'controllers/organization/sagas';
1920
import { FETCH_ORGANIZATION_EVENTS_DATA, FETCH_PROJECT_DATA } from './constants';
2021
import { allUsersSagas } from './allUsers';
2122
import { eventsSagas, fetchEventsAction } from './events';
@@ -31,8 +32,10 @@ function* watchFetchProjectData() {
3132
yield takeEvery(FETCH_PROJECT_DATA, fetchProjectData);
3233
}
3334

34-
function* fetchOrganizationEventsData() {
35-
yield put(fetchEventsAction());
35+
function* fetchOrganizationEventsData({ payload: { organizationSlug } }) {
36+
yield* withActiveOrganization(organizationSlug, function* onActiveOrgReady() {
37+
yield put(fetchEventsAction());
38+
});
3639
}
3740

3841
function* watchFetchOrganizationEventsData() {

app/src/pages/organization/organizationEventsPage/eventsEntities.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ import {
9090
DELETE_NOTIFICATION_RULE,
9191
NOTIFICATION_RULE,
9292
ACTIONS_WITH_NOTIFICATIONS,
93+
UPDATE_PROJECT_NAME,
94+
ACTIONS_WITH_PROJECT,
9395
} from 'common/constants/actionTypes';
9496
import {
9597
DASHBOARD,
@@ -190,6 +192,8 @@ export const EventsEntities = (props) => {
190192
actionToGroup: {
191193
[START_IMPORT]: ACTIONS_WITH_IMPORT,
192194
[FINISH_IMPORT]: ACTIONS_WITH_IMPORT,
195+
[UPDATE_PROJECT]: ACTIONS_WITH_PROJECT,
196+
[UPDATE_PROJECT_NAME]: ACTIONS_WITH_PROJECT,
193197
},
194198
options: [
195199
{
@@ -286,7 +290,7 @@ export const EventsEntities = (props) => {
286290
},
287291
{
288292
label: formatMessage(actionMessages[UPDATE_PROJECT]),
289-
value: UPDATE_PROJECT,
293+
value: ACTIONS_WITH_PROJECT,
290294
},
291295
{
292296
label: formatMessage(actionMessages[UPDATE_ANALYZER]),

app/src/pages/organization/organizationEventsPage/eventsGrid/eventsGrid.scss

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,62 +24,70 @@
2424
}
2525
}
2626

27-
.time-col {
27+
.col-narrow {
28+
width: 8%;
29+
}
30+
31+
.col-medium {
2832
width: 10%;
33+
}
34+
35+
.col-wide {
36+
width: 17%;
37+
}
38+
39+
.time-col {
2940
height: 70px;
3041
vertical-align: top;
3142
font-size: 12px;
3243
}
3344

3445
.subject-name-col {
35-
width: 10%;
3646
vertical-align: top;
3747
font-size: 13px;
3848
@include responsive-ellipsis($SCREEN_XS_MAX);
3949
}
4050

4151
.project-name-col {
42-
width: 10%;
4352
vertical-align: top;
4453
font-size: 13px;
4554
@include responsive-ellipsis($SCREEN_XS_MAX);
4655
}
4756

4857
.subject-type-col {
49-
width: 10%;
5058
vertical-align: top;
5159
font-size: 13px;
5260
font-family: $FONT-SEMIBOLD;
5361
@include responsive-ellipsis($SCREEN_XS_MAX);
5462
}
5563

5664
.action-col {
57-
width: 10%;
5865
vertical-align: top;
5966
font-size: 13px;
6067
@include responsive-ellipsis($SCREEN_XS_MAX);
6168
}
6269

6370
.object-type-col {
64-
width: 10%;
6571
vertical-align: top;
6672
font-size: 13px;
6773
@include responsive-ellipsis($SCREEN_XS_MAX);
6874
}
6975

7076
.object-name-col {
71-
width: 10%;
7277
vertical-align: top;
7378
font-size: 13px;
7479
@include responsive-ellipsis($SCREEN_XS_MAX);
7580
}
7681

7782
.value-col {
78-
width: 15%;
7983
vertical-align: top;
8084
font-size: 13px;
8185
}
8286

87+
.events-grid {
88+
table-layout: fixed;
89+
}
90+
8391
.events-grid-header,
8492
.events-grid-row {
8593
@media (max-width: $SCREEN_SM_MAX) {

app/src/pages/organization/organizationEventsPage/eventsGrid/eventsGrid.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export const EventsGrid: React.FC<EventsGridProps> = ({
176176
sortable: true,
177177
maxHeight: 170,
178178
component: TimeColumn,
179+
customProps: { gridHeaderCellStyles: cx('col-narrow') },
179180
},
180181
{
181182
id: ENTITY_PROJECT_NAME,
@@ -185,6 +186,7 @@ export const EventsGrid: React.FC<EventsGridProps> = ({
185186
sortable: true,
186187
maxHeight: 170,
187188
component: ProjectNameColumn,
189+
customProps: { gridHeaderCellStyles: cx('col-medium') },
188190
},
189191
{
190192
id: ENTITY_SUBJECT_TYPE,
@@ -194,6 +196,7 @@ export const EventsGrid: React.FC<EventsGridProps> = ({
194196
sortable: true,
195197
maxHeight: 170,
196198
component: SubjectTypeColumn,
199+
customProps: { gridHeaderCellStyles: cx('col-narrow') },
197200
},
198201
{
199202
id: ENTITY_SUBJECT_NAME,
@@ -202,6 +205,7 @@ export const EventsGrid: React.FC<EventsGridProps> = ({
202205
},
203206
sortable: true,
204207
component: SubjectNameColumn,
208+
customProps: { gridHeaderCellStyles: cx('col-medium') },
205209
},
206210
{
207211
id: ENTITY_EVENT_NAME,
@@ -212,6 +216,7 @@ export const EventsGrid: React.FC<EventsGridProps> = ({
212216
component: ActionColumn,
213217
customProps: {
214218
formatMessage: intl.formatMessage,
219+
gridHeaderCellStyles: cx('col-medium'),
215220
},
216221
},
217222
{
@@ -224,6 +229,7 @@ export const EventsGrid: React.FC<EventsGridProps> = ({
224229
component: ObjectTypeColumn,
225230
customProps: {
226231
formatMessage: intl.formatMessage,
232+
gridHeaderCellStyles: cx('col-medium'),
227233
},
228234
},
229235
{
@@ -234,6 +240,7 @@ export const EventsGrid: React.FC<EventsGridProps> = ({
234240
},
235241
sortable: true,
236242
component: ObjectNameColumn,
243+
customProps: { gridHeaderCellStyles: cx('col-medium') },
237244
},
238245
{
239246
id: 'oldValue',
@@ -243,6 +250,7 @@ export const EventsGrid: React.FC<EventsGridProps> = ({
243250
component: ValueColumn,
244251
customProps: {
245252
valueType: 'old_value',
253+
gridHeaderCellStyles: cx('col-wide'),
246254
},
247255
},
248256
{
@@ -253,6 +261,7 @@ export const EventsGrid: React.FC<EventsGridProps> = ({
253261
component: ValueColumn,
254262
customProps: {
255263
valueType: 'new_value',
264+
gridHeaderCellStyles: cx('col-wide'),
256265
},
257266
},
258267
],

app/src/routes/routesMap.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,10 @@ const routesMap = {
284284
});
285285
}
286286

287-
dispatch(fetchOrganizationEventsDataAction());
287+
const {
288+
location: { payload },
289+
} = state;
290+
dispatch(fetchOrganizationEventsDataAction(payload));
288291
},
289292
},
290293

0 commit comments

Comments
 (0)