Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add refresh metadata option to record view modal #1220

Merged
merged 2 commits into from
Mar 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function useDescribeMetadata(
}

if (cache) {
setLastRefreshed(`Last updated ${formatRelative(cache.age, new Date())}`);
setLastRefreshed(`Last updated from Salesforce ${formatRelative(cache.age, new Date())}`);
}
setOrgInformation({
organizationNamespace: data.organizationNamespace,
Expand Down
2 changes: 1 addition & 1 deletion libs/features/deploy/src/utils/useUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function useUsers(

if (isMounted.current) {
if (cache) {
setLastRefreshed(`Last updated ${formatRelative(cache.age, new Date())}`);
setLastRefreshed(`Last updated from Salesforce ${formatRelative(cache.age, new Date())}`);
}
dispatch({ type: 'SUCCESS', payload: getListItemFromQueryResults(selectedOrg, data.queryResults.records, sortCurrentUserFirst) });
}
Expand Down
9 changes: 1 addition & 8 deletions libs/features/formula-evaluator/src/FormulaEvaluator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,7 @@ export const FormulaEvaluator: FunctionComponent<FormulaEvaluatorProps> = () =>
<ViewDocsLink textReset path="/deploy/formula-evaluator" />
</Grid>
}
actions={
<NotSeeingRecentMetadataPopover
org={selectedOrg}
loading={refreshLoading}
serverUrl={serverUrl}
onReload={handleRefreshMetadata}
/>
}
actions={<NotSeeingRecentMetadataPopover org={selectedOrg} loading={refreshLoading} onReload={handleRefreshMetadata} />}
>
<Grid vertical>
<SobjectCombobox
Expand Down

This file was deleted.

33 changes: 30 additions & 3 deletions libs/features/load-records/src/steps/FieldMapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@ import {
Maybe,
SalesforceOrgUi,
} from '@jetstream/types';
import { Alert, ButtonGroupContainer, DropDown, Grid, GridCol, Icon, SearchInput, Tooltip } from '@jetstream/ui';
import {
Alert,
ButtonGroupContainer,
DropDown,
Grid,
GridCol,
Icon,
NotSeeingRecentMetadataPopover,
SearchInput,
Tooltip,
} from '@jetstream/ui';
import {
autoMapFields,
checkFieldsForMappingError,
Expand All @@ -28,7 +38,6 @@ import classNames from 'classnames';
import { memo, useEffect, useRef, useState } from 'react';
import LoadRecordsFieldMappingRow from '../components/LoadRecordsFieldMappingRow';
import LoadRecordsFieldMappingStaticRow from '../components/LoadRecordsFieldMappingStaticRow';
import LoadRecordsRefreshCachePopover from '../components/LoadRecordsRefreshCachePopover';
import { LoadMappingPopover } from '../components/load-mapping-storage/LoadMappingPopover';
import SaveMappingPopover from '../components/load-mapping-storage/SaveMappingPopover';

Expand Down Expand Up @@ -264,7 +273,25 @@ export const LoadRecordsFieldMapping = memo<LoadRecordsFieldMappingProps>(
<LoadMappingPopover sobject={sobject} csvFields={csvFields} objectFields={objectFields} onLoadMapping={handleLoadMapping} />
</ButtonGroupContainer>
<SearchInput id="field-filter" className="slds-size_1-of-2" placeholder="Filter fields from file" onChange={setSearchTerm} />
<LoadRecordsRefreshCachePopover org={org} sobject={sobject} loading={refreshLoading} onReload={handleCacheRefresh} />
<NotSeeingRecentMetadataPopover
popoverProps={{ omitPortal: true, placement: 'top-start' }}
header="Missing Fields?"
label="Not seeing all fields?"
refreshButtonLabel="Reload Fields"
org={org}
viewInSalesforceSetup={{
label: 'View object in Salesforce setup',
title: 'View object in Salesforce setup',
link: `/lightning/setup/ObjectManager/${sobject}/Details/view`,
}}
loading={refreshLoading}
disabled={refreshLoading}
messages={[
'If there are fields that are not showing up in the list for mapping, make sure the field is not read-only and that your user has access to the field.',
'If the missing fields were created recently or if permissions were updated recently then you can reload the fields.',
]}
onReload={handleCacheRefresh}
/>
</Grid>
<table className="slds-table slds-table_cell-buffer slds-table_bordered">
<thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ export const BulkUpdateFromQueryModal: FunctionComponent<BulkUpdateFromQueryModa
<NotSeeingRecentMetadataPopover
org={selectedOrg}
loading={refreshLoading}
serverUrl={serverUrl}
disabled={deployInProgress}
onReload={handleRefreshMetadata}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import React, { FunctionComponent } from 'react';
import { FunctionComponent } from 'react';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface QueryWalkthroughStep1Props {}
Expand All @@ -8,7 +8,7 @@ export const QueryWalkthroughStep1: FunctionComponent<QueryWalkthroughStep1Props
return (
<div>
<p className="slds-text-heading_small">
This tool helps you easily create powerful queries (searches) to fetch records from your Salesforce org.
Jetstream helps you easily create powerful queries (searches) to fetch records from your Salesforce org.
</p>
<p className="slds-m-top_small">The main flow is simple:</p>
<ol className="slds-list_ordered slds-m-vertical_small">
Expand All @@ -18,6 +18,12 @@ export const QueryWalkthroughStep1: FunctionComponent<QueryWalkthroughStep1Props
<li>Click the 'Execute' button.</li>
</ol>
<p>From the Query Results page you can then delete or download any of the records that were returned.</p>
<p className="slds-m-top_small">
<strong>
Tip: If you are not seeing objects or fields, make sure you have permission to view them. Click the "refresh" icon above the
objects to clear the cache.
</strong>
</p>
</div>
);
};
Expand Down
Loading