Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump nginx from 1.21.6-alpine to 1.25.0-alpine in /.docker #760

Merged
merged 10 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# build environment
FROM node:14.17.0 as build
FROM node:20.2.0 as build
WORKDIR /app
COPY . /app
RUN yarn install
RUN yarn build --mode=production

# production environment
FROM nginx:1.21.6-alpine
FROM nginx:1.25.0-alpine
## add permissions for nginx user
RUN apk add python3
COPY --from=build /app/build /usr/share/nginx/html
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on: [pull_request]

jobs:
label:
permissions:
checks: write
contents: read
pull-requests: write
runs-on: ubuntu-latest

steps:
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,4 @@ https://webpack.js.org/
### Browserslist
Used to define which browsers we support, as well as integrate with polyfill loading in CSS and Babel.

https://www.npmjs.com/package/browserslist


https://www.npmjs.com/package/browserslist
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"@types/lodash.debounce": "^4.0.7",
"axios": "0.27.2",
"date-fns": "^2.29.3",
"qs": "^6.11.0",
"qs": "^6.11.2",
"query-string": "8.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/app/ProcosysRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const UserGreeting = React.lazy(() => import('./../modules/UserGreeting'));
const Preservation = React.lazy(() => import('./../modules/Preservation'));
const PlantConfig = React.lazy(() => import('./../modules/PlantConfig'));
const InvitationForPunchOut = React.lazy(
() => import('./../modules/InvitationForPunchOut')
() => import('../modules/InvitationForPunchOut/InvitationForPunchOut')
);

const Page404 = (): JSX.Element => {
Expand Down
36 changes: 30 additions & 6 deletions src/components/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,36 @@ const selectionHook = (hooks: Hooks<Record<string, unknown>>): void => {
Header: ({
getToggleAllRowsSelectedProps,
disableSelectAll,
}: HeaderProps<Record<string, unknown>>): JSX.Element => (
<HeaderCheckbox
{...getToggleAllRowsSelectedProps()}
disabled={disableSelectAll}
/>
),
rows,
toggleRowSelected,
}: HeaderProps<Record<string, unknown>>): JSX.Element => {
//Remove on change form selectAllprops
const { onChange, ...propsWithoutOnChange } =
getToggleAllRowsSelectedProps();
//Function to select all rows where checkbox isn't disabled
const overridenOnChange = (): void => {
rows.forEach((row) => {
if (!row.original.disableCheckbox) {
let toggleTo = true;
if (
propsWithoutOnChange.checked ||
propsWithoutOnChange.indeterminate
)
toggleTo = false;
toggleRowSelected(row.id, toggleTo);
}
});
};

//Redefined props
const newProps = {
onChange: overridenOnChange,
...propsWithoutOnChange,
};
return (
<HeaderCheckbox {...newProps} disabled={disableSelectAll} />
);
},
Cell: ({ row }: CellProps<Record<string, unknown>>): JSX.Element =>
row.original.noCheckbox ? (
<></>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import CreateIPO from './views/CreateAndEditIPO/CreateIPO';
import EditIPO from './views/CreateAndEditIPO/EditIPO';
import { Helmet } from 'react-helmet';
import { InvitationForPunchOutContextProvider } from './context/InvitationForPunchOutContext';
import SearchIPO from './views/SearchIPO';
import SearchIPO from './views/SearchIPO/SearchIpo';
import ViewIPO from './views/ViewIPO/ViewIPO';
import withAccessControl from '@procosys/core/security/withAccessControl';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ProCoSysApiError } from '../../../core/ProCoSysApiError';
import ProCoSysSettings from '../../../core/ProCoSysSettings';
import Qs from 'qs';
import { RequestCanceler } from '../../../http/HttpClient';
import { OperationHandoverStatusEnum, IpoStatusEnum } from '../views/enums';

export class IpoApiError extends ProCoSysApiError {
constructor(error: AxiosError) {
Expand All @@ -30,6 +31,7 @@ type InvitationResponse = {
participants: ParticipantInvitationResponse[];
mcPkgScope: McPkgScopeResponse[];
commPkgScope: CommPkgScopeResponse[];
isOnline: boolean;
};

type McPkgScopeResponse = {
Expand Down Expand Up @@ -141,6 +143,7 @@ interface CommPkgResponse {
description: string;
system: string;
status: string;
operationHandoverStatus: OperationHandoverStatusEnum;
}

interface McPkgResponse {
Expand All @@ -149,6 +152,10 @@ interface McPkgResponse {
description: string;
system: string;
disciplineCode: string;
operationHandoverStatus: OperationHandoverStatusEnum;
m01: string;
m02: string;
status: string;
}

interface PersonResponse {
Expand Down Expand Up @@ -180,7 +187,7 @@ interface FunctionalRoleResponse {
interface IPO {
id: number;
title: string;
status: string;
status: IpoStatusEnum;
type: string;
createdAtUtc: Date;
startTimeUtc: Date;
Expand Down Expand Up @@ -527,6 +534,7 @@ class InvitationForPunchOutApiClient extends ApiClient {
participants: ParticipantDto[],
mcPkgScope: string[] | null,
commPkgScope: string[] | null,
isOnline: boolean,
setRequestCanceller?: RequestCanceler
): Promise<number> {
const endpoint = '/Invitations';
Expand All @@ -547,6 +555,7 @@ class InvitationForPunchOutApiClient extends ApiClient {
participants: participants,
mcPkgScope: mcPkgScope,
commPkgScope: commPkgScope,
isOnline: isOnline,
},
settings
);
Expand Down
8 changes: 8 additions & 0 deletions src/modules/InvitationForPunchOut/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { SelectItem } from '../../components/Select';
import { OperationHandoverStatusEnum } from './views/enums';

export type ProjectDetails = {
id: number;
Expand All @@ -19,6 +20,7 @@ export type GeneralInfoDetails = {
date: Date | undefined;
startTime: Date | undefined;
endTime: Date | undefined;
isOnline?: boolean;
location?: string | null;
};

Expand Down Expand Up @@ -89,6 +91,7 @@ export interface CommPkgRow {
tableData?: {
isSelected: boolean;
};
operationHandoverStatus?: OperationHandoverStatusEnum;
}

export interface McPkgRow {
Expand All @@ -100,6 +103,11 @@ export interface McPkgRow {
tableData?: {
isSelected: boolean;
};
operationHandoverStatus?: OperationHandoverStatusEnum;
disableCheckbox?: boolean;
m01?: string;
m02?: string;
status?: string;
}

export interface McScope {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const emptyGeneralInfo: GeneralInfoDetails = {
minutes: initialEnd.getMinutes(),
}),
location: '',
isOnline: false,
};

const initialParticipants: Participant[] = [
Expand Down Expand Up @@ -351,7 +352,8 @@ const CreateIPO = (): JSX.Element => {
generalInfo.location ? generalInfo.location : null,
ipoParticipants,
mcPkgScope,
commPkgScope
commPkgScope,
generalInfo.isOnline ? generalInfo.isOnline : false
);
analystics.trackUserAction(IpoCustomEvents.CREATED, {
project: generalInfo.projectName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const emptyGeneralInfo: GeneralInfoDetails = {
startTime: new Date(),
endTime: new Date(),
location: '',
isOnline: false,
};

const EditIPO = (): JSX.Element => {
Expand All @@ -66,6 +67,9 @@ const EditIPO = (): JSX.Element => {
useState<GeneralInfoDetails>(emptyGeneralInfo);
const [confirmationChecked, setConfirmationChecked] =
useState<boolean>(true);
const [isOnline, setIsOnline] = useState<boolean>(
generalInfo.isOnline ? generalInfo.isOnline : false
);
const [selectedCommPkgScope, setSelectedCommPkgScope] = useState<
CommPkgRow[]
>([]);
Expand Down Expand Up @@ -465,6 +469,7 @@ const EditIPO = (): JSX.Element => {
minutes: endTime.getMinutes(),
}),
location: invitation.location ? invitation.location : '',
isOnline: invitation.isOnline,
};
setGeneralInfo({ ...info });
setInitialGeneralInfo({ ...info });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ export const DateTimeContainer = styled.div`
`;

export const LocationContainer = styled.div`
width: 300px;
display: flex;
align-items: center;
justify-content: center;
gap: 20px;
`;

export const TeamsMeetingContainer = styled.span`
width: 550px;
`;

export const PoTypeContainer = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
PoTypeContainer,
TextContainer,
Column,
TeamsMeetingContainer,
} from './GeneralInfo.style';
import {
GeneralInfoDetails,
Expand All @@ -28,6 +29,7 @@ import { tokens } from '@equinor/eds-tokens';
import { useInvitationForPunchOutContext } from '../../../context/InvitationForPunchOutContext';
import { Label } from '@equinor/eds-core-react';
import { DatePicker, TimePicker } from '@mui/x-date-pickers';
import { Tooltip } from '@equinor/eds-core-react';

export const poTypes: SelectItem[] = [
{ text: 'DP (Discipline Punch)', value: 'DP' },
Expand Down Expand Up @@ -70,6 +72,9 @@ const GeneralInfo = ({
const [endTime, setEndTime] = useState<string | null>(
generalInfo.endTime ? generalInfo.endTime.toString() : null
);
const [isOnline, setIsOnline] = useState<boolean>(
generalInfo.isOnline ? generalInfo.isOnline : false
);

useEffect(() => {
if (filterForProjects.length <= 0) {
Expand Down Expand Up @@ -378,6 +383,33 @@ const GeneralInfo = ({
}}
disabled={isDisabled}
/>
{isEditMode ? (
<Checkbox disabled checked={isOnline}>
Create Teams meeting
</Checkbox>
) : (
<Tooltip
title="Can't be changed later"
placement="bottom"
>
<TeamsMeetingContainer>
<Checkbox
checked={isOnline}
onChange={(): void => {
setIsOnline(!isOnline);
setGeneralInfo((gi) => {
return {
...gi,
isOnline: !isOnline,
};
});
}}
>
Create Teams meeting
</Checkbox>
</TeamsMeetingContainer>
</Tooltip>
)}
</LocationContainer>
{errors && errors['location'] && (
<ErrorContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import { Canceler } from '@procosys/http/HttpClient';
import EdsIcon from '@procosys/components/EdsIcon';
import { useInvitationForPunchOutContext } from '@procosys/modules/InvitationForPunchOut/context/InvitationForPunchOutContext';
import { Tooltip } from '@mui/material';
import Checkbox from '@procosys/components/Checkbox';
import { OperationHandoverStatusEnum } from '../../enums';

interface CommPkgTableProps {
selectedCommPkgScope: CommPkgRow[];
Expand Down Expand Up @@ -129,6 +131,8 @@ const CommPkgTable = forwardRef(
(c) => c.commPkgNo == commPkg.commPkgNo
),
},
operationHandoverStatus:
commPkg.operationHandoverStatus,
};
}
);
Expand Down Expand Up @@ -171,6 +175,8 @@ const CommPkgTable = forwardRef(
tableData: {
isSelected: true,
},
operationHandoverStatus:
commPkg.operationHandoverStatus,
};
}
);
Expand Down Expand Up @@ -290,6 +296,9 @@ const CommPkgTable = forwardRef(
const _data = [...data];
_data.forEach((d) => {
d.disableCheckbox = !hasValidSection(d.system);
if (d.operationHandoverStatus === 'ACCEPTED') {
d.disableCheckbox = true;
}
});
setFilteredCommPkgs(_data);
}, [selectedCommPkgScope, data]);
Expand Down Expand Up @@ -344,6 +353,16 @@ const CommPkgTable = forwardRef(
);
};

const getRFOCColumns = (row: TableOptions<McPkgRow>): JSX.Element => {
const commPkg = row.value as CommPkgRow;
return (
<Checkbox
disabled
checked={commPkg.operationHandoverStatus === 'ACCEPTED'}
/>
);
};

const getMcPkgs = (commPkgNo: string): void => {
setCurrentCommPkg(commPkgNo);
};
Expand Down Expand Up @@ -387,6 +406,15 @@ const CommPkgTable = forwardRef(
Header: 'Comm status',
accessor: 'status',
},
{
Header: 'Signed RFOC',
accessor: (
d: UseTableRowProps<McPkgRow>
): UseTableRowProps<McPkgRow> => d,
Cell: getRFOCColumns,
width: 200,
maxWidth: 500,
},
...(type == 'DP'
? [
{
Expand Down
Loading
Loading