Skip to content

Feat 44 template dashboard#110

Open
mohammadsherif0 wants to merge 144 commits intodevfrom
feat-44-template_dashboard
Open

Feat 44 template dashboard#110
mohammadsherif0 wants to merge 144 commits intodevfrom
feat-44-template_dashboard

Conversation

@mohammadsherif0
Copy link
Collaborator

No description provided.

@mohammadsherif0 mohammadsherif0 self-assigned this Mar 8, 2026
Copy link
Collaborator

@dennis-zyska dennis-zyska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the first half of the code, but I have an appointment now, so I will submit the review and come back to it later.

const emailContent = await getEmailContent(
"email.template.assignment",
"CARE - New Review Assignment",
`Hello,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those default messages doesn't look good in the code, maybe we can create file on the disk that were we read from in case there is not template defined. Also for the other default emails like in the login, that way at least the code looks better.

}

const emailContent = await getEmailContent(
"email.template.studyClosed",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to file as mentioned in a previous comment

const emailContent = await getEmailContent(
"email.template.sessionStart",
"CARE - Review Session Started",
`Hello,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move content to disk file

const emailContent = await getEmailContent(
"email.template.sessionFinish",
"CARE - Review Session Completed",
`Hello,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move content to disk file

transaction: options.transaction,
});

return { success: true };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to return this, it is already done by the createSocket class if we don't throw an error. You get this with the callback in the frontend (see other socket requests)

* @param {Object} options.transaction
* @returns {Promise<Object>}
*/
async updateTemplate(data, options) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function doesn't have any special requirements that can't be handled via a beforeUpdate hook or is not already implemented in our updateData functionality (https://github.com/UKPLab/CARE/blob/main/backend/webserver/sockets/app.js#L64) right? So we should add no functions that are not absolutely necessary to reduce code and maintainability. Please also check the other functions in this class.

* @param {Object} options.transaction
* @returns {Promise<Array<string>>}
*/
async getLanguages(data, options) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we retrieve all templates in the frontend, aren't there also other languages retrieved or only the language that is currently selected? because otherwise we already have the languages in the frontend right?

* @param {Object} options.transaction
* @returns {Promise<Object>}
*/
async addLanguageContent(data, options) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it just addContent and language is just another variable that is defined in addition?

},
onUpdate: 'CASCADE',
},
published: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why it is published and not public?

});
},

filterDefaultLanguageOptions(languagesWithContent) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just use a computed for that method?

: [...SUPPORTED_LANGUAGES];
},

filterTypeOptionsInStore() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here, is a computed possible?

payload.content = { ops: [{ insert: "\n" }] };
}

const eventName = isEdit ? "templateUpdate" : "templateAdd";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see also my other comment in the backend socket, why not using appDataUpdate?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file name is misleading, maybe just Placeholder , also for later generalisation

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I was a bit confused, you basically created another Editor here, but then integraded it in the original Editor? I think there are two ways, either you make the selection one higher level in the component Template.vue where you used the Editor or even better you integrate it well in the existing editor to reduce duplicate code. I'm find with the first solution for now to get it merged, but please have a look in the Editor.vue component and check what changes are really necessary or which can be moved to Template.vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants