Skip to content

Commit

Permalink
fix: [Environment Picker]: Null check for container url and removed t…
Browse files Browse the repository at this point in the history
…enant ID from ARG query (#796)

* empty check added

* translation value change

* triggering translation

* [Auto] Adding updated localization files

Files changed:
M	src/Resources/Locales/cs.json
M	src/Resources/Locales/de.json
M	src/Resources/Locales/es.json
M	src/Resources/Locales/fr.json
M	src/Resources/Locales/hu.json
M	src/Resources/Locales/it.json
M	src/Resources/Locales/ja.json
M	src/Resources/Locales/ko.json
M	src/Resources/Locales/nl.json
M	src/Resources/Locales/pl.json
M	src/Resources/Locales/pt-pt.json
M	src/Resources/Locales/pt.json
M	src/Resources/Locales/ru.json
M	src/Resources/Locales/sv.json
M	src/Resources/Locales/tr.json
M	src/Resources/Locales/zh-Hans.json

* [Auto] Adding updated localization files

Files changed:
M	src/Resources/Locales/cs.json
M	src/Resources/Locales/de.json
M	src/Resources/Locales/es.json
M	src/Resources/Locales/fr.json
M	src/Resources/Locales/hu.json
M	src/Resources/Locales/it.json
M	src/Resources/Locales/ja.json
M	src/Resources/Locales/ko.json
M	src/Resources/Locales/nl.json
M	src/Resources/Locales/pl.json
M	src/Resources/Locales/pt-pt.json
M	src/Resources/Locales/pt.json
M	src/Resources/Locales/ru.json
M	src/Resources/Locales/sv.json
M	src/Resources/Locales/tr.json
M	src/Resources/Locales/zh-Hans.json

* reverting changes in translation

* trigger translation

* [Auto] Adding updated localization files

Files changed:
M	src/Resources/Locales/cs.json
M	src/Resources/Locales/de.json
M	src/Resources/Locales/es.json
M	src/Resources/Locales/fr.json
M	src/Resources/Locales/hu.json
M	src/Resources/Locales/it.json
M	src/Resources/Locales/ja.json
M	src/Resources/Locales/ko.json
M	src/Resources/Locales/nl.json
M	src/Resources/Locales/pl.json
M	src/Resources/Locales/pt-pt.json
M	src/Resources/Locales/pt.json
M	src/Resources/Locales/ru.json
M	src/Resources/Locales/sv.json
M	src/Resources/Locales/tr.json
M	src/Resources/Locales/zh-Hans.json

* [Auto] Adding updated localization files

Files changed:
M	src/Resources/Locales/cs.json
M	src/Resources/Locales/de.json
M	src/Resources/Locales/es.json
M	src/Resources/Locales/fr.json
M	src/Resources/Locales/hu.json
M	src/Resources/Locales/it.json
M	src/Resources/Locales/ja.json
M	src/Resources/Locales/ko.json
M	src/Resources/Locales/nl.json
M	src/Resources/Locales/pl.json
M	src/Resources/Locales/pt-pt.json
M	src/Resources/Locales/pt.json
M	src/Resources/Locales/ru.json
M	src/Resources/Locales/sv.json
M	src/Resources/Locales/tr.json
M	src/Resources/Locales/zh-Hans.json

* reverting changes for translation

* reattempt

* removed tenant id from ARG query

Co-authored-by: iremgokce <[email protected]>
  • Loading branch information
iremgokce and iremgokce authored Dec 13, 2022
1 parent fa424bf commit ca108bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/Adapters/AzureManagementAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ export default class AzureManagementAdapter implements IAzureManagementAdapter {
},
data: isResourceGraphCall(params)
? {
query: `Resources | where type =~ '${
params.type
}' | where tenantId == '${this.tenantId}'${
query: `Resources | where type =~ '${params.type}'${
params.query ? ' | where ' + params.query : ''
} | join kind=leftouter (ResourceContainers | where type=='microsoft.resources/subscriptions' | project subscriptionName=name, subscriptionId) on subscriptionId | project id, name, location, type, properties, tenantId, subscriptionId, subscriptionName, resourceGroup${
params.limit ? ' | limit ' + params.limit : ''
Expand Down
15 changes: 10 additions & 5 deletions src/Components/EnvironmentPicker/EnvironmentPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ const EnvironmentPicker = ({
type: EnvironmentPickerActionType.RESET_ITEMS_ON_DISMISS,
payload: {
selectedEnvironmentUrl: adtInstanceUrl,
selectedContainerUrl: storage.containerUrl,
selectedContainerUrl: storage?.containerUrl,
storageAccountToContainersMappings:
defaultStorageAccountToContainersMappingsRef.current,
resetContainersCallback: () => {
Expand All @@ -380,7 +380,12 @@ const EnvironmentPicker = ({
if (onDismiss) {
onDismiss();
}
}, [toggleIsDialogHidden, onDismiss, adtInstanceUrl, storage.containerUrl]);
}, [
toggleIsDialogHidden,
onDismiss,
adtInstanceUrl,
storage?.containerUrl
]);

const adtInstanceDisplayText = useMemo(() => {
const displayText = getNameOfResource(
Expand All @@ -392,11 +397,11 @@ const EnvironmentPicker = ({

const containerDisplayText = useMemo(() => {
const displayText = getContainerDisplayText(
getContainerNameFromUrl(storage.containerUrl),
getStorageAccountUrlFromContainerUrl(storage.containerUrl)
getContainerNameFromUrl(storage?.containerUrl),
getStorageAccountUrlFromContainerUrl(storage?.containerUrl)
);
return displayText || t('environmentPicker.noContainer');
}, [t, storage.containerUrl]);
}, [t, storage?.containerUrl]);

const checkPermissionsForResource = async (
// check permissions for the selected resource and update error messages accordingly
Expand Down

0 comments on commit ca108bd

Please sign in to comment.