Skip to content

Commit 7e4f0c1

Browse files
authored
Merge pull request #50 from KelvinTegelaar/main
[pull] main from KelvinTegelaar:main
2 parents 63418c6 + 947e52e commit 7e4f0c1

File tree

16 files changed

+123
-38
lines changed

16 files changed

+123
-38
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CIPP Frontend Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
if: github.event.repository.fork == false
15+
name: Build and Upload CIPP Frontend
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
# Checkout the repository
20+
- name: Checkout Code
21+
uses: actions/checkout@v3
22+
23+
# Set up Node.js
24+
- name: Set up Node.js
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: '20.18.1'
28+
29+
# Install dependencies
30+
- name: Install Dependencies
31+
run: yarn install
32+
33+
# Build the project
34+
- name: Build Project
35+
run: npm run build
36+
37+
# Create ZIP File in a New Source Directory
38+
- name: Prepare and Zip Build Files
39+
run: |
40+
mkdir -p build
41+
zip -r build/latest.zip out
42+
43+
# Upload to Azure Blob Storage
44+
- name: Azure Blob Upload
45+
uses: LanceMcCarthy/[email protected]
46+
with:
47+
connection_string: ${{ secrets.AZURE_CONNECTION_STRING }}
48+
container_name: cipp
49+
source_folder: build/
50+
destination_folder: /
51+
delete_if_exists: true
52+

Tools/Start-CippDevEmulatorsWithKitty.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ if ($Process -eq 'y') {
1515
kitty @new-window --new-tab --tab-title `"Azurite`" --cwd $Path -- azurite ;
1616
kitty @new-window --new-tab --tab-title `"FunctionApp`" --cwd (Join-Path $Path `"CIPP-API`") -- func start;
1717
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- yarn run dev ;
18-
kitty @new-window --new-tab --tab-title `"SWA`" --cwd (Join-Path $Path `"CIPP`") -- npm run start-swa;
18+
kitty @new-window --new-tab --tab-title `"SWA`" --cwd (Join-Path $Path `"CIPP`") -- yarn run start-swa;
1919
kitty @new-window --new-tab --tab-title `"CIPP-API-Processor`" --cwd (Join-Path $Path `"CIPP-API-Processor`") -- func start --port 7072"
2020

2121
} else {
2222
kitty --detach --title 'CIPP' -o allow_remote_control=yes -- pwsh -c "
2323
kitty @new-window --new-tab --tab-title `"Azurite`" --cwd $Path -- azurite ;
2424
kitty @new-window --new-tab --tab-title `"FunctionApp`" --cwd (Join-Path $Path `"CIPP-API`") -- func start;
2525
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- yarn run dev ;
26-
kitty @new-window --new-tab --tab-title `"SWA`" --cwd (Join-Path $Path `"CIPP`") -- npm run start-swa"
26+
kitty @new-window --new-tab --tab-title `"SWA`" --cwd (Join-Path $Path `"CIPP`") -- yarn run start-swa"
2727
}

deployment/AzureDeploymentTemplate.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,19 @@
241241
"functionAppResourceId": "[resourceId('Microsoft.Web/sites/', variables('funcAppName'))]",
242242
"functionAppRegion": "[resourceGroup().location]"
243243
}
244+
},
245+
{
246+
"type": "Microsoft.Authorization/roleAssignments",
247+
"apiVersion": "2022-04-01",
248+
"name": "[guid(resourceGroup().id, variables('funcAppName'), 'Contributor')]",
249+
"dependsOn": [
250+
"[resourceId('Microsoft.Web/sites', variables('funcAppName'))]"
251+
],
252+
"properties": {
253+
"roleDefinitionId": "[concat(subscription().id, '/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c')]",
254+
"principalId": "[reference(resourceId('Microsoft.Web/sites', variables('funcAppName')),'2019-08-01', 'full').identity.principalId]",
255+
"scope": "[resourceGroup().id]"
256+
}
244257
}
245258
],
246259
"outputs": {}

deployment/AzureDeploymentTemplate_regionoptions.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,19 @@
241241
"functionAppResourceId": "[resourceId('Microsoft.Web/sites/', variables('funcAppName'))]",
242242
"functionAppRegion": "[resourceGroup().location]"
243243
}
244+
},
245+
{
246+
"type": "Microsoft.Authorization/roleAssignments",
247+
"apiVersion": "2022-04-01",
248+
"name": "[guid(resourceGroup().id, variables('funcAppName'), 'Contributor')]",
249+
"dependsOn": [
250+
"[resourceId('Microsoft.Web/sites', variables('funcAppName'))]"
251+
],
252+
"properties": {
253+
"roleDefinitionId": "[concat(subscription().id, '/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c')]",
254+
"principalId": "[reference(resourceId('Microsoft.Web/sites', variables('funcAppName')),'2019-08-01', 'full').identity.principalId]",
255+
"scope": "[resourceGroup().id]"
256+
}
244257
}
245258
],
246259
"outputs": {}

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.2.1"
2+
"version": "7.2.2"
33
}

src/components/CippCards/CippPropertyListCard.jsx

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -152,22 +152,18 @@ export const CippPropertyListCard = (props) => {
152152
key={`${item.label}-${index}-ActionList-OffCanvas`}
153153
icon={<SvgIcon fontSize="small">{item.icon}</SvgIcon>}
154154
label={item.label}
155-
onClick={
156-
item.link
157-
? () => window.open(item.link, "_blank")
158-
: () => {
159-
setActionData({
160-
data: data,
161-
action: item,
162-
ready: true,
163-
});
164-
if (item?.noConfirm) {
165-
item.customFunction(item, data, {});
166-
} else {
167-
createDialog.handleOpen();
168-
}
169-
}
170-
}
155+
onClick={() => {
156+
setActionData({
157+
data: data,
158+
action: item,
159+
ready: true,
160+
});
161+
if (item?.noConfirm) {
162+
item.customFunction(item, data, {});
163+
} else {
164+
createDialog.handleOpen();
165+
}
166+
}}
171167
disabled={handleActionDisabled(data, item)}
172168
/>
173169
))}

src/components/CippComponents/CippAutocomplete.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const MemoTextField = React.memo(function MemoTextField({
2727
{...otherParams}
2828
label={label}
2929
placeholder={placeholder}
30-
variant="outlined"
3130
{...otherProps}
3231
slotProps={{
3332
inputLabel: {
@@ -275,7 +274,13 @@ export const CippAutoComplete = (props) => {
275274
sx={sx}
276275
renderInput={(params) => (
277276
<Stack direction="row" spacing={1}>
278-
<MemoTextField params={params} label={label} placeholder={placeholder} required={required} {...other} />
277+
<MemoTextField
278+
params={params}
279+
label={label}
280+
placeholder={placeholder}
281+
required={required}
282+
{...other}
283+
/>
279284
{api?.url && api?.showRefresh && (
280285
<IconButton
281286
size="small"

src/components/CippFormPages/CippJSONView.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,17 @@ function CippJsonView({
238238
<CippCodeBlock type="editor" code={JSON.stringify(cleanObject(object), null, 2)} />
239239
) : (
240240
<Grid container spacing={2}>
241-
{drilldownData.slice(0, 4).map((data, index) => (
241+
{drilldownData?.map((data, index) => (
242242
<Grid
243243
item
244244
xs={12}
245245
sm={type === "intune" ? 12 : 3}
246246
key={index}
247247
sx={{
248-
borderRight: index < 3 && type !== "intune" ? "1px solid lightgrey" : "none",
248+
//give a top border if the item is > 4, and add spacing between the top and bottom items
249+
paddingTop: index === 0 ? 0 : 2,
250+
borderTop: index >= 4 && type !== "intune" ? "1px solid lightgrey" : "none",
251+
borderRight: index < drilldownData.length - 1 ? "1px solid lightgrey" : "none",
249252
overflowWrap: "anywhere",
250253
whiteSpace: "pre-line",
251254
paddingRight: 2,

src/components/CippTable/CIPPTableToptoolbar.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ export const CIPPTableToptoolbar = ({
6464
const pageName = router.pathname.split("/").slice(1).join("/");
6565
const currentTenant = useSettings()?.currentTenant;
6666

67+
useEffect(() => {
68+
//if usedData changes, deselect all rows
69+
table.toggleAllRowsSelected(false);
70+
}, [usedData]);
6771
//if the currentTenant Switches, remove Graph filters
6872
useEffect(() => {
6973
if (currentTenant) {

src/components/CippTable/CippDataTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export const CippDataTable = (props) => {
274274
refreshFunction={refreshFunction}
275275
setColumnVisibility={setColumnVisibility}
276276
filters={filters}
277-
queryKeys={queryKey}
277+
queryKeys={queryKey ? queryKey : title}
278278
graphFilterData={graphFilterData}
279279
setGraphFilterData={setGraphFilterData}
280280
setConfiguredSimpleColumns={setConfiguredSimpleColumns}

0 commit comments

Comments
 (0)