Skip to content

Commit fea49de

Browse files
committed
refactor: Decouple TicketTimelineSection from generic ContentSection (#8398)
- Reverts model to its generic state (id, name, tag). - Creates model with full field set (including inherited fields). - Creates store extending the base store. - Updates to use the new specialized store.
1 parent a5f4294 commit fea49de

4 files changed

Lines changed: 70 additions & 17 deletions

File tree

apps/portal/model/ContentSection.mjs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,11 @@ class ContentSection extends Model {
1515
* @member {Object[]} fields
1616
*/
1717
fields: [{
18-
name: 'color',
19-
type: 'String'
20-
}, {
21-
name: 'icon',
22-
type: 'String'
23-
}, {
2418
name: 'id',
2519
type: 'String'
26-
}, {
27-
name: 'image',
28-
type: 'String'
2920
}, {
3021
name: 'name',
3122
type: 'String'
32-
}, {
33-
name: 'sourceId',
34-
type: 'String'
3523
}, {
3624
name: 'tag',
3725
type: 'String'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import ContentSection from './ContentSection.mjs';
2+
3+
/**
4+
* @class Portal.model.TicketTimelineSection
5+
* @extends Portal.model.ContentSection
6+
*/
7+
class TicketTimelineSection extends ContentSection {
8+
static config = {
9+
/**
10+
* @member {String} className='Portal.model.TicketTimelineSection'
11+
* @protected
12+
*/
13+
className: 'Portal.model.TicketTimelineSection',
14+
/**
15+
* @member {Object[]} fields
16+
*/
17+
fields: [{
18+
name: 'color',
19+
type: 'String'
20+
}, {
21+
name: 'icon',
22+
type: 'String'
23+
}, {
24+
name: 'id',
25+
type: 'String'
26+
}, {
27+
name: 'image',
28+
type: 'String'
29+
}, {
30+
name: 'name',
31+
type: 'String'
32+
}, {
33+
name: 'sourceId',
34+
type: 'String'
35+
}, {
36+
name: 'tag',
37+
type: 'String'
38+
}]
39+
}
40+
}
41+
42+
export default Neo.setupClass(TicketTimelineSection);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import ContentSections from './ContentSections.mjs';
2+
import TicketTimelineSection from '../model/TicketTimelineSection.mjs';
3+
4+
/**
5+
* @class Portal.store.TicketTimelineSections
6+
* @extends Portal.store.ContentSections
7+
*/
8+
class TicketTimelineSections extends ContentSections {
9+
static config = {
10+
/**
11+
* @member {String} className='Portal.store.TicketTimelineSections'
12+
* @protected
13+
*/
14+
className: 'Portal.store.TicketTimelineSections',
15+
/**
16+
* @member {Neo.data.Model} model=TicketTimelineSection
17+
* @reactive
18+
*/
19+
model: TicketTimelineSection
20+
}
21+
}
22+
23+
export default Neo.setupClass(TicketTimelineSections);

apps/portal/view/news/tickets/MainContainerStateProvider.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import ContentSectionStore from '../../../store/ContentSections.mjs';
2-
import TicketLabelsStore from '../../../store/TicketLabels.mjs';
3-
import TicketsStore from '../../../store/Tickets.mjs';
4-
import StateProvider from '../../../../../src/state/Provider.mjs';
1+
import TicketLabelsStore from '../../../store/TicketLabels.mjs';
2+
import TicketTimelineSectionsStore from '../../../store/TicketTimelineSections.mjs';
3+
import TicketsStore from '../../../store/Tickets.mjs';
4+
import StateProvider from '../../../../../src/state/Provider.mjs';
55

66
/**
77
* @class Portal.view.news.tickets.MainContainerStateProvider
@@ -51,7 +51,7 @@ class MainContainerStateProvider extends StateProvider {
5151
module : TicketLabelsStore
5252
},
5353
sections: {
54-
module: ContentSectionStore
54+
module: TicketTimelineSectionsStore
5555
},
5656
tree: {
5757
autoLoad: true,

0 commit comments

Comments
 (0)