[WEB-5860] [WEB-5861] [WEB-5862] style: improved settings interface (#8520)
* style: improved profile settings * chore: minor improvements * style: improved workspace settings * style: workspace settings content * style: improved project settings * fix: project settings flat map * chore: add back navigation from settings pages * style: settings content * style: estimates list * refactor: remove old code * refactor: removed unnecessary line breaks * refactor: create a common component for page header * chore: add fade-in animation to sidebar * fix: formatting * fix: project settings sidebar header * fix: workspace settings sidebar header * fix: settings content wrapper scroll * chore: separate project settings features * fix: formatting * refactor: custom theme selector * refactor: settings headings * refactor: settings headings * fix: project settings sidebar padding * fix: sidebar header padding * fix: sidebar item permissions * fix: missing editable check * refactor: remove unused files * chore: remove unnecessary code * chore: add missing translations * fix: formatting
This commit is contained in:
parent
ba5ba5bf54
commit
db8b67102d
216 changed files with 4684 additions and 5454 deletions
|
|
@ -1,8 +1,11 @@
|
|||
import { observable, action, makeObservable } from "mobx";
|
||||
import { observable, action, makeObservable, runInAction } from "mobx";
|
||||
import { computedFn } from "mobx-utils";
|
||||
// plane imports
|
||||
import type { TCreateModalStoreTypes, TCreatePageModal } from "@plane/constants";
|
||||
import { DEFAULT_CREATE_PAGE_MODAL_DATA, EPageAccess } from "@plane/constants";
|
||||
import type { TProfileSettingsTabs } from "@plane/types";
|
||||
import { EIssuesStoreType } from "@plane/types";
|
||||
// lib
|
||||
import { store } from "@/lib/store-context";
|
||||
|
||||
export interface ModalData {
|
||||
|
|
@ -22,6 +25,10 @@ export interface IBaseCommandPaletteStore {
|
|||
isBulkDeleteIssueModalOpen: boolean;
|
||||
createIssueStoreType: TCreateModalStoreTypes;
|
||||
createWorkItemAllowedProjectIds: string[] | undefined;
|
||||
profileSettingsModal: {
|
||||
activeTab: TProfileSettingsTabs | null;
|
||||
isOpen: boolean;
|
||||
};
|
||||
allStickiesModal: boolean;
|
||||
projectListOpenMap: Record<string, boolean>;
|
||||
getIsProjectListOpen: (projectId: string) => boolean;
|
||||
|
|
@ -36,6 +43,7 @@ export interface IBaseCommandPaletteStore {
|
|||
toggleBulkDeleteIssueModal: (value?: boolean) => void;
|
||||
toggleAllStickiesModal: (value?: boolean) => void;
|
||||
toggleProjectListOpen: (projectId: string, value?: boolean) => void;
|
||||
toggleProfileSettingsModal: (value: { activeTab?: TProfileSettingsTabs | null; isOpen?: boolean }) => void;
|
||||
}
|
||||
|
||||
export abstract class BaseCommandPaletteStore implements IBaseCommandPaletteStore {
|
||||
|
|
@ -50,6 +58,10 @@ export abstract class BaseCommandPaletteStore implements IBaseCommandPaletteStor
|
|||
createPageModal: TCreatePageModal = DEFAULT_CREATE_PAGE_MODAL_DATA;
|
||||
createIssueStoreType: TCreateModalStoreTypes = EIssuesStoreType.PROJECT;
|
||||
createWorkItemAllowedProjectIds: IBaseCommandPaletteStore["createWorkItemAllowedProjectIds"] = undefined;
|
||||
profileSettingsModal: IBaseCommandPaletteStore["profileSettingsModal"] = {
|
||||
activeTab: "general",
|
||||
isOpen: false,
|
||||
};
|
||||
allStickiesModal: boolean = false;
|
||||
projectListOpenMap: Record<string, boolean> = {};
|
||||
|
||||
|
|
@ -66,6 +78,7 @@ export abstract class BaseCommandPaletteStore implements IBaseCommandPaletteStor
|
|||
createPageModal: observable,
|
||||
createIssueStoreType: observable,
|
||||
createWorkItemAllowedProjectIds: observable,
|
||||
profileSettingsModal: observable,
|
||||
allStickiesModal: observable,
|
||||
projectListOpenMap: observable,
|
||||
// toggle actions
|
||||
|
|
@ -79,6 +92,7 @@ export abstract class BaseCommandPaletteStore implements IBaseCommandPaletteStor
|
|||
toggleBulkDeleteIssueModal: action,
|
||||
toggleAllStickiesModal: action,
|
||||
toggleProjectListOpen: action,
|
||||
toggleProfileSettingsModal: action,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -240,4 +254,20 @@ export abstract class BaseCommandPaletteStore implements IBaseCommandPaletteStor
|
|||
this.allStickiesModal = !this.allStickiesModal;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Toggles the profile settings modal
|
||||
* @param value
|
||||
* @returns
|
||||
*/
|
||||
toggleProfileSettingsModal: IBaseCommandPaletteStore["toggleProfileSettingsModal"] = (payload) => {
|
||||
const updatedSettings: IBaseCommandPaletteStore["profileSettingsModal"] = {
|
||||
...this.profileSettingsModal,
|
||||
...payload,
|
||||
};
|
||||
|
||||
runInAction(() => {
|
||||
this.profileSettingsModal = updatedSettings;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue