UI styling improvements: dashboard headers and navigation
- Restore blue PageHeader on Dashboard (/app-components) - Update homepage (/) with subtle header design without blue bar - Add uniform PageHeader styling to application edit page - Fix Rapporten link on homepage to point to /reports overview - Improve header descriptions spacing for better readability
This commit is contained in:
121
backend/src/domain/jiraAssetsPayload.ts
Normal file
121
backend/src/domain/jiraAssetsPayload.ts
Normal file
@@ -0,0 +1,121 @@
|
||||
// ==========================
|
||||
// API Payload Types
|
||||
// ==========================
|
||||
|
||||
export interface AssetsPayload {
|
||||
objectEntries: ObjectEntry[];
|
||||
}
|
||||
|
||||
export interface ObjectEntry {
|
||||
id: string | number;
|
||||
objectKey: string;
|
||||
label: string;
|
||||
objectType: {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
created: string;
|
||||
updated: string;
|
||||
hasAvatar: boolean;
|
||||
timestamp: number;
|
||||
attributes?: ObjectAttribute[];
|
||||
}
|
||||
|
||||
export interface ObjectAttribute {
|
||||
id: number;
|
||||
objectTypeAttributeId: number;
|
||||
objectAttributeValues: ObjectAttributeValue[];
|
||||
}
|
||||
|
||||
// ==========================
|
||||
// Attribute Value Union
|
||||
// ==========================
|
||||
|
||||
export type ObjectAttributeValue =
|
||||
| SimpleValue
|
||||
| StatusValue
|
||||
| ConfluenceValue
|
||||
| UserValue
|
||||
| ReferenceValue;
|
||||
|
||||
export interface SimpleValue {
|
||||
value: string | number | boolean;
|
||||
searchValue: string;
|
||||
referencedType: false;
|
||||
displayValue: string;
|
||||
}
|
||||
|
||||
export interface StatusValue {
|
||||
status: { id: number; name: string; category: number };
|
||||
searchValue: string;
|
||||
referencedType: boolean;
|
||||
displayValue: string;
|
||||
}
|
||||
|
||||
export interface ConfluenceValue {
|
||||
confluencePage: { id: string; title: string; url: string };
|
||||
searchValue: string;
|
||||
referencedType: boolean;
|
||||
displayValue: string;
|
||||
}
|
||||
|
||||
export interface UserValue {
|
||||
user: {
|
||||
avatarUrl: string;
|
||||
displayName: string;
|
||||
name: string;
|
||||
key: string;
|
||||
renderedLink: string;
|
||||
isDeleted: boolean;
|
||||
};
|
||||
searchValue: string;
|
||||
referencedType: boolean;
|
||||
displayValue: string;
|
||||
}
|
||||
|
||||
export interface ReferenceValue {
|
||||
referencedObject: ReferencedObject;
|
||||
searchValue: string;
|
||||
referencedType: true;
|
||||
displayValue: string;
|
||||
}
|
||||
|
||||
export interface ReferencedObject {
|
||||
id: string | number;
|
||||
objectKey: string;
|
||||
label: string;
|
||||
name?: string;
|
||||
archived?: boolean;
|
||||
objectType: {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
created: string;
|
||||
updated: string;
|
||||
timestamp: number;
|
||||
hasAvatar: boolean;
|
||||
attributes?: ObjectAttribute[];
|
||||
_links?: { self: string };
|
||||
}
|
||||
|
||||
// ==========================
|
||||
// Type Guards (MANDATORY)
|
||||
// ==========================
|
||||
|
||||
export function isReferenceValue(
|
||||
v: ObjectAttributeValue
|
||||
): v is ReferenceValue {
|
||||
return (v as ReferenceValue).referencedObject !== undefined;
|
||||
}
|
||||
|
||||
export function isSimpleValue(
|
||||
v: ObjectAttributeValue
|
||||
): v is SimpleValue {
|
||||
return (v as SimpleValue).value !== undefined;
|
||||
}
|
||||
|
||||
export function hasAttributes(
|
||||
obj: ObjectEntry | ReferencedObject
|
||||
): obj is (ObjectEntry | ReferencedObject) & { attributes: ObjectAttribute[] } {
|
||||
return Array.isArray((obj as any).attributes);
|
||||
}
|
||||
38
backend/src/domain/syncPolicy.ts
Normal file
38
backend/src/domain/syncPolicy.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Sync Policy - Determines how objects are handled during sync
|
||||
*/
|
||||
|
||||
export enum SyncPolicy {
|
||||
/**
|
||||
* Full sync: fetch all objects, cache all attributes
|
||||
* Used for enabled object types in schema configuration
|
||||
*/
|
||||
ENABLED = 'enabled',
|
||||
|
||||
/**
|
||||
* Reference-only: cache minimal metadata for referenced objects
|
||||
* Used for disabled object types that are referenced by enabled types
|
||||
*/
|
||||
REFERENCE_ONLY = 'reference_only',
|
||||
|
||||
/**
|
||||
* Skip: don't sync this object type at all
|
||||
* Used for object types not in use
|
||||
*/
|
||||
SKIP = 'skip',
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sync policy for an object type
|
||||
*/
|
||||
export function getSyncPolicy(
|
||||
typeName: string,
|
||||
enabledTypes: Set<string>
|
||||
): SyncPolicy {
|
||||
if (enabledTypes.has(typeName)) {
|
||||
return SyncPolicy.ENABLED;
|
||||
}
|
||||
// We still need to cache referenced objects, even if their type is disabled
|
||||
// This allows reference resolution without full sync
|
||||
return SyncPolicy.REFERENCE_ONLY;
|
||||
}
|
||||
Reference in New Issue
Block a user