Skip to content

Commit

Permalink
Merge branch 'main' into bug/pre-flight-results-breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jstvz authored Jul 26, 2024
2 parents 4c5898f + 77959df commit 9b38a55
Show file tree
Hide file tree
Showing 26 changed files with 306 additions and 241 deletions.
3 changes: 2 additions & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def safe_key() -> str:
MIDDLEWARE = [
"metadeploy.logging_middleware.LoggingMiddleware",
"sfdo_template_helpers.admin.middleware.AdminRestrictMiddleware",
"allauth.account.middleware.AccountMiddleware",
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
Expand Down Expand Up @@ -460,7 +461,7 @@ def safe_key() -> str:
],
'DEFAULT_THROTTLE_RATES': {
'anon': '4/second',
'user': '4/second'
'user': '4/second',
}

}
Expand Down
16 changes: 8 additions & 8 deletions locales/en-gb/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@
"a_or_b": "<0></0> or <2></2>",
"anErrorOccurred": "An error occurred. Try the <1>home page</1>?",
"completed": "Completed",
"credentialsHoldTime": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minute or until your requested installation is complete.",
"credentialsHoldTime_plural": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime_0": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime_1": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minute or until your requested installation is complete.",
"credentialsHoldTime_2": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime_3": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime_4": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime_5": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime": "If no action is performed for <2>{{token_minutes}}</2> minute, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_plural": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_0": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_1": "If no action is performed for <2>{{token_minutes}}</2> minute, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_2": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_3": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_4": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_5": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"durationDays": "{{count}} day",
"durationDays_plural": "{{count}} days",
"durationDays_0": "{{count}} days",
Expand Down
20 changes: 10 additions & 10 deletions locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@
"Oh no! This installation encountered an error.": "Oh no! This installation encountered an error.",
"One Time Apex": "One Time Apex",
"Only I and Salesforce staff can view this installation job.": "Only I and Salesforce staff can view this installation job.",
"Oops! It looks like you don’t have permissions to run an installation on this org.": "Oops! It looks like you don’t have permissions to run an installation on this org.",
"Oops! It looks like you have been logged out or don’t have permissions to run an installation on this org.": "Oops! It looks like you have been logged out or don’t have permissions to run an installation on this org.",
"Optional": "Optional",
"Org:": "Org:",
"Other": "Other",
"Package": "Package",
"Please contact an Admin within your org or use the button below to log in with a different org.": "Please contact an Admin within your org or use the button below to log in with a different org.",
"Please log back in, contact an Admin, or use the button below to log in with a different org.": "Please log back in, contact an Admin, or use the button below to log in with a different org.",
"Potential Issues": "Potential Issues",
"Pre-Install Validation In Progress…": "Pre-Install Validation In Progress…",
"Pre-install validation completed successfully.": "Pre-install validation completed successfully.",
Expand Down Expand Up @@ -140,14 +140,14 @@
"a_or_b": "<0></0> or <2></2>",
"anErrorOccurred": "An error occurred. Try the <1>home page</1>?",
"completed": "Completed",
"credentialsHoldTime": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minute or until your requested installation is complete.",
"credentialsHoldTime_plural": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime_0": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime_1": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minute or until your requested installation is complete.",
"credentialsHoldTime_2": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime_3": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime_4": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime_5": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime": "If no action is performed for <2>{{token_minutes}}</2> minute, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_plural": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_0": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_1": "If no action is performed for <2>{{token_minutes}}</2> minute, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_2": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_3": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_4": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_5": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"durationDays": "{{count}} day",
"durationDays_plural": "{{count}} days",
"durationDays_0": "{{count}} days",
Expand Down
9 changes: 5 additions & 4 deletions locales_dev/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
"Not Connected to Salesforce": "Not Connected to Salesforce",
"Oh no! This installation encountered an error.": "Oh no! This installation encountered an error.",
"Only I and Salesforce staff can view this installation job.": "Only I and Salesforce staff can view this installation job.",
"Oops! It looks like you don’t have permissions to run an installation on this org.": "Oops! It looks like you don’t have permissions to run an installation on this org.",
"Oops! It looks like you have been logged out or don’t have permissions to run an installation on this org.": "Oops! It looks like you have been logged out or don’t have permissions to run an installation on this org.",
"Optional": "Optional",
"Org:": "Org:",
"Please contact an Admin within your org or use the button below to log in with a different org.": "Please contact an Admin within your org or use the button below to log in with a different org.",
"Please log back in, contact an Admin, or use the button below to log in with a different org.": "Please log back in, contact an Admin, or use the button below to log in with a different org.",
"Potential Issues": "Potential Issues",
"Pre-Install Validation In Progress…": "Pre-Install Validation In Progress…",
"Pre-install validation completed successfully.": "Pre-install validation completed successfully.",
Expand Down Expand Up @@ -99,6 +99,7 @@
"Share Link to Installation Job": "Share Link to Installation Job",
"Show Logs": "Show Logs",
"Skipped": "Skipped",
"Something went wrong. Please try again later.": "Something went wrong. Please try again later.",
"Start Pre-Install Validation": "Start Pre-Install Validation",
"Start Pre-Install Validation on Scratch Org": "Start Pre-Install Validation on Scratch Org",
"Steps": "Steps",
Expand Down Expand Up @@ -128,8 +129,8 @@
"a_or_b": "<0></0> or <2></2>",
"anErrorOccurred": "An error occurred. Try the <1>home page</1>?",
"completed": "Completed",
"credentialsHoldTime": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime_plural": "The credentials to your Salesforce org will only be held for <2>{{token_minutes}}</2> minutes or until your requested installation is complete.",
"credentialsHoldTime": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"credentialsHoldTime_plural": "If no action is performed for <2>{{token_minutes}}</2> minutes, you will be automatically logged out and will need to log in again.",
"durationDays": "durationDays",
"durationDays_plural": "durationDays",
"durationHours": "durationHours",
Expand Down
8 changes: 8 additions & 0 deletions metadeploy/adminapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class Meta:
class PlanTemplateViewSet(AdminAPIViewSet):
model_name = "PlanTemplate"
serializer_base = PlanTemplateSerializer
throttle_classes = []


class PlanFilter(filters.FilterSet):
Expand All @@ -150,22 +151,27 @@ class PlanViewSet(AdminAPIViewSet):
model_name = "Plan"
serializer_base = PlanSerializer
filterset_class = PlanFilter
throttle_classes = []


class PlanSlugViewSet(AdminAPIViewSet):
model_name = "PlanSlug"
throttle_classes = []


class VersionViewSet(AdminAPIViewSet):
model_name = "Version"
throttle_classes = []


class ProductCategoryViewSet(AdminAPIViewSet):
model_name = "ProductCategory"
throttle_classes = []


class AllowedListViewSet(AdminAPIViewSet):
model_name = "AllowedList"
throttle_classes = []


class AllowedListOrgSerializer(AdminAPISerializer):
Expand All @@ -175,6 +181,7 @@ class AllowedListOrgSerializer(AdminAPISerializer):
class AllowedListOrgViewSet(AdminAPIViewSet):
model_name = "AllowedListOrg"
serializer_base = AllowedListOrgSerializer
throttle_classes = []


class TranslationViewSet(viewsets.ViewSet):
Expand All @@ -194,6 +201,7 @@ class TranslationViewSet(viewsets.ViewSet):

permission_classes = [IsAPIUser]
model_name = "Translation"
throttle_classes = []

def partial_update(self, request, pk=None):
# Add or update a Translation record for each message
Expand Down
8 changes: 8 additions & 0 deletions metadeploy/adminapi/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ def test_list(self, admin_api_client, plan_factory):
"meta": {"page": {"total": 1}},
}

def test_throttle(self, admin_api_client):
url = "http://testserver/admin/rest/allowedlistorgs"
for i in range(0, 4):
response = admin_api_client.get(url)

response = admin_api_client.get(url)
assert response.status_code == 200

def test_retrieve(self, admin_api_client, step_factory):
step = step_factory()
plan = step.plan
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"heroku-postbuild": "yarn prod"
},
"dependencies": {
"@omnistudio/omniscript-lwc-compiler": "^244.4.0",
"@react-hook/window-scroll": "^1.3.0",
"@salesforce-ux/design-system": "^2.18.1",
"@salesforce/design-system-react": "^0.10.48",
Expand Down Expand Up @@ -154,6 +153,9 @@
"webpack-dev-server": "^4.9.3",
"webpack-merge": "^5.8.0"
},
"optionalDependencies": {
"@omnistudio/omniscript-lwc-compiler": "^244.4.0"
},
"resolutions": {
"@storybook/**/ansi-regex": "^5.0.1",
"@storybook/**/glob-parent": "^5.1.2",
Expand Down
Loading

0 comments on commit 9b38a55

Please sign in to comment.