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

refactor!: remove deprecated const #573

Merged
merged 1 commit into from
Jan 29, 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
17 changes: 7 additions & 10 deletions api-extractor/carbonio-shell-ui.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ type AccountRightTargetEmail = {
addr: string;
};

// @public @deprecated (undocumented)
export const ACCOUNTS_APP_ID = "accounts";

// @public (undocumented)
export type AccountSettings = {
attrs: AccountSettingsAttrs;
Expand Down Expand Up @@ -1035,7 +1032,7 @@ export const report: ReturnType<typeof report_2>;
// @public (undocumented)
const report_2: (appId: string) => (error: Event_2, hint?: EventHint) => string;

// @public (undocumented)
// @public @deprecated (undocumented)
export const RESULT_LABEL_TYPE: {
readonly normal: "normal";
readonly warning: "warning";
Expand Down Expand Up @@ -1510,12 +1507,12 @@ interface ZimletProp {
// lib/types/account/index.d.ts:145:9 - (ae-forgotten-export) The symbol "AccountRightName" needs to be exported by the entry point lib.d.ts
// lib/types/account/index.d.ts:146:9 - (ae-forgotten-export) The symbol "AccountRightTarget" needs to be exported by the entry point lib.d.ts
// lib/types/apps/index.d.ts:60:5 - (ae-forgotten-export) The symbol "PanelMode" needs to be exported by the entry point lib.d.ts
// lib/types/misc/index.d.ts:73:9 - (ae-forgotten-export) The symbol "SoapPolicy" needs to be exported by the entry point lib.d.ts
// lib/types/misc/index.d.ts:92:5 - (ae-forgotten-export) The symbol "FolderView" needs to be exported by the entry point lib.d.ts
// lib/types/misc/index.d.ts:108:5 - (ae-forgotten-export) The symbol "Meta" needs to be exported by the entry point lib.d.ts
// lib/types/misc/index.d.ts:112:5 - (ae-forgotten-export) The symbol "SoapRetentionPolicy" needs to be exported by the entry point lib.d.ts
// lib/types/misc/index.d.ts:126:5 - (ae-forgotten-export) The symbol "SortBy" needs to be exported by the entry point lib.d.ts
// lib/types/network/index.d.ts:107:5 - (ae-forgotten-export) The symbol "AccountACEInfo" needs to be exported by the entry point lib.d.ts
// lib/types/misc/index.d.ts:45:9 - (ae-forgotten-export) The symbol "SoapPolicy" needs to be exported by the entry point lib.d.ts
// lib/types/misc/index.d.ts:64:5 - (ae-forgotten-export) The symbol "FolderView" needs to be exported by the entry point lib.d.ts
// lib/types/misc/index.d.ts:80:5 - (ae-forgotten-export) The symbol "Meta" needs to be exported by the entry point lib.d.ts
// lib/types/misc/index.d.ts:84:5 - (ae-forgotten-export) The symbol "SoapRetentionPolicy" needs to be exported by the entry point lib.d.ts
// lib/types/misc/index.d.ts:98:5 - (ae-forgotten-export) The symbol "SortBy" needs to be exported by the entry point lib.d.ts
// lib/types/network/index.d.ts:79:5 - (ae-forgotten-export) The symbol "AccountACEInfo" needs to be exported by the entry point lib.d.ts
// lib/types/network/soap.d.ts:11:5 - (ae-forgotten-export) The symbol "NameSpace" needs to be exported by the entry point lib.d.ts
// lib/types/network/soap.d.ts:69:5 - (ae-forgotten-export) The symbol "SoapSearchFolder" needs to be exported by the entry point lib.d.ts
// lib/types/network/soap.d.ts:91:9 - (ae-forgotten-export) The symbol "Tag" needs to be exported by the entry point lib.d.ts
Expand Down
7 changes: 3 additions & 4 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import type { DynamicThemeFix } from 'darkreader';

export const SHELL_APP_ID = 'carbonio-shell-ui';
export const SETTINGS_APP_ID = 'settings';
/**
* @deprecated This constant is not used and will be deleted in next releases
*/
export const ACCOUNTS_APP_ID = 'accounts';

export const ACTION_TYPES = {
/** @deprecated this action does not belong to shell, and therefore it will be removed in next releases */
Expand Down Expand Up @@ -91,6 +87,9 @@ export const LOGIN_V3_CONFIG_PATH = '/zx/login/v3/config';
export const DARK_READER_PROP_KEY = 'zappDarkreaderMode';
export const SENTRY_SHELL_DSN = 'https://0ce2448c05b94f0182c47ae52c7ff52c@feedback.zextras.tools/6';

/**
* @deprecated this const does not belong to shell
*/
export const RESULT_LABEL_TYPE = {
normal: 'normal',
warning: 'warning',
Expand Down
2 changes: 0 additions & 2 deletions src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ export declare const addBoard: AppDependantExports['addBoard'];
*/
export declare const getBridgedFunctions: AppDependantExports['getBridgedFunctions'];

export * from './boot/app/app-direct-exports';

export type {
PrimaryBarComponentProps,
SecondaryBarComponentProps,
Expand Down
11 changes: 5 additions & 6 deletions src/store/app/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,25 @@ import type { AppRoute, CarbonioModule } from '../../types/apps';

export const getAppHook = (appId: string) => (): CarbonioModule =>
useAppStore((s) => s.apps[appId]);

export const useApps = (): Record<string, CarbonioModule> => useAppStore((s) => s.apps);

export const useAppList = (): Array<CarbonioModule> => {
const apps = useApps();
return useMemo(() => sortBy(apps, (a) => a.priority), [apps]);
};
export const getAppList = (): Array<CarbonioModule> =>
sortBy(useAppStore.getState().apps, (a) => a.priority);

export const getApp = (appId: string) => (): CarbonioModule | undefined =>
useAppStore.getState().apps[appId];
export const getApps = (): Record<string, CarbonioModule> => useAppStore.getState().apps;

export const getAppContextHook =
(appId: string) =>
<T>(): T =>
useAppStore((s) => s.appContexts[appId] as T);

export const getAppContext = (appId: string) => (): unknown =>
useAppStore.getState().appContexts[appId];
export const getShell = (): CarbonioModule => useAppStore.getState().shell;

export const getRoutes = (): Record<string, AppRoute> => useAppStore.getState().routes;

export const useRoutes = (): Record<string, AppRoute> => useAppStore((s) => s.routes);
export const getRoute = (id: string): AppRoute => useAppStore.getState().routes[id];
export const useRoute = (id: string): AppRoute => useAppStore((s) => s.routes[id]);
29 changes: 0 additions & 29 deletions src/types/misc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,6 @@ export type AccountProps = {
identityId?: string;
};

/** @deprecated */
export type IdentityProps = {
id: string;
/**
* Type of the identity
*/
flgType: 'primary' | 'persona' | 'IMAP' | 'POP';
/**
* Localized description of the type of identity
*/
type: string;
/**
* is a number while you are creating a new one
*/
identityId: string | number;
fromAddress?: string;
identityName?: string;
fromDisplay?: string;
recoveryAccount?: string;
replyToDisplay?: string;
replyToAddress?: string;
replyToEnabled?: string;
saveToSent?: string;
sentMailFolder?: string;
whenInFoldersEnabled?: string;
whenSentToEnabled?: string;
whenSentToAddresses?: string;
};

// Custom metadata
type Meta<T extends Record<string, unknown>> = {
// Section. Normally present. If absent this indicates that CustomMetadata info is present but there are no sections to report on.
Expand Down
30 changes: 0 additions & 30 deletions src/types/network/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,36 +80,6 @@ export type PermissionsMods = {
new: AccountACEInfo;
};
};
// TODO remove
/**
* @deprecated
*/
export type CreateIdentityProps = {
requestId: number;
/** name of the identity */
zimbraPrefIdentityName: string | undefined;
/** personal part of email address put in from header */
zimbraPrefFromDisplay: string | undefined;
/** email address to put in from header. Deprecated on data source as of bug 67068. */
zimbraPrefFromAddress: string | undefined;
/** Type of the email address from header. (sendAs or sendOnBehalfOf) */
zimbraPrefFromAddressType: 'sendAs' | 'sendOnBehalfOf';
/** TRUE if we should set a reply-to header */
// TODO: update to boolean?
zimbraPrefReplyToEnabled: 'TRUE' | 'FALSE' | undefined;
/** personal part of email address put in reply-to header */
zimbraPrefReplyToDisplay: string | undefined;
/** address to put in reply-to header */
zimbraPrefReplyToAddress: string | undefined;
/** default mail signature for account/identity/dataSource */
zimbraPrefDefaultSignatureId: string | undefined;
/** forward/reply signature id for account/identity/dataSource */
zimbraPrefForwardReplySignatureId: string | undefined;
/** TRUE if we should look at zimbraPrefWhenSentToAddresses (deprecatedSince 5.0 in account) */
zimbraPrefWhenSentToEnabled: string | undefined;
/** TRUE if we should look at zimbraPrefWhenInFolderIds (deprecatedSince 5.0 in account) */
zimbraPrefWhenInFoldersEnabled: string | undefined;
};

export type CreateIdentityResponse = {
identity: [Identity];
Expand Down