Skip to content

Commit 43d24b3

Browse files
UI - Changes and added flag for logs
1 parent 62712a9 commit 43d24b3

File tree

7 files changed

+31
-159
lines changed

7 files changed

+31
-159
lines changed

infra/container_app/deploy_container_app_api_web.bicep

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ module containerAppWeb 'deploy_container_app.bicep' = {
146146
name: 'APP_MSAL_TOKEN_SCOPE'
147147
value: '<BACKEND_API_SCOPE>'
148148
}
149+
{
150+
name: 'APP_ISLOGS_ENABLED'
151+
value: 'false'
152+
}
149153
]
150154
minReplicas: minReplicaContainerWeb
151155
maxReplicas: maxReplicaContainerWeb

infra/main.json

Lines changed: 18 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.34.44.8038",
8-
"templateHash": "14103938519671400586"
8+
"templateHash": "17985360808056860425"
99
}
1010
},
1111
"parameters": {
@@ -21,7 +21,7 @@
2121
"type": "string",
2222
"defaultValue": "EastUs2",
2323
"metadata": {
24-
"description": "Location used for Cosmos DB, Container App deployment"
24+
"description": "Location used for Azure Cosmos DB, Azure Container App deployment"
2525
}
2626
},
2727
"contentUnderstandingLocation": {
@@ -35,7 +35,7 @@
3535
"azd": {
3636
"type": "location"
3737
},
38-
"description": "Location for the Content Understanding service deployment:"
38+
"description": "Location for the Azure AI Content Understanding service deployment:"
3939
},
4040
"minLength": 1
4141
},
@@ -362,7 +362,8 @@
362362
"solutionPrefix": "[format('cps-{0}', padLeft(take(variables('uniqueId'), 12), 12, '0'))]",
363363
"containerImageEndPoint": "cpscontainerreg.azurecr.io",
364364
"resourceGroupLocation": "[resourceGroup().location]",
365-
"abbrs": "[variables('$fxv#0')]"
365+
"abbrs": "[variables('$fxv#0')]",
366+
"useLocalBuildLower": "[toLower(parameters('useLocalBuild'))]"
366367
},
367368
"resources": [
368369
{
@@ -934,7 +935,7 @@
934935
"_generator": {
935936
"name": "bicep",
936937
"version": "0.34.44.8038",
937-
"templateHash": "13228064894943437182"
938+
"templateHash": "6622167858340258597"
938939
}
939940
},
940941
"parameters": {
@@ -1432,147 +1433,6 @@
14321433
"dependsOn": [
14331434
"[resourceId('Microsoft.MachineLearningServices/workspaces', variables('aiHubName'))]"
14341435
]
1435-
},
1436-
{
1437-
"type": "Microsoft.KeyVault/vaults/secrets",
1438-
"apiVersion": "2021-11-01-preview",
1439-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'TENANT-ID')]",
1440-
"properties": {
1441-
"value": "[subscription().tenantId]"
1442-
}
1443-
},
1444-
{
1445-
"type": "Microsoft.KeyVault/vaults/secrets",
1446-
"apiVersion": "2021-11-01-preview",
1447-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-OPENAI-KEY')]",
1448-
"properties": {
1449-
"value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2021-10-01').key1]"
1450-
},
1451-
"dependsOn": [
1452-
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]"
1453-
]
1454-
},
1455-
{
1456-
"type": "Microsoft.KeyVault/vaults/secrets",
1457-
"apiVersion": "2021-11-01-preview",
1458-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-OPEN-AI-DEPLOYMENT-MODEL')]",
1459-
"properties": {
1460-
"value": "[parameters('gptModelName')]"
1461-
}
1462-
},
1463-
{
1464-
"type": "Microsoft.KeyVault/vaults/secrets",
1465-
"apiVersion": "2021-11-01-preview",
1466-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-OPENAI-PREVIEW-API-VERSION')]",
1467-
"properties": {
1468-
"value": "[parameters('gptModelVersion')]"
1469-
}
1470-
},
1471-
{
1472-
"type": "Microsoft.KeyVault/vaults/secrets",
1473-
"apiVersion": "2021-11-01-preview",
1474-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-OPENAI-ENDPOINT')]",
1475-
"properties": {
1476-
"value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2021-10-01').endpoint]"
1477-
},
1478-
"dependsOn": [
1479-
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]"
1480-
]
1481-
},
1482-
{
1483-
"type": "Microsoft.KeyVault/vaults/secrets",
1484-
"apiVersion": "2021-11-01-preview",
1485-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-AI-PROJECT-CONN-STRING')]",
1486-
"properties": {
1487-
"value": "[format('{0};{1};{2};{3}', split(reference(resourceId('Microsoft.MachineLearningServices/workspaces', variables('aiProjectName')), '2024-01-01-preview').discoveryUrl, '/')[2], subscription().subscriptionId, resourceGroup().name, variables('aiProjectName'))]"
1488-
},
1489-
"dependsOn": [
1490-
"[resourceId('Microsoft.MachineLearningServices/workspaces', variables('aiProjectName'))]"
1491-
]
1492-
},
1493-
{
1494-
"type": "Microsoft.KeyVault/vaults/secrets",
1495-
"apiVersion": "2021-11-01-preview",
1496-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-OPENAI-CU-ENDPOINT')]",
1497-
"properties": {
1498-
"value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu')), '2021-10-01').endpoint]"
1499-
},
1500-
"dependsOn": [
1501-
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu'))]"
1502-
]
1503-
},
1504-
{
1505-
"type": "Microsoft.KeyVault/vaults/secrets",
1506-
"apiVersion": "2021-11-01-preview",
1507-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-OPENAI-CU-KEY')]",
1508-
"properties": {
1509-
"value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu')), '2021-10-01').key1]"
1510-
},
1511-
"dependsOn": [
1512-
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu'))]"
1513-
]
1514-
},
1515-
{
1516-
"type": "Microsoft.KeyVault/vaults/secrets",
1517-
"apiVersion": "2021-11-01-preview",
1518-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-OPENAI-CU-VERSION')]",
1519-
"properties": {
1520-
"value": "?api-version=2024-12-01-preview"
1521-
}
1522-
},
1523-
{
1524-
"type": "Microsoft.KeyVault/vaults/secrets",
1525-
"apiVersion": "2021-11-01-preview",
1526-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'COG-SERVICES-ENDPOINT')]",
1527-
"properties": {
1528-
"value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2021-10-01').endpoint]"
1529-
},
1530-
"dependsOn": [
1531-
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]"
1532-
]
1533-
},
1534-
{
1535-
"type": "Microsoft.KeyVault/vaults/secrets",
1536-
"apiVersion": "2021-11-01-preview",
1537-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'COG-SERVICES-KEY')]",
1538-
"properties": {
1539-
"value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2021-10-01').key1]"
1540-
},
1541-
"dependsOn": [
1542-
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]"
1543-
]
1544-
},
1545-
{
1546-
"type": "Microsoft.KeyVault/vaults/secrets",
1547-
"apiVersion": "2021-11-01-preview",
1548-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'COG-SERVICES-NAME')]",
1549-
"properties": {
1550-
"value": "[variables('aiServicesName')]"
1551-
}
1552-
},
1553-
{
1554-
"type": "Microsoft.KeyVault/vaults/secrets",
1555-
"apiVersion": "2021-11-01-preview",
1556-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-SUBSCRIPTION-ID')]",
1557-
"properties": {
1558-
"value": "[subscription().subscriptionId]"
1559-
}
1560-
},
1561-
{
1562-
"type": "Microsoft.KeyVault/vaults/secrets",
1563-
"apiVersion": "2021-11-01-preview",
1564-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-RESOURCE-GROUP')]",
1565-
"properties": {
1566-
"value": "[resourceGroup().name]"
1567-
}
1568-
},
1569-
{
1570-
"type": "Microsoft.KeyVault/vaults/secrets",
1571-
"apiVersion": "2021-11-01-preview",
1572-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-LOCATION')]",
1573-
"properties": {
1574-
"value": "[parameters('solutionLocation')]"
1575-
}
15761436
}
15771437
],
15781438
"outputs": {
@@ -1795,7 +1655,7 @@
17951655
"_generator": {
17961656
"name": "bicep",
17971657
"version": "0.34.44.8038",
1798-
"templateHash": "15388289119319771934"
1658+
"templateHash": "15815884747026956332"
17991659
}
18001660
},
18011661
"parameters": {
@@ -2546,6 +2406,10 @@
25462406
{
25472407
"name": "APP_MSAL_TOKEN_SCOPE",
25482408
"value": "<BACKEND_API_SCOPE>"
2409+
},
2410+
{
2411+
"name": "APP_ISLOGS_ENABLED",
2412+
"value": "false"
25492413
}
25502414
]
25512415
},
@@ -3269,7 +3133,7 @@
32693133
"location": {
32703134
"value": "[parameters('secondaryLocation')]"
32713135
},
3272-
"azureContainerRegistry": "[if(equals(parameters('useLocalBuild'), 'true'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'deploy_container_registry'), '2022-09-01').outputs.acrEndpoint.value), createObject('value', variables('containerImageEndPoint')))]",
3136+
"azureContainerRegistry": "[if(equals(variables('useLocalBuildLower'), 'true'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'deploy_container_registry'), '2022-09-01').outputs.acrEndpoint.value), createObject('value', variables('containerImageEndPoint')))]",
32733137
"appConfigEndPoint": {
32743138
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_app_config_service'), '2022-09-01').outputs.appConfigEndpoint.value]"
32753139
},
@@ -3304,7 +3168,7 @@
33043168
"value": "[parameters('maxReplicaContainerWeb')]"
33053169
},
33063170
"useLocalBuild": {
3307-
"value": "[parameters('useLocalBuild')]"
3171+
"value": "[variables('useLocalBuildLower')]"
33083172
}
33093173
},
33103174
"template": {
@@ -3314,7 +3178,7 @@
33143178
"_generator": {
33153179
"name": "bicep",
33163180
"version": "0.34.44.8038",
3317-
"templateHash": "15388289119319771934"
3181+
"templateHash": "15815884747026956332"
33183182
}
33193183
},
33203184
"parameters": {
@@ -4065,6 +3929,10 @@
40653929
{
40663930
"name": "APP_MSAL_TOKEN_SCOPE",
40673931
"value": "<BACKEND_API_SCOPE>"
3932+
},
3933+
{
3934+
"name": "APP_ISLOGS_ENABLED",
3935+
"value": "false"
40683936
}
40693937
]
40703938
},

src/ContentProcessorWeb/.dockerignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@
55
# https://docs.docker.com/engine/reference/builder/#dockerignore-file
66

77

8-
**/node_modules
9-
.env
8+
**/node_modules

src/ContentProcessorWeb/.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ REACT_APP_MSAL_POST_REDIRECT_URL = "/"
99

1010
REACT_APP_MSAL_AUTH_SCOPE = APP_MSAL_AUTH_SCOPE
1111

12-
REACT_APP_MSAL_TOKEN_SCOPE = APP_MSAL_TOKEN_SCOPE
12+
REACT_APP_MSAL_TOKEN_SCOPE = APP_MSAL_TOKEN_SCOPE
13+
REACT_APP_ISLOGS_ENABLED = APP_ISLOGS_ENABLED

src/ContentProcessorWeb/src/Hooks/useConsoleSuppression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useEffect } from "react";
33
// Custom hook to suppress console logs, warnings, and errors in localhost
44
const useConsoleSuppression = () => {
55
useEffect(() => {
6-
if (window.location.hostname !== "localhost") {
6+
if (window.location.hostname !== "localhost" && process.env.REACT_APP_ISLOGS_ENABLED?.toLocaleLowerCase() != "true" ) {
77
// Save the original console methods
88
const originalConsoleError = console.error;
99
const originalConsoleWarn = console.warn;

src/ContentProcessorWeb/src/Pages/DefaultPage/Components/ProcessQueueGrid/ProcessQueueGrid.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,13 @@ const ProcessQueueGrid: React.FC<GridComponentProps> = () => {
344344
</div>
345345

346346
<Confirmation
347-
title="Delete file"
348-
content="This action is permanent. Are you sure you want to delete the file?"
347+
title="Delete Confirmation"
348+
content="Are you sure you want to delete this file?"
349349
isDialogOpen={isDialogOpen}
350350
onDialogClose={toggleDialog}
351351
footerButtons={[
352352
{
353-
text: "Delete file",
353+
text: "Confirm",
354354
appearance: "primary",
355355
onClick: handleDelete,
356356
},

src/ContentProcessorWeb/src/store/slices/leftPanelSlice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,15 @@ const leftPanelSlice = createSlice({
191191
state.deleteFilesLoader = state.deleteFilesLoader.filter(id => id !== processId);
192192
}
193193
if(action.payload.status === 'Success')
194-
toast.success("Record deleted successfully!")
194+
toast.success("File deleted successfully.")
195195
else
196196
toast.error(action.payload.message)
197197
})
198198
.addCase(deleteProcessedFile.rejected, (state, action) => {
199199
const processId = action.meta.arg.processId;
200200
if (processId) {
201201
state.deleteFilesLoader = state.deleteFilesLoader.filter(id => id !== processId);
202-
toast.error("Something went wrong!")
202+
toast.error("Failed to delete the file. Please try again.")
203203
}
204204
});
205205
},

0 commit comments

Comments
 (0)