@linid-dm/directory-manager-client-core
Version:
Core package by providing a set of angular components for the Directory Manager app.
479 lines (478 loc) • 14.3 kB
TypeScript
/**
* Copyright (C) 2020-2024 Linagora
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version, provided you comply with the Additional Terms applicable for
* LinID Directory Manager software by LINAGORA pursuant to Section 7 of the GNU
* Affero General Public License, subsections (b), (c), and (e), pursuant to
* which these Appropriate Legal Notices must notably (i) retain the display of
* the "LinID™" trademark/logo at the top of the interface window, the display
* of the “You are using the Open Source and free version of LinID™, powered by
* Linagora © 2009–2013. Contribute to LinID R&D by subscribing to an Enterprise
* offer!” infobox and in the e-mails sent with the Program, notice appended to
* any type of outbound messages (e.g. e-mail and meeting requests) as well as
* in the LinID Directory Manager user interface, (ii) retain all hypertext
* links between LinID Directory Manager and https://linid.org/, as well as
* between LINAGORA and LINAGORA.com, and (iii) refrain from infringing LINAGORA
* intellectual property rights over its trademarks and commercial brands. Other
* Additional Terms apply, see <http://www.linagora.com/licenses/> for more
* details.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License and
* its applicable Additional Terms for LinID Directory Manager along with this
* program. If not, see <http://www.gnu.org/licenses/> for the GNU Affero
* General Public License version 3 and <http://www.linagora.com/licenses/> for
* the Additional Terms applicable to the LinID Directory Manager software.
*/
import { ISelectOption } from './form.interface';
/**
* This is the interface of the object retrieves from config rest endpoint.
* Each id is an LDAP type, associated to the configuration retrieves from backend configuration file.
*/
export interface IConfigs extends ICurrentUser, IExternalLinks, IHomepageDetail, IHeaderDetail, IGenericErrorMessages, IGenericAccessibility, ILogoutDialogDetail {
[id: string]: IConfig | ICurrentUserConfig | IExternalLinksConfig | IHomepageConfig | IHeaderConfig | ILogoutDialogConfig | IGenericErrorMessagesConfig | IGenericAccessibilityConfig;
}
export interface IExternalLinks {
externalLinks?: IExternalLinksConfig;
}
export interface IHomepageDetail {
home: IHomepageConfig;
}
export interface IHeaderDetail {
header: IHeaderConfig;
}
export interface ICurrentUser {
currentUser: ICurrentUserConfig;
}
export interface IGenericErrorMessages {
genericErrorMessages: IGenericErrorMessagesConfig;
}
interface IGenericAccessibility {
genericAccessibility: IGenericAccessibilityConfig;
}
export interface IGenericAccessibilityConfig {
advancedSearch: IAdvancedSearchAccessibility;
form: IFormAccessibility;
filter: IFilterAccessibility;
array: IArrayGenericAccessibility;
searchBar: ISearchBarAccessibility;
detailHeader: IDetailHeaderAccessibility;
notFound: INotFoundAccessibility;
}
export interface IFormAccessibility {
requiredFieldsMsg: string;
requiredFieldsTitle: string;
searchBtn: IBtnDetail;
cancelBtn: IBtnDetail;
createBtn: IBtnDetail;
saveEditBtn: IBtnDetail;
}
export interface IFilterAccessibility {
label: string;
clearSearch: string;
}
export interface ISearchBarAccessibility extends IFilterAccessibility {
hint: string;
}
export interface IAdvancedSearchAccessibility extends ISearchBarAccessibility {
activatedSearchHint: string;
displayAdvancedSearchMenu: string;
}
export interface IArrayGenericAccessibility {
actionsColumnLabel: string;
actionsColumn: string;
actionsMenu: string;
selectColumn: string;
selectRow: string;
singleSelection: string;
singleSelectionLabel: string;
singleDeselectionLabel: string;
multipleSelection: string;
multipleSelectionLabel: string;
multipleDeselectionLabel: string;
columnHeader: string;
cell: string;
}
export interface IDetailHeaderAccessibility {
backBtnAriaLabel: string;
}
export interface INotFoundAccessibility {
notFoundLogoAlt: string;
notFoundDetailmsg: string;
}
export interface IBtnDetail {
ariaLabel: string;
label: string;
progressLabel?: string;
}
export interface ILogoutDialogDetail {
logoutDialog: ILogoutDialogConfig;
}
export interface ILogoutDialogConfig {
title: string;
content: string;
logoutBtn: IBtnDetail;
cancelBtn: IBtnDetail;
}
export declare enum EResourceComponent {
ARRAY = "array",
LIST = "list",
TREE = "tree"
}
export interface IProps {
columns?: IColumn[];
parent?: string;
filterOnExternalId?: boolean;
}
export interface ITitle {
title: string;
placeholder?: string;
noSearchResult?: string;
noFilterResult?: string;
fieldForTitle?: string;
}
export interface INotification {
successNotification?: string;
successNotificationMoreThan1?: string;
successNotificationMoreThan3?: string;
}
export interface IBtnLabel extends ITitle, INotification {
btnLabel: string;
icon?: string;
dialogConfirmBtn?: string;
dialogCancelBtn?: string;
dialogPreviousStepBtn?: string;
dialogNextStepBtn?: string;
dialogMoveToRootBtn?: string;
dialogMoveToAnotherEntryBtn?: string;
}
interface ISearchActionLabels {
noResult: string;
}
export interface ISearchAction {
filter: ISearchActionLabels;
advancedSearch?: ISearchActionLabels;
}
export interface IPrimitiveActions {
add?: IBtnLabel;
addChildren?: IBtnLabel;
edit: IBtnLabel;
noSelectedElement?: ITitle;
delete?: IBtnLabel;
deleteChild?: IBtnLabel;
deleteChildren?: IBtnLabel;
singleDelete?: IBtnLabel;
moveNode?: IBtnLabel;
multipleDelete?: IBtnLabel;
export?: IBtnLabel;
validate?: IBtnLabel;
decline?: IBtnLabel;
search?: ISearchAction;
}
export interface IAttributeActions {
assign?: IBtnLabel;
singleReassign?: IBtnLabel;
multipleReassign?: IBtnLabel;
singleUnassign?: IBtnLabel;
multipleUnassign?: IBtnLabel;
singleEdit?: IBtnLabel;
multipleEdit?: IBtnLabel;
singleDelete?: IBtnLabel;
multipleDelete?: IBtnLabel;
export?: IBtnLabel;
search?: ISearchAction;
}
export interface IAllAttributesActions {
[id: string]: IAttributeActions;
}
export interface IActions {
primitives: IPrimitiveActions;
attributes: IAllAttributesActions;
}
export interface IAccessibility {
array?: IArrayAccessibility;
tree?: ITreeAccessibility;
}
export interface ITreeAccessibility {
test: string;
}
export interface IConfig {
level?: number;
icon?: string;
path?: string;
label: string;
component?: EResourceComponent;
hasAdvancedSearch?: boolean;
props?: IProps;
actions?: IActions;
accessibility?: IAccessibility;
attributes?: IAttribute[];
canCreate?: boolean;
}
export interface ISelectProps {
options: ISelectOption[];
}
/**
* This is the interface of a LDAP type attribute configuration
*/
export interface IAttribute {
/** Attribute id */
modelRef: string;
getValuesParams?: IRequestParams;
getDataListParams?: IGetDataListParams;
updateArrayAttributeParams?: IArrayAttributeUpdateParams;
/** Allow to know if the attribute can be use to retrieve data detail */
keyForDetail?: boolean;
isDetailTitle?: boolean;
props: {
isMultiple: boolean;
isSearchable: boolean;
isVisible: boolean;
scimParentAttribute?: string;
isUsingDataFromBackend?: boolean;
isAddedAttributeArray?: boolean;
isMandatory?: boolean;
isEditable?: boolean;
isTreeNodeName?: boolean;
isListItemName?: boolean;
isInCreateForm?: boolean;
isNotVisibleWhenFalse?: boolean;
isNotEditableWhenTrue?: boolean;
isBackendLinkObject?: boolean;
isSentOnUpdate?: boolean;
isConcatWithPreviousValue?: boolean;
isExternalLink?: boolean;
canLabelContainSlash?: boolean;
};
/** Properties for the associated form field */
value: {
/** Properties for the form field label */
label: {
id: string;
props: any;
value: ILabelValues;
};
/** Properties for the form field control */
field: {
id: string;
componentName: string;
props: {
disabled: boolean;
required: boolean;
placeholder?: string;
type?: string;
min?: number;
maxlength?: number;
columns?: IColumn[];
accessibility?: IArrayAccessibility;
keyForSquash?: string;
displayedValue?: {
true: string;
false: string;
};
convertToString?: boolean;
trueConditionValue?: string;
falseConditionValue?: string;
emptyArrayPlaceholder?: string;
addOnBlur?: boolean;
removable?: boolean;
autocomplete?: string;
isInteger?: boolean;
linkedToFields?: string[];
format?: string[];
invalidCharacters?: string[];
validCharacters?: string[];
regexValidator?: string;
regexInput?: string;
};
nestedComponent?: {
id: string;
props?: INestedComponentProps;
};
selectOption?: {
id: string;
props?: ISelectProps;
};
};
icon: {
id: string;
props?: any;
value: string;
};
hint: {
id: string;
props?: any;
value: string;
};
error: {
id: string;
props?: any;
value: {
required: string;
incorrect?: string;
email?: string;
isNotAValidDate?: string;
isNotInteger?: string;
isNotValidFormat?: string;
pattern?: string;
min?: string;
};
};
};
}
export interface IRequestParams {
requestTarget: string;
requestResourceTypeId: string;
}
export interface IGetDataListParams extends IRequestParams {
regexFilter: string;
fieldForRegexValue?: string;
fieldForUpdate?: string;
}
export interface IEditParams {
columnId: string;
props: {
type: string;
label: string;
min?: number;
isInteger?: boolean;
invalidCharacters?: string[];
};
}
export interface IArrayAttributeUpdateActionParams {
assign?: IAssignParams;
reassign?: IReassignParams;
edit?: IEditParams;
}
export interface IReassignParams {
resourceTypeComponent: EResourceComponent;
}
export interface IArrayAttributeUpdateParams extends IArrayAttributeUpdateActionParams {
updateAffectAnotherResourceType?: boolean;
patchOperationsParams?: IPatchOperationsParams;
selectionColumnId?: string;
}
export interface IPatchOperationsParams {
add: string;
remove: string;
}
export interface ILabelValues {
short: string;
long: string;
onCreate?: string;
addNew?: string;
edit?: string;
remove?: string;
}
export interface IColumn {
id: string;
width: string;
label?: string;
isBackendLinkObject?: boolean;
type?: string;
keyForDetail?: boolean;
idForSearch?: string;
}
export interface IArrayAccessibility {
table: string;
headerRow: string;
row: string;
emptyArrayPlaceholder?: string;
}
export interface INestedComponentProps {
options: {
[resourceTypeId: string]: {
valuesField: string;
optionsField: string[];
};
};
limit: number;
offset: number;
}
export interface IAssignParams {
requestedResourceTypeId?: string;
assignedResourceTypeId?: string;
resourceTypeComponent: EResourceComponent;
fieldForUpdate?: string;
isMultipleStepsAssign?: boolean;
nbSteps?: number;
browseBtnsLabels?: {
previous: string;
next: string;
};
}
export interface IGenericErrorMessagesConfig {
errorRouteMsg: string;
unavailableHomepageMsg: string;
notFoundTabTitle: string;
noInternetConnection: string;
unreachableServer: string;
notFound: string;
missingKeyForDetail: string;
}
export interface ICurrentUserConfig {
id: string;
userName: string;
displayName: string;
photo?: string;
canAssignOrMove: string[];
}
export interface IExternalLink {
label: string;
link: string;
icon: string;
ariaLabel: string;
}
export interface IExternalLinksConfig {
userGuide: IExternalLink;
rgaaChart: IExternalLink;
}
export interface IHeaderLogoBtn {
path: string;
alt: string;
ariaLabel: string;
label?: string;
}
export interface IHeaderLogo {
path: string;
alt: string;
}
export interface ISidenavBtn {
ariaControls: string;
ariaLabel: {
collapsed: string;
expanded: string;
};
}
export interface IAccountDiv {
labelPrefix: string;
ariaLabelPrefix: string;
altPrefix: string;
}
export interface ITabProps {
title: string;
}
export interface IHeaderConfig {
logoBtn: IHeaderLogoBtn;
logo: IHeaderLogo;
logo1: IHeaderLogo;
sidenavBtn: ISidenavBtn;
accountDiv: IAccountDiv;
profileBtn: IBtnDetail;
logoutBtn: IBtnDetail;
tab?: ITabProps;
}
export interface IHomepageConfig {
tabTitle: string;
title: string;
subtitle: string;
linagoraLogoAlt: string;
}
export {};