Skip to content

Commit

Permalink
feat: add new fields, fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelgoth committed Jan 24, 2025
1 parent 32cc1dd commit c7e0cdb
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type Announcement = {
body: string;
created_at: string;
active: boolean;
start_at: string;
};

// @public
Expand All @@ -37,6 +38,8 @@ export type AnnouncementsFilters = {
category?: string;
page?: number;
active?: boolean;
sortBy?: 'created_at' | 'start_at';
order?: 'asc' | 'desc';
};

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export type Announcement = {
created_at: string;
/** Whether the announcement is currently active */
active: boolean;
/** Date indicating when then announcement start */
start_at: string;
};

/**
Expand Down Expand Up @@ -78,6 +80,10 @@ export type AnnouncementsFilters = {
page?: number;
/** Filter by active status */
active?: boolean;
/** Field to sort by (e.g., "created_at", "start_at") */
sortBy?: 'created_at' | 'start_at';
/** Sorting order: "asc" for ascending or "desc" for descending */
order?: 'asc' | 'desc';
};

/**
Expand Down
72 changes: 44 additions & 28 deletions workspaces/announcements/plugins/announcements-react/report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export interface AnnouncementsApi {
page?: number;
category?: string;
active?: boolean;
sortBy?: 'created_at' | 'start_at';
order?: 'asc' | 'desc';
}): Promise<AnnouncementsList>;
// (undocumented)
categories(): Promise<Category[]>;
Expand Down Expand Up @@ -60,20 +62,22 @@ export const announcementsTranslationRef: TranslationRef<
readonly 'admin.adminPortal.subtitle': 'Manage announcements and categories';
readonly 'admin.adminPortal.announcementsLabels': 'Announcements';
readonly 'admin.adminPortal.categoriesLabel': 'Categories';
readonly 'admin.announecementsContent.table.active': 'Active';
readonly 'admin.announecementsContent.table.inactive': 'Inactive';
readonly 'admin.announecementsContent.table.body': 'Body';
readonly 'admin.announecementsContent.table.title': 'Title';
readonly 'admin.announecementsContent.table.status': 'Status';
readonly 'admin.announecementsContent.table.actions': 'Actions';
readonly 'admin.announecementsContent.table.category': 'Category';
readonly 'admin.announecementsContent.table.publisher': 'Publisher';
readonly 'admin.announecementsContent.announcements': 'Announcements';
readonly 'admin.announecementsContent.alertMessage': 'Announcement created.';
readonly 'admin.announecementsContent.alertMessageWithNewCategory': 'with new category';
readonly 'admin.announecementsContent.cancelButton': 'Cancel';
readonly 'admin.announecementsContent.createButton': 'Create Announcement';
readonly 'admin.announecementsContent.noAnnouncementsFound': 'No announcements found';
readonly 'admin.announcementsContent.table.active': 'Active';
readonly 'admin.announcementsContent.table.inactive': 'Inactive';
readonly 'admin.announcementsContent.table.body': 'Body';
readonly 'admin.announcementsContent.table.title': 'Title';
readonly 'admin.announcementsContent.table.status': 'Status';
readonly 'admin.announcementsContent.table.actions': 'Actions';
readonly 'admin.announcementsContent.table.created_at': 'Created';
readonly 'admin.announcementsContent.table.start_at': 'Start';
readonly 'admin.announcementsContent.table.category': 'Category';
readonly 'admin.announcementsContent.table.publisher': 'Publisher';
readonly 'admin.announcementsContent.announcements': 'Announcements';
readonly 'admin.announcementsContent.alertMessage': 'Announcement created.';
readonly 'admin.announcementsContent.alertMessageWithNewCategory': 'with new category';
readonly 'admin.announcementsContent.cancelButton': 'Cancel';
readonly 'admin.announcementsContent.createButton': 'Create Announcement';
readonly 'admin.announcementsContent.noAnnouncementsFound': 'No announcements found';
readonly 'admin.categoriesContent.table.title': 'Title';
readonly 'admin.categoriesContent.table.actions': 'Actions';
readonly 'admin.categoriesContent.table.categoryDeleted': 'Category deleted.';
Expand All @@ -90,6 +94,7 @@ export const announcementsTranslationRef: TranslationRef<
readonly 'announcementForm.excerpt': 'Excerpt';
readonly 'announcementForm.editAnnouncement': 'Edit announcement';
readonly 'announcementForm.newAnnouncement': 'New announcement';
readonly 'announcementForm.startAt': 'Announcement start date';
readonly 'announcementForm.categoryInput.label': 'Category';
readonly 'announcementForm.categoryInput.create': 'Create';
readonly 'announcementsPage.grid.announcementDeleted': 'Announcement deleted.';
Expand All @@ -101,12 +106,16 @@ export const announcementsTranslationRef: TranslationRef<
readonly 'announcementsPage.card.in': 'in';
readonly 'announcementsPage.card.delete': 'DELETE';
readonly 'announcementsPage.card.edit': 'EDIT';
readonly 'announcementsPage.card.occurred': 'Occurred ';
readonly 'announcementsPage.card.scheduled': 'Scheduled ';
readonly 'deleteDialog.cancel': 'Cancel';
readonly 'deleteDialog.title': 'Are you sure you want to delete this announcement?';
readonly 'deleteDialog.delete': 'Delete';
readonly 'announcementsCard.new': 'New';
readonly 'announcementsCard.in': 'in';
readonly 'announcementsCard.announcements': 'Announcements';
readonly 'announcementsCard.occurred': 'Occurred';
readonly 'announcementsCard.scheduled': 'Scheduled';
readonly 'announcementsCard.seeAll': 'See all';
readonly 'announcementsCard.noAnnouncements': 'No announcements yet, want to';
readonly 'announcementsCard.addOne': 'add one';
Expand Down Expand Up @@ -171,20 +180,22 @@ export const useAnnouncementsTranslation: () => {
readonly 'admin.adminPortal.subtitle': 'Manage announcements and categories';
readonly 'admin.adminPortal.announcementsLabels': 'Announcements';
readonly 'admin.adminPortal.categoriesLabel': 'Categories';
readonly 'admin.announecementsContent.table.active': 'Active';
readonly 'admin.announecementsContent.table.inactive': 'Inactive';
readonly 'admin.announecementsContent.table.body': 'Body';
readonly 'admin.announecementsContent.table.title': 'Title';
readonly 'admin.announecementsContent.table.status': 'Status';
readonly 'admin.announecementsContent.table.actions': 'Actions';
readonly 'admin.announecementsContent.table.category': 'Category';
readonly 'admin.announecementsContent.table.publisher': 'Publisher';
readonly 'admin.announecementsContent.announcements': 'Announcements';
readonly 'admin.announecementsContent.alertMessage': 'Announcement created.';
readonly 'admin.announecementsContent.alertMessageWithNewCategory': 'with new category';
readonly 'admin.announecementsContent.cancelButton': 'Cancel';
readonly 'admin.announecementsContent.createButton': 'Create Announcement';
readonly 'admin.announecementsContent.noAnnouncementsFound': 'No announcements found';
readonly 'admin.announcementsContent.table.active': 'Active';
readonly 'admin.announcementsContent.table.inactive': 'Inactive';
readonly 'admin.announcementsContent.table.body': 'Body';
readonly 'admin.announcementsContent.table.title': 'Title';
readonly 'admin.announcementsContent.table.status': 'Status';
readonly 'admin.announcementsContent.table.actions': 'Actions';
readonly 'admin.announcementsContent.table.created_at': 'Created';
readonly 'admin.announcementsContent.table.start_at': 'Start';
readonly 'admin.announcementsContent.table.category': 'Category';
readonly 'admin.announcementsContent.table.publisher': 'Publisher';
readonly 'admin.announcementsContent.announcements': 'Announcements';
readonly 'admin.announcementsContent.alertMessage': 'Announcement created.';
readonly 'admin.announcementsContent.alertMessageWithNewCategory': 'with new category';
readonly 'admin.announcementsContent.cancelButton': 'Cancel';
readonly 'admin.announcementsContent.createButton': 'Create Announcement';
readonly 'admin.announcementsContent.noAnnouncementsFound': 'No announcements found';
readonly 'admin.categoriesContent.table.title': 'Title';
readonly 'admin.categoriesContent.table.actions': 'Actions';
readonly 'admin.categoriesContent.table.categoryDeleted': 'Category deleted.';
Expand All @@ -201,6 +212,7 @@ export const useAnnouncementsTranslation: () => {
readonly 'announcementForm.excerpt': 'Excerpt';
readonly 'announcementForm.editAnnouncement': 'Edit announcement';
readonly 'announcementForm.newAnnouncement': 'New announcement';
readonly 'announcementForm.startAt': 'Announcement start date';
readonly 'announcementForm.categoryInput.label': 'Category';
readonly 'announcementForm.categoryInput.create': 'Create';
readonly 'announcementsPage.grid.announcementDeleted': 'Announcement deleted.';
Expand All @@ -212,12 +224,16 @@ export const useAnnouncementsTranslation: () => {
readonly 'announcementsPage.card.in': 'in';
readonly 'announcementsPage.card.delete': 'DELETE';
readonly 'announcementsPage.card.edit': 'EDIT';
readonly 'announcementsPage.card.occurred': 'Occurred ';
readonly 'announcementsPage.card.scheduled': 'Scheduled ';
readonly 'deleteDialog.cancel': 'Cancel';
readonly 'deleteDialog.title': 'Are you sure you want to delete this announcement?';
readonly 'deleteDialog.delete': 'Delete';
readonly 'announcementsCard.new': 'New';
readonly 'announcementsCard.in': 'in';
readonly 'announcementsCard.announcements': 'Announcements';
readonly 'announcementsCard.occurred': 'Occurred';
readonly 'announcementsCard.scheduled': 'Scheduled';
readonly 'announcementsCard.seeAll': 'See all';
readonly 'announcementsCard.noAnnouncements': 'No announcements yet, want to';
readonly 'announcementsCard.addOne': 'add one';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export interface AnnouncementsApi {
page?: number;
category?: string;
active?: boolean;
sortBy?: 'created_at' | 'start_at';
order?: 'asc' | 'desc';
}): Promise<AnnouncementsList>;
announcementByID(id: string): Promise<Announcement>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const announcementsTranslationRef = createTranslationRef({
submit: 'Submit',
editAnnouncement: 'Edit announcement',
newAnnouncement: 'New announcement',
startAt: 'Announcement start date',
categoryInput: {
create: 'Create',
label: 'Category',
Expand All @@ -39,6 +40,8 @@ export const announcementsTranslationRef = createTranslationRef({
in: 'in',
edit: 'EDIT',
delete: 'DELETE',
occurred: 'Occurred ',
scheduled: 'Scheduled ',
},
grid: {
announcementDeleted: 'Announcement deleted.',
Expand All @@ -60,6 +63,8 @@ export const announcementsTranslationRef = createTranslationRef({
in: 'in',
noAnnouncements: 'No announcements yet, want to',
addOne: 'add one',
occurred: 'Occurred',
scheduled: 'Scheduled',
},
announcementSearchResultListItem: {
published: 'Published',
Expand Down Expand Up @@ -113,7 +118,7 @@ export const announcementsTranslationRef = createTranslationRef({
title: 'Admin Portal for Announcements',
subtitle: 'Manage announcements and categories',
},
announecementsContent: {
announcementsContent: {
alertMessage: 'Announcement created.',
alertMessageWithNewCategory: 'with new category',
cancelButton: 'Cancel',
Expand All @@ -129,6 +134,8 @@ export const announcementsTranslationRef = createTranslationRef({
actions: 'Actions',
active: 'Active',
inactive: 'Inactive',
created_at: 'Created',
start_at: 'Start',
},
},
categoriesContent: {
Expand Down

0 comments on commit c7e0cdb

Please sign in to comment.