Skip to content

Commit 8832a2a

Browse files
committed
Fixing bugs.
1 parent e31fdc3 commit 8832a2a

File tree

12 files changed

+41
-37
lines changed

12 files changed

+41
-37
lines changed

src/components/Exercises/ExercisesListItem/ExercisesListItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ const ExercisesListItem = ({
147147
</OverlayTrigger>
148148
</Link>
149149
)}
150-
{permissionHints.viewPipelines && permissionHints.viewScoreConfig && (
150+
{permissionHints.viewConfig && permissionHints.viewScoreConfig && (
151151
<Link to={EXERCISE_EDIT_CONFIG_URI_FACTORY(id)}>
152152
<OverlayTrigger
153153
placement="bottom"

src/components/Pipelines/PipelineExercisesList/PipelineExercisesList.js

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,30 @@ const PipelineExercisesList = ({
6262
fullView || pipelineExercises.size < COLLAPSE_LIMIT ? 1000000 : PREVIEW_SIZE
6363
);
6464
return (
65-
<Table hover className="mb-1" size="xs">
66-
<thead>
67-
<tr>
68-
<th className="pl-4">
69-
<FormattedMessage id="generic.name" defaultMessage="Name" />
70-
</th>
71-
<th>
72-
<FormattedMessage id="generic.author" defaultMessage="Author" />
73-
</th>
74-
<th className="shrink-col text-nowrap">
75-
{pipelineExercises.size > 5 && (
76-
<small className="text-muted">
77-
<FormattedMessage
78-
id="app.pipelineExercisessList.totalCount"
79-
defaultMessage="Total exercises: {count}"
80-
values={{ count: pipelineExercises.size }}
81-
/>
82-
</small>
83-
)}
84-
</th>
85-
</tr>
86-
</thead>
65+
<Table hover={pipelineExercises.size > 0} className="mb-1" size="xs">
66+
{pipelineExercises.size > 0 && (
67+
<thead>
68+
<tr>
69+
<th className="pl-4">
70+
<FormattedMessage id="generic.name" defaultMessage="Name" />
71+
</th>
72+
<th>
73+
<FormattedMessage id="generic.author" defaultMessage="Author" />
74+
</th>
75+
<th className="shrink-col text-nowrap">
76+
{pipelineExercises.size > 5 && (
77+
<small className="text-muted">
78+
<FormattedMessage
79+
id="app.pipelineExercisessList.totalCount"
80+
defaultMessage="Total exercises: {count}"
81+
values={{ count: pipelineExercises.size }}
82+
/>
83+
</small>
84+
)}
85+
</th>
86+
</tr>
87+
</thead>
88+
)}
8789

8890
<tbody>
8991
{exercises.map(exercise => (
@@ -133,12 +135,12 @@ const PipelineExercisesList = ({
133135
</tr>
134136
))}
135137

136-
{exercises.length === 0 && (
138+
{pipelineExercises.size === 0 && (
137139
<tr>
138-
<td className="text-center" colSpan={3}>
140+
<td className="text-center text-muted" colSpan={3}>
139141
<FormattedMessage
140142
id="app.pipelineExercisessList.empty"
141-
defaultMessage="There are no exercises using this pipelines at the moment."
143+
defaultMessage="There are no exercises using this pipeline at the moment."
142144
/>
143145
</td>
144146
</tr>

src/containers/DeletePipelineButtonContainer/DeletePipelineButtonContainer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ export default connect(
2828
}),
2929
(dispatch, { id, onDeleted }) => ({
3030
deletePipeline: () => {
31-
onDeleted && onDeleted();
32-
return dispatch(deletePipeline(id));
31+
return dispatch(deletePipeline(id)).then(res => {
32+
onDeleted && onDeleted();
33+
return res;
34+
});
3335
},
3436
})
3537
)(DeletePipelineButtonContainer);

src/helpers/pipelines.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const getVariablesUtilization = defaultMemoize(boxes => {
8181
boxes.forEach(box =>
8282
['portsIn', 'portsOut'].forEach(ports =>
8383
Object.keys(box[ports])
84-
.filter(port => box[ports][port])
84+
.filter(port => box[ports][port] && box[ports][port].value)
8585
.forEach(port => {
8686
const { value } = box[ports][port];
8787
if (!utils[value]) {

src/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@
11371137
"app.pipelineEditContainer.versionChanged": "The pipeline structure was updated whilst you were editing it. If you load the new pipeline, it will be pushed as a new state in editor (you can use undo button to revert it).",
11381138
"app.pipelineEditContainer.versionChangedTitle": "The pipeline was updated",
11391139
"app.pipelineExercisessList.collapse": "Collapse the list and show only short preview.",
1140-
"app.pipelineExercisessList.empty": "There are no exercises using this pipelines at the moment.",
1140+
"app.pipelineExercisessList.empty": "There are no exercises using this pipeline at the moment.",
11411141
"app.pipelineExercisessList.expand": "Expand the list and show all {count} exercises.",
11421142
"app.pipelineExercisessList.totalCount": "Total exercises: {count}",
11431143
"app.pipelineFilesTable.description": "Supplementary files are files which can be referenced as remote file in pipeline configuration.",

src/pages/EditExercise/EditExercise.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class EditExercise extends Component {
101101
<ExerciseNavigation
102102
exerciseId={exercise.id}
103103
canEdit={hasPermissions(exercise, 'update')}
104-
canViewTests={hasPermissions(exercise, 'viewPipelines', 'viewScoreConfig')}
104+
canViewTests={hasPermissions(exercise, 'viewConfig', 'viewScoreConfig')}
105105
canViewLimits={hasPermissions(exercise, 'viewLimits')}
106106
canViewAssignments={hasPermissions(exercise, 'viewAssignments')}
107107
/>

src/pages/EditExerciseConfig/EditExerciseConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class EditExerciseConfig extends Component {
288288
<ExerciseNavigation
289289
exerciseId={exercise.id}
290290
canEdit={hasPermissions(exercise, 'update')}
291-
canViewTests={hasPermissions(exercise, 'viewPipelines', 'viewScoreConfig')}
291+
canViewTests={hasPermissions(exercise, 'viewConfig', 'viewScoreConfig')}
292292
canViewLimits={hasPermissions(exercise, 'viewLimits')}
293293
canViewAssignments={hasPermissions(exercise, 'viewAssignments')}
294294
/>

src/pages/EditExerciseLimits/EditExerciseLimits.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class EditExerciseLimits extends Component {
157157
<ExerciseNavigation
158158
exerciseId={exercise.id}
159159
canEdit={hasPermissions(exercise, 'update')}
160-
canViewTests={hasPermissions(exercise, 'viewPipelines', 'viewScoreConfig')}
160+
canViewTests={hasPermissions(exercise, 'viewConfig', 'viewScoreConfig')}
161161
canViewLimits={hasPermissions(exercise, 'viewLimits')}
162162
canViewAssignments={hasPermissions(exercise, 'viewAssignments')}
163163
/>

src/pages/Exercise/Exercise.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class Exercise extends Component {
129129
<ExerciseNavigation
130130
exerciseId={exercise.id}
131131
canEdit={hasPermissions(exercise, 'update')}
132-
canViewTests={hasPermissions(exercise, 'viewPipelines', 'viewScoreConfig')}
132+
canViewTests={hasPermissions(exercise, 'viewConfig', 'viewScoreConfig')}
133133
canViewLimits={hasPermissions(exercise, 'viewLimits')}
134134
canViewAssignments={hasPermissions(exercise, 'viewAssignments')}
135135
/>

src/pages/ExerciseAssignments/ExerciseAssignments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class ExerciseAssignments extends Component {
131131
<ExerciseNavigation
132132
exerciseId={exercise.id}
133133
canEdit={hasPermissions(exercise, 'update')}
134-
canViewTests={hasPermissions(exercise, 'viewPipelines', 'viewScoreConfig')}
134+
canViewTests={hasPermissions(exercise, 'viewConfig', 'viewScoreConfig')}
135135
canViewLimits={hasPermissions(exercise, 'viewLimits')}
136136
canViewAssignments={hasPermissions(exercise, 'viewAssignments')}
137137
/>

0 commit comments

Comments
 (0)