Skip to content

Commit

Permalink
Merge pull request #187 from makeopensource/142-fix-mobile-view-bug-o…
Browse files Browse the repository at this point in the history
…n-assignmentPage

fixed mobile viewing for assignment pages for student and instructors
  • Loading branch information
jessehartloff authored Nov 12, 2024
2 parents 298e51e + a2cbecd commit 717d000
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 11 deletions.
27 changes: 22 additions & 5 deletions devU-api/src/migration/1730867565396-publicCourses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,30 @@ export class Migration1730867565396 implements MigrationInterface {
name = 'Migration1730867565396'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "courses" ADD "is_public" boolean NOT NULL DEFAULT false`);
await queryRunner.query(`ALTER TABLE "courses" ADD "private_data" TIMESTAMP NOT NULL DEFAULT now()`);
//have to use raw SQL to fix queryfailederror for columns that already exist
const isPublicExists = await queryRunner.query(`
SELECT column_name
FROM information_schema.columns
WHERE table_name = 'courses' AND column_name = 'is_public';
`);

if (isPublicExists.length === 0) {
await queryRunner.query(`ALTER TABLE "courses" ADD "is_public" boolean NOT NULL DEFAULT false`);
}

const privateDataExists = await queryRunner.query(`
SELECT column_name
FROM information_schema.columns
WHERE table_name = 'courses' AND column_name = 'private_data';
`);

if (privateDataExists.length === 0) {
await queryRunner.query(`ALTER TABLE "courses" ADD "private_data" TIMESTAMP NOT NULL DEFAULT now()`);
}
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "courses" DROP COLUMN "private_data"`);
await queryRunner.query(`ALTER TABLE "courses" DROP COLUMN "is_public"`);
await queryRunner.query(`ALTER TABLE "courses" DROP COLUMN IF EXISTS "private_data"`);
await queryRunner.query(`ALTER TABLE "courses" DROP COLUMN IF EXISTS "is_public"`);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,61 @@
padding: 10px;
}

@media (max-width: 768px) {
.wrap {
flex-direction: column;
align-items: center;
padding: 15px;
}

.assignment_card {
width: 90%;
max-width: 500px;
margin: 0 auto;
padding: 20px;
}

.options_buttons {
flex-direction: column;
justify-content: center;
width: 100%;
gap: 10px;
}

.buttons {
width: auto;
padding: 10px 20px;
font-size: 15px;
margin: 0;
}
.card {
background-color: $list-item-background;
border-radius: 8px;
padding: 20px;
width: 200px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin: 20px;
}
}

@media (max-width: 370px) {
.header {
flex-direction: column;
align-items: center;
width:400px;

align-items: center;
padding: 10px;
}

.card, .assignment_card {
width: 100%;
max-width: 100%;
padding: 15px;
}

.buttons {
width: 100%;
max-width: none;
padding: 10px;
font-size: 14px;
}

.submissionsContainer {
padding: 10px;
}
}

0 comments on commit 717d000

Please sign in to comment.