Skip to content

Commit 7e6b681

Browse files
Merge pull request #3470 from KelvinTegelaar/dev
Dev to release
2 parents a7079bf + 079cf52 commit 7e6b681

File tree

69 files changed

+2579
-946
lines changed

Some content is hidden

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

69 files changed

+2579
-946
lines changed

.github/workflows/PR_Branch_Check.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: PR Branch Check
2+
3+
on:
4+
# Using pull_request_target instead of pull_request for secure handling of fork PRs
5+
pull_request_target:
6+
# Only run on these PR events
7+
types: [opened, synchronize, reopened]
8+
# Only check PRs targeting these branches
9+
branches:
10+
- main
11+
- master
12+
13+
permissions:
14+
pull-requests: write
15+
issues: write
16+
17+
jobs:
18+
check-branch:
19+
if: github.event.repository.fork == false
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Check and Comment on PR
23+
# Only process fork PRs with specific branch conditions
24+
# Must be a fork AND (source is main/master OR target is main/master)
25+
if: |
26+
github.event.pull_request.head.repo.fork == true &&
27+
((github.event.pull_request.head.ref == 'main' || github.event.pull_request.head.ref == 'master') ||
28+
(github.event.pull_request.base.ref == 'main' || github.event.pull_request.base.ref == 'master'))
29+
uses: actions/github-script@v7
30+
with:
31+
github-token: ${{ secrets.GITHUB_TOKEN }}
32+
script: |
33+
let message = '';
34+
35+
message += '🔄 If you are attempting to update your CIPP repo please follow the instructions at: https://docs.cipp.app/setup/self-hosting-guide/updating ';
36+
message += '\n\n';
37+
38+
// Check if PR is targeting main/master
39+
if (context.payload.pull_request.base.ref === 'main' || context.payload.pull_request.base.ref === 'master') {
40+
message += '⚠️ PRs cannot target the main branch directly. If you are attempting to contribute code please PR to the dev branch.\n\n';
41+
}
42+
43+
// Check if PR is from a fork's main/master branch
44+
if (context.payload.pull_request.head.repo.fork &&
45+
(context.payload.pull_request.head.ref === 'main' || context.payload.pull_request.head.ref === 'master')) {
46+
message += '⚠️ This PR cannot be merged because it originates from your fork\'s main/master branch. If you are attempting to contribute code please PR from your dev branch or another non-main/master branch.\n\n';
47+
}
48+
49+
message += '🔒 This PR will now be automatically closed due to the above violation(s).';
50+
51+
// Post the comment
52+
await github.rest.issues.createComment({
53+
...context.repo,
54+
issue_number: context.issue.number,
55+
body: message
56+
});
57+
58+
// Close the PR
59+
await github.rest.pulls.update({
60+
...context.repo,
61+
pull_number: context.issue.number,
62+
state: 'closed'
63+
});
3.63 KB
Loading

public/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "7.0.5"
2+
"version": "7.1.0"
33
}

src/components/CippCards/CippBannerListCard.jsx

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ import {
1313
} from "@mui/material";
1414
import ChevronDownIcon from "@heroicons/react/24/outline/ChevronDownIcon";
1515
import { CippPropertyListCard } from "./CippPropertyListCard";
16+
import { CippDataTable } from "../CippTable/CippDataTable";
1617

1718
export const CippBannerListCard = (props) => {
18-
const { items = [], isCollapsible = false, isFetching = false, ...other } = props;
19+
const { items = [], isCollapsible = false, isFetching = false, children, ...other } = props;
1920
const [expanded, setExpanded] = useState(null);
2021

2122
const handleExpand = useCallback((itemId) => {
@@ -113,17 +114,19 @@ export const CippBannerListCard = (props) => {
113114

114115
{/* Right Side: Status and Expand Icon */}
115116
<Stack alignItems="center" direction="row" spacing={2}>
116-
<Stack alignItems="center" direction="row" spacing={1}>
117-
<Box
118-
sx={{
119-
backgroundColor: statusColor,
120-
borderRadius: "50%",
121-
height: 8,
122-
width: 8,
123-
}}
124-
/>
125-
<Typography variant="body2">{item.statusText}</Typography>
126-
</Stack>
117+
{item?.statusText && (
118+
<Stack alignItems="center" direction="row" spacing={1}>
119+
<Box
120+
sx={{
121+
backgroundColor: statusColor,
122+
borderRadius: "50%",
123+
height: 8,
124+
width: 8,
125+
}}
126+
/>
127+
<Typography variant="body2">{item.statusText}</Typography>
128+
</Stack>
129+
)}
127130
{isCollapsible && (
128131
<IconButton onClick={() => handleExpand(item.id)}>
129132
<SvgIcon
@@ -142,11 +145,18 @@ export const CippBannerListCard = (props) => {
142145
{isCollapsible && (
143146
<Collapse in={isExpanded}>
144147
<Divider />
145-
<CippPropertyListCard
146-
propertyItems={item.propertyItems || []}
147-
layout="dual"
148-
isFetching={item.isFetching || false}
149-
/>
148+
<Stack spacing={1}>
149+
{item?.propertyItems?.length > 0 && (
150+
<CippPropertyListCard
151+
propertyItems={item.propertyItems || []}
152+
layout="dual"
153+
isFetching={item.isFetching || false}
154+
/>
155+
)}
156+
{item?.table && <CippDataTable {...item.table} />}
157+
{item?.children && <Box sx={{ pl: 3 }}>{item.children}</Box>}
158+
{item?.actionButton && <Box sx={{ pl: 3, pb: 2 }}>{item.actionButton}</Box>}
159+
</Stack>
150160
</Collapse>
151161
)}
152162
</li>
@@ -174,8 +184,12 @@ CippBannerListCard.propTypes = {
174184
subtext: PropTypes.string,
175185
statusColor: PropTypes.string,
176186
statusText: PropTypes.string,
187+
actionButton: PropTypes.element,
177188
propertyItems: PropTypes.array,
189+
table: PropTypes.object,
190+
actionButton: PropTypes.element,
178191
isFetching: PropTypes.bool,
192+
children: PropTypes.node,
179193
})
180194
).isRequired,
181195
isCollapsible: PropTypes.bool,

0 commit comments

Comments
 (0)