Skip to content

Commit

Permalink
Merge pull request #4083 from reportportal/feature/EPMRPP-96578-merge…
Browse files Browse the repository at this point in the history
…-develop-to-orgs

Feature/epmrpp 96578 merge develop to orgs
  • Loading branch information
BlazarQSO authored Nov 6, 2024
2 parents c9785c0 + 5b8a6b6 commit b93908c
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* [ ] Have you run the linter (`npm run lint`) prior to submission? Enable the git hook on commit in your IDE to run it and format the code automatically.
* [ ] Have you run the tests locally and added/updated them if needed?
* [ ] Have you checked that app can be built (`npm run build`)?
* [ ] Have you checked that no new circular dependencies appreared with your changes? (the webpack plugin reports circular dependencies within the `dev` npm script)
* [ ] Have you made sure that all the necessary pipelines has been successfully completed?
* [ ] If the task requires translations to be updated, have you done this by running the `manage:translations` script?

Expand Down
2 changes: 1 addition & 1 deletion app/src/common/utils/validation/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const createNotificationRecipientsValidator = (informOwner) => (value = [
if (informOwner && !value.length) {
return true;
}
const checkIsStringWithEmailParts = regex(/[.@]/);
const checkIsStringWithEmailParts = regex(/@/);
if (value.some(checkIsStringWithEmailParts)) {
return value.filter(checkIsStringWithEmailParts).every(email);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ export const getLaunchModeConfig = ({
}) => {
const colors = {};
const columns = [];

const sortedResult = content.sort((item) => -item.number);
// EPMRPP-96393 (GitHub #2381): Changed sorting from -item.number to startTime-based sorting
// for consistency across all chart widgets. This ensures chronological ordering
// based on actual launch times rather than launch names/numbers.
const sortedResult = content.sort((a, b) => {
const startTimeA = new Date(a.startTime);
const startTimeB = new Date(b.startTime);
return startTimeA - startTimeB;
});
const itemsData = sortedResult.map((item) => ({
id: item.id,
name: item.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export const getConfigData = (
});

widgetData
.sort((a, b) => a.startTime - b.startTime)
.sort((a, b) => {
const startTimeA = new Date(a.startTime);
const startTimeB = new Date(b.startTime);
return startTimeA - startTimeB;
})
.forEach((item) => {
const currentItemData = {
...item,
Expand Down
7 changes: 2 additions & 5 deletions app/src/controllers/log/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
} from 'controllers/log/nestedSteps/actionCreators';
import { createNamespacedQuery } from 'common/utils/routingUtils';
import { FAILED } from 'common/constants/testStatuses';
import { ERROR, FATAL } from 'common/constants/logLevels';
import { ERROR } from 'common/constants/logLevels';
import {
fetchErrorLogs,
clearLogPageStackTrace,
Expand Down Expand Up @@ -128,9 +128,6 @@ function* fetchAllErrorLogs({
excludeLogContent = true,
level,
}) {
const logMessages = yield select(logItemsSelector);
const requiresErrorLogLocation = logMessages.some((log) => [ERROR, FATAL].includes(log.level));

const { id } = logItem;
const { projectKey, query, filterLevel } = yield call(collectLogPayload);
let retryId = null;
Expand All @@ -140,7 +137,7 @@ function* fetchAllErrorLogs({
}
let cancelRequest = () => {};
try {
if (logViewMode === DETAILED_LOG_VIEW && requiresErrorLogLocation) {
if (logViewMode === DETAILED_LOG_VIEW) {
yield put(
fetchDataAction(namespace)(
URLS.errorLogs(projectKey, retryId || id, level || filterLevel),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const RecipientsContainerComponent = ({ projectInfo, error, ...rest }) => {
const [recipientsWithError, setRecipientsWithError] = useState([]);

const emailValidation = (email) => {
return regex(/[.@]/)(email);
return regex(/@/)(email);
};

const getEmailValidationError = (v) => {
Expand Down
30 changes: 24 additions & 6 deletions app/src/pages/outside/loginPage/loginPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,38 @@ export class LoginPage extends PureComponent {
extensions: [],
showDefaultErrorNotification: () => {},
};
/*
* EPMRPP-96385: Quick fix for duplicate login error notifications
* Includes: static shownErrors, showErrorIfNeeded, componentDidMount, componentDidUpdate
*
* Quick fix to prevent duplicate error messages that sometimes occur when inactive GitHub users
* try to log in. Root cause: Login page component occasionally mounts twice causing duplicate
* error notifications. Using a static Set to deduplicate error messages as a temporary solution.
*
* TODO: Investigate inconsistent double mounting of login page
*/
static shownErrors = new Set();

componentDidMount() {
if (this.props.errorAuth) {
showErrorIfNeeded = (error) => {
if (error && !LoginPage.shownErrors.has(error)) {
LoginPage.shownErrors.add(error);
this.props.showDefaultErrorNotification({
message: this.props.errorAuth,
message: error,
});

setTimeout(() => {
LoginPage.shownErrors.delete(error);
}, 5000);
}
};

componentDidMount() {
this.showErrorIfNeeded(this.props.errorAuth);
}

componentDidUpdate(prevProps) {
if (this.props.errorAuth !== prevProps.errorAuth) {
this.props.showDefaultErrorNotification({
message: this.props.errorAuth,
});
this.showErrorIfNeeded(this.props.errorAuth);
}
}

Expand Down

0 comments on commit b93908c

Please sign in to comment.