Skip to content

Commit

Permalink
BC-4992-Upload school logo (#4425)
Browse files Browse the repository at this point in the history
* BC-4992-Upload school logo

* Delete logo_nam

---------

Co-authored-by: Viktoriia <1>
  • Loading branch information
VikDavydiuk authored Oct 2, 2023
1 parent f503620 commit 6fee998
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions apps/server/src/modules/management/seed-data/schools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type SeedSchoolProperties = Omit<ISchoolProperties, 'systems' | 'federalState'>
timezone?: string;
language?: string;
logo_dataUrl?: string;
logo_name?: string;
enableStudentTeamCreation?: boolean;
};

Expand Down Expand Up @@ -180,6 +181,7 @@ const seedSchools: SeedSchoolProperties[] = [
pilot: false,
language: 'de',
logo_dataUrl: '',
logo_name: '',
officialSchoolNumber: '',
},
{
Expand All @@ -204,6 +206,7 @@ const seedSchools: SeedSchoolProperties[] = [
timezone: 'America/Belem',
language: 'en',
logo_dataUrl: '',
logo_name: '',
officialSchoolNumber: '',
},
{
Expand Down Expand Up @@ -311,6 +314,7 @@ export function generateSchools(entities: {
schoolEntity['timezone'] = partial.timezone;
schoolEntity['language'] = partial.language;
schoolEntity['logo_dataUrl'] = partial.logo_dataUrl;
schoolEntity['logo_name'] = partial.logo_name;
schoolEntity['enableStudentTeamCreation'] = partial.enableStudentTeamCreation;

return schoolEntity;
Expand Down
2 changes: 2 additions & 0 deletions backup/setup/schools.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
},
"language": "de",
"logo_dataUrl": "",
"logo_name": "",
"officialSchoolNumber": ""
},
{
Expand Down Expand Up @@ -271,6 +272,7 @@
},
"language": "en",
"logo_dataUrl": "",
"logo_name": "",
"officialSchoolNumber": ""
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/services/school/hooks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const hasEditPermissions = async (context) => {
if (
(user.permissions.includes('SCHOOL_CHAT_MANAGE') && updatesChat(key, context.data)) ||
(user.permissions.includes('SCHOOL_STUDENT_TEAM_MANAGE') && updatesTeamCreation(key, context.data)) ||
(user.permissions.includes('SCHOOL_LOGO_MANAGE') && key === 'logo_dataUrl')
(user.permissions.includes('SCHOOL_LOGO_MANAGE') && (key === 'logo_dataUrl' || key === 'logo_name'))
) {
patch[key] = context.data[key];
}
Expand Down
1 change: 1 addition & 0 deletions src/services/school/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const schoolSchema = new Schema(
currentYear: { type: Schema.Types.ObjectId, ref: 'year' },
customYears: [{ type: customYearSchema }],
logo_dataUrl: { type: String },
logo_name: { type: String },
purpose: { type: String },
rssFeeds: [{ type: rssFeedSchema }],
language: { type: String },
Expand Down
2 changes: 2 additions & 0 deletions test/services/helpers/services/schools.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const create =
documentBaseDirType,
// eslint-disable-next-line camelcase
logo_dataUrl,
logo_name,
purpose = 'test',
rssFeeds = [],
features = [],
Expand Down Expand Up @@ -56,6 +57,7 @@ const create =
currentYear,
// eslint-disable-next-line camelcase
logo_dataUrl,
logo_name,
purpose,
rssFeeds,
features,
Expand Down

0 comments on commit 6fee998

Please sign in to comment.