From b3a1018451a5033799f459a13a5261db041ff636 Mon Sep 17 00:00:00 2001 From: lakshmi2506 Date: Fri, 2 Feb 2024 08:06:41 +0000 Subject: [PATCH] lint-fix --- docs/api/schema.yml | 95 ++++++++++++++++++--------------- metecho/api/models.py | 2 +- metecho/api/tests/models.py | 10 ++++ src/js/components/tour/play.tsx | 2 + src/stories/fixtures.ts | 4 ++ 5 files changed, 70 insertions(+), 43 deletions(-) diff --git a/docs/api/schema.yml b/docs/api/schema.yml index 86aaec41d..0ce055f3d 100644 --- a/docs/api/schema.yml +++ b/docs/api/schema.yml @@ -980,6 +980,42 @@ paths: schema: $ref: '#/components/schemas/ScratchOrg' description: '' + /api/scratch-orgs/{id}/listmetadata/: + post: + operationId: scratch_orgs_listmetadata_create + description: Manage Salesforce scratch orgs. + parameters: + - in: path + name: id + schema: + type: string + format: HashID + description: A unique integer value identifying this scratch org. + required: true + tags: + - scratch-orgs + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ListMetadataRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/ListMetadataRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/ListMetadataRequest' + required: true + security: + - tokenAuth: [] + - cookieAuth: [] + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/ScratchOrg' + description: '' /api/scratch-orgs/{id}/log/: get: operationId: scratch_orgs_log_retrieve @@ -1072,32 +1108,6 @@ paths: schema: $ref: '#/components/schemas/ScratchOrg' description: '' - - /api/scratch-orgs/{id}/listmetadata/: - post: - operationId: scratch_orgs_listmetadata - description: Queue a job that retrieves the components for a given non source trackable metadata type. - parameters: - - in: path - name: id - schema: - type: string - format: HashID - description: A unique integer value identifying this scratch org. - required: true - tags: - - scratch-orgs - security: - - tokenAuth: [] - - cookieAuth: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ListMetadataRequest' - description: '' - /api/tasks/: get: operationId: tasks_list @@ -1697,13 +1707,6 @@ components: required: - commit_message - yaml_path - ListMetadataRequest: - type: object - properties: - desired_type: string - minLength: 1 - required: - - desired_type CommitRequest: type: object properties: @@ -2114,6 +2117,14 @@ components: state: type: object additionalProperties: {} + ListMetadataRequest: + type: object + properties: + desired_type: + type: string + minLength: 1 + required: + - desired_type MinimalUser: type: object properties: @@ -2543,11 +2554,6 @@ components: type: string format: HashID readOnly: true - non_source_changes: - type: object - additionalProperties: {} - readOnly: true - nullable: true description: type: string description_rendered: @@ -2594,10 +2600,6 @@ components: has_unsaved_changes: type: boolean readOnly: true - has_non_source_changes: - type: boolean - readOnly: true - nullable: true ignored_changes: type: object additionalProperties: {} @@ -2660,6 +2662,13 @@ components: is_omnistudio_installed: type: boolean readOnly: true + non_source_changes: + type: object + additionalProperties: {} + readOnly: true + has_non_source_changes: + type: boolean + readOnly: true required: - currently_parsing_datasets - currently_reassigning_user @@ -2673,6 +2682,7 @@ components: - expires_at - has_been_visited - has_ignored_changes + - has_non_source_changes - has_unsaved_changes - id - ignored_changes @@ -2684,6 +2694,7 @@ components: - latest_commit - latest_commit_at - latest_commit_url + - non_source_changes - org_config_name - org_type - owner diff --git a/metecho/api/models.py b/metecho/api/models.py index e16a0ca67..e76304cab 100644 --- a/metecho/api/models.py +++ b/metecho/api/models.py @@ -1475,7 +1475,7 @@ def queue_get_unsaved_changes(self, *, force_get=False, originating_user_id): get_unsaved_changes_job.delay(self, originating_user_id=originating_user_id) - def queue_get_nonsource_components(self, *, originating_user_id, desired_type: str): + def queue_get_nonsource_components(self, *, originating_user_id, desired_type): from .jobs import get_nonsource_components_job self.currently_refreshing_changes = True diff --git a/metecho/api/tests/models.py b/metecho/api/tests/models.py index bd8e71c62..a25a038e4 100644 --- a/metecho/api/tests/models.py +++ b/metecho/api/tests/models.py @@ -859,6 +859,16 @@ def test_get_unsaved_changes(self, scratch_org_factory): assert get_unsaved_changes_job.delay.called + def test_get_nonsource_components(self,scratch_org_factory): + with ExitStack() as stack: + get_non_source_components_job= stack.enter_context( + patch("metecho.api.jobs.get_nonsource_components_job") + ) + scratch_org = scratch_org_factory() + scratch_org.queue_get_nonsource_components(originating_user_id=None,desired_type='') + + assert get_non_source_components_job.delay.called + def test_get_unsaved_changes__bail_early(self, scratch_org_factory): with ExitStack() as stack: get_unsaved_changes_job = stack.enter_context( diff --git a/src/js/components/tour/play.tsx b/src/js/components/tour/play.tsx index 1d32f4d32..ae654384b 100644 --- a/src/js/components/tour/play.tsx +++ b/src/js/components/tour/play.tsx @@ -63,6 +63,8 @@ export const getDemoOrg = ({ has_been_visited: true, valid_target_directories: {}, currently_parsing_datasets: false, + has_non_source_changes: false, + non_source_changes: {} }; }; diff --git a/src/stories/fixtures.ts b/src/stories/fixtures.ts index 3f7562dca..f891320a2 100644 --- a/src/stories/fixtures.ts +++ b/src/stories/fixtures.ts @@ -813,6 +813,8 @@ export const sampleDevOrg = { last_checked_unsaved_changes_at: null, valid_target_directories: {}, currently_parsing_datasets: false, + has_non_source_changes: false, + non_source_changes: {}, }; export const sampleScratchOrg = { @@ -852,6 +854,8 @@ export const sampleScratchOrg = { last_checked_unsaved_changes_at: null, valid_target_directories: {}, currently_parsing_datasets: false, + has_non_source_changes: false, + non_source_changes: {}, }; export const sampleIssue1 = {