Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/admin-shell/scripts/admin-shell-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ module.exports = {
'petoberfest',
'channels',
'channel-collections',
'channel-topic-map'
'channel-topic-map',
'channel-submissions'
],

//
Expand Down Expand Up @@ -171,7 +172,8 @@ module.exports = {
petoberfest: 'pb',
channels: 'ch',
'channel-collections': 'cc',
'channel-topic-map': 'ctm'
'channel-topic-map': 'ctm',
'channel-submissions': 'csub'
},

//
Expand Down
6 changes: 4 additions & 2 deletions app/admin-shell/webapp/controller/Shell.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ sap.ui.define([
topicClusters: "topicClusters",
channels: "channels",
channelCollections: "channelCollections",
channelTopicMap: "channelTopicMap"
channelTopicMap: "channelTopicMap",
channelSubmissions: "channelSubmissions"
};

var NAV_KEY_TO_TITLE = {
Expand Down Expand Up @@ -127,7 +128,8 @@ sap.ui.define([
topicClusters: "Topic Clusters",
channels: "Channels",
channelCollections: "Channel Collections",
channelTopicMap: "Channel Topic Map"
channelTopicMap: "Channel Topic Map",
channelSubmissions: "Channel Submissions"
};

return Controller.extend("sap.tutorials.admin.shell.controller.Shell", {
Expand Down
26 changes: 25 additions & 1 deletion app/admin-shell/webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
"sap.tutorials.admin.petoberfest": "./components/petoberfest",
"sap.tutorials.admin.channels": "./components/channels",
"sap.tutorials.admin.channelCollections": "./components/channel-collections",
"sap.tutorials.admin.channelTopicMap": "./components/channel-topic-map"
"sap.tutorials.admin.channelTopicMap": "./components/channel-topic-map",
"sap.tutorials.admin.channelSubmissions": "./components/channel-submissions"
},
"models": {
"admin": {
Expand Down Expand Up @@ -414,6 +415,12 @@
"settings": {},
"componentData": {},
"lazy": true
},
"channelSubmissionsComponent": {
"name": "sap.tutorials.admin.channelSubmissions",
"settings": {},
"componentData": {},
"lazy": true
}
},
"services": {
Expand Down Expand Up @@ -974,6 +981,16 @@
}
]
},
{
"name": "channelSubmissions",
"pattern": "channel-submissions",
"target": [
{
"name": "channelSubmissionsTarget",
"prefix": "csub"
}
]
},
{
"name": "feedbackDashboard",
"pattern": "feedback/dashboard",
Expand Down Expand Up @@ -1352,6 +1369,13 @@
"viewLevel": 1,
"prefix": "ctm"
},
"channelSubmissionsTarget": {
"type": "Component",
"usage": "channelSubmissionsComponent",
"id": "channelSubmissionsTarget",
"viewLevel": 1,
"prefix": "csub"
},
"feedbackDashboardTarget": {
"viewName": "TutorialFeedbackDashboard",
"viewLevel": 1
Expand Down
1 change: 1 addition & 0 deletions app/admin-shell/webapp/model/navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
{ "key": "channels", "title": "Channels" },
{ "key": "channelCollections", "title": "Channel Collections" },
{ "key": "channelTopicMap", "title": "Channel Topic Map" },
{ "key": "channelSubmissions", "title": "Channel Submissions" },
{ "key": "operations", "title": "Featured Tasks" }
]
},
Expand Down
15 changes: 15 additions & 0 deletions app/admin/channel-submissions/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "channel-submissions-admin",
"version": "0.0.1",
"private": true,
"description": "Channel Submissions - Admin Fiori Elements",
"sapux": true,
"scripts": {
"start": "fiori run --open index.html",
"build": "ui5 build --clean-dest"
},
"devDependencies": {
"@sap/ux-specification": "latest",
"@ui5/cli": "^4.0.0"
}
}
12 changes: 12 additions & 0 deletions app/admin/channel-submissions/ui5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
specVersion: "4.0"
metadata:
name: sap.tutorials.admin.channelSubmissions
type: application
framework:
name: SAPUI5
version: "1.136.0"
libraries:
- name: sap.m
- name: sap.ui.core
- name: sap.ushell
- name: sap.fe.templates
4 changes: 4 additions & 0 deletions app/admin/channel-submissions/webapp/Component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sap.ui.define(["sap/fe/core/AppComponent"], function (AppComponent) {
"use strict";
return AppComponent.extend("sap.tutorials.admin.channelSubmissions.Component", { metadata: { manifest: "json" } });
});
4 changes: 4 additions & 0 deletions app/admin/channel-submissions/webapp/i18n/i18n.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
appTitle=Channel Submissions
appDescription=Moderation queue for community channel submissions
approve=Approve
reject=Reject
79 changes: 79 additions & 0 deletions app/admin/channel-submissions/webapp/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"_version": "1.65.0",
"sap.app": {
"id": "sap.tutorials.admin.channelSubmissions",
"type": "application",
"title": "{{appTitle}}",
"description": "{{appDescription}}",
"applicationVersion": { "version": "0.0.1" },
"i18n": "i18n/i18n.properties",
"dataSources": {
"mainService": {
"uri": "/admin/",
"type": "OData",
"settings": { "odataVersion": "4.0" }
}
},
"crossNavigation": {
"inbounds": {
"ChannelSubmissions-manage": {
"semanticObject": "ChannelSubmissions",
"action": "manage",
"title": "{{appTitle}}",
"signature": { "parameters": {}, "additionalParameters": "allowed" }
}
}
}
},
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.136.0",
"libs": { "sap.fe.templates": {} }
},
"models": {
"": {
"dataSource": "mainService",
"preload": true,
"settings": {
"synchronizationMode": "None",
"operationMode": "Server",
"autoExpandSelect": true,
"earlyRequests": true
}
},
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": { "bundleName": "sap.tutorials.admin.channelSubmissions.i18n.i18n" }
}
},
"routing": {
"routes": [
{ "name": "ChannelSubmissionsList", "pattern": ":?query:", "target": "ChannelSubmissionsList" },
{ "name": "ChannelSubmissionsObject", "pattern": "ChannelSubmissions({key}):?query:", "target": "ChannelSubmissionsObject" }
],
"targets": {
"ChannelSubmissionsList": {
"type": "Component",
"id": "ChannelSubmissionsList",
"name": "sap.fe.templates.ListReport",
"options": {
"settings": {
"contextPath": "/ChannelSubmissions",
"initialLoad": "Enabled"
}
}
},
"ChannelSubmissionsObject": {
"type": "Component",
"id": "ChannelSubmissionsObject",
"name": "sap.fe.templates.ObjectPage",
"options": {
"settings": {
"contextPath": "/ChannelSubmissions"
}
}
}
}
}
}
}
6 changes: 6 additions & 0 deletions approuter/xs-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,12 @@
"destination": "srv-api",
"authenticationType": "xsuaa"
},
{
"source": "^/channel-submissions/(.*)$",
"target": "/channel-submissions/$1",
"destination": "srv-api",
"authenticationType": "xsuaa"
},
{
"source": "^/api/(.*)$",
"target": "/api/$1",
Expand Down
15 changes: 15 additions & 0 deletions db/channels.cds
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,18 @@ entity ChannelTopicMap : cuid, managed {
relevance : Integer default 50; // 0-100; orders the per-topic band, desc
authoringStatus : AuthoringStatus default 'AI_SEEDED' @assert.range;
}

// --- P4: community submission loop (login-required proposals, admin-moderated) ---
type SubmissionKind : String enum { ADD; EDIT; REMOVE; }
type SubmissionStatus : String enum { PENDING; APPROVED; REJECTED; }

entity ChannelSubmissions : cuid, managed {
kind : SubmissionKind @mandatory @assert.range;
targetChannel : Association to Channels; // null for ADD; required for EDIT/REMOVE (enforced in handler)
proposed : LargeString; // JSON of proposed curated fields (ADD/EDIT); ignored for REMOVE
rationale : String(1000); // submitter's free-text reason
submitterId : String(120); // set server-side from req.user.id
status : SubmissionStatus default 'PENDING' @assert.range;
reviewerId : String(120); // set on approve/reject from req.user.id
reviewNote : String(800); // moderator note
}
74 changes: 74 additions & 0 deletions db/last-dev/csn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3733,6 +3733,80 @@
},
"@cds.persistence.name": "COM_SAP_DEVELOPERS_IMS_UIEVENT"
},
"com.sap.developers.ims.ChannelSubmissions": {
"kind": "entity",
"@cds.persistence.journal": true,
"elements": {
"ID": {
"key": true,
"type": "cds.String",
"length": 36,
"@cds.persistence.name": "ID"
},
"createdAt": {
"type": "cds.Timestamp",
"@cds.persistence.name": "CREATEDAT"
},
"createdBy": {
"type": "cds.String",
"length": 255,
"@cds.persistence.name": "CREATEDBY"
},
"modifiedAt": {
"type": "cds.Timestamp",
"@cds.persistence.name": "MODIFIEDAT"
},
"modifiedBy": {
"type": "cds.String",
"length": 255,
"@cds.persistence.name": "MODIFIEDBY"
},
"kind": {
"type": "cds.String",
"length": 5000,
"@cds.persistence.name": "KIND"
},
"targetChannel_ID": {
"type": "cds.String",
"length": 36,
"@odata.foreignKey4": "targetChannel",
"@cds.persistence.name": "TARGETCHANNEL_ID"
},
"proposed": {
"type": "cds.LargeString",
"@cds.persistence.name": "PROPOSED"
},
"rationale": {
"type": "cds.String",
"length": 1000,
"@cds.persistence.name": "RATIONALE"
},
"submitterId": {
"type": "cds.String",
"length": 120,
"@cds.persistence.name": "SUBMITTERID"
},
"status": {
"type": "cds.String",
"default": {
"val": "PENDING"
},
"length": 5000,
"@cds.persistence.name": "STATUS"
},
"reviewerId": {
"type": "cds.String",
"length": 120,
"@cds.persistence.name": "REVIEWERID"
},
"reviewNote": {
"type": "cds.String",
"length": 800,
"@cds.persistence.name": "REVIEWNOTE"
}
},
"@cds.persistence.name": "COM_SAP_DEVELOPERS_IMS_CHANNELSUBMISSIONS"
},
"com.sap.developers.ims.CatGameAwards": {
"kind": "entity",
"doc": "\"Hit the Cat\" mini-game daily point ledger (issue #2042).\n\nOne row = one calendar day on which a signed-in player earned the daily\ncat-game award during a given Devtoberfest event. The award endpoint\n(POST /api/devtoberfest/cat-game/award) writes exactly one row per\n(user, event, day): 5 points per day, once per day, capped at 100 points\ntotal per event, and only while that event is active.\n\nThe natural (user, event, awardDate) tuple is the PRIMARY KEY — no surrogate\nID — so HANA enforces the once-per-day rule at the DB layer: a second insert\nfor the same day collides on the PK and the handler maps it to\n\"already-today\" (race-safe, unlike a CAP-only @assert.unique which this\nrepo's raw db.run() inserts bypass — see srv/lib/resolve-db-user.js).\n\n`createdAt` (from `managed`) is the actual award instant and is what the\ncross-container GAMEBOARD_BONUS_V1 view exposes as AWARD_DATE, so the\ngameboard's event-window filter always sees an in-window timestamp (the\nendpoint only ever inserts while the event is live).",
Expand Down
1 change: 1 addition & 0 deletions db/persistence.cds
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ annotate ims.Channels with @cds.persistence.journal;
annotate ims.ChannelCollections with @cds.persistence.journal;
annotate ims.ChannelCollectionItems with @cds.persistence.journal;
annotate ims.ChannelTopicMap with @cds.persistence.journal;
annotate ims.ChannelSubmissions with @cds.persistence.journal;
17 changes: 17 additions & 0 deletions db/src/com.sap.developers.ims.ChannelSubmissions.hdbmigrationtable
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
== version=1
COLUMN TABLE com_sap_developers_ims_ChannelSubmissions (
ID NVARCHAR(36) NOT NULL,
createdAt TIMESTAMP,
createdBy NVARCHAR(255),
modifiedAt TIMESTAMP,
modifiedBy NVARCHAR(255),
kind NVARCHAR(5000),
targetChannel_ID NVARCHAR(36),
proposed NCLOB,
rationale NVARCHAR(1000),
submitterId NVARCHAR(120),
status NVARCHAR(5000) DEFAULT 'PENDING',
reviewerId NVARCHAR(120),
reviewNote NVARCHAR(800),
PRIMARY KEY(ID)
)
Loading
Loading