Giter Club home page Giter Club logo

ecampus.kpi.ua's Introduction

GitHub license GitHub contributors GitHub issues GitHub pull-requests PRs Welcome Docker Image Version (latest by date)

GitHub watchers GitHub forks GitHub stars

Electronic Campus of Igor Sikorsky Kyiv Polytechnic Institute

Environment variables

  • API_ENDPOINT - campus API location. Default value: https://api.campus.kpi.ua/
  • OLD_UI_ADDRESS - location of 'classic' campus UI. Default value: https://campus.kpi.ua/
  • LOGIN_PAGE_ADDRESS - location of login page. Used for redirect from external authorization providers. Default value: https://ecampus.kpi.ua/login

Build project

npm run build

Run project

npm run start

Build container

docker build ./ --file ./Dockerfile --tag kpiua/ecampus-kpi-ua:latest

Run

Run with default settings

docker run --rm -it -p 80:80/tcp kpiua/ecampus-kpi-ua:latest

Run with custom settings

 docker run --rm -it -e API_ENDPOINT=https://api-v2.campus.kpi.ua/ -p 80:80/tcp kpiua/ecampus-kpi-ua:latest

or

docker run --rm -it \
  -e API_ENDPOINT=https://api.local/ \
  -e OLD_UI_ADDRESS=https://old-ui.local/  \
  -e LOGIN_PAGE_ADDRESS_LINE=https://ecampus.local/login \
  -p 80:80/tcp kpiua/ecampus-kpi-ua:latest

Run locally for debug

Update config.json file to set proper API endpoints and then run docker image:

docker-compose -f dev-docker-compose.yml up --build

ecampus.kpi.ua's People

Contributors

dependabot[bot] avatar dmiach avatar dmmiach avatar ernado-x avatar imgbotapp avatar jn-lp avatar kbis avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ecampus.kpi.ua's Issues

Refactoring of permission checkers logic.

I have created new service permission, that alow you to check user permission in a handy way.

Q: Why should I use it?
A: You get JSON object with permissions which structure WON'T be changed.

We have several functions:

getPermission() - returns permission for current user.

{
        subsystems: [
            {
                id: 1,
                name: "subsystem 1",
                subdivisions:[
                    {
                        id: 1,
                        name: "subdivision 1",
                        crud: '0100',
                    },
                    {
                        id: 2,
                        name: "subdivision 2",
                        crud: '1111',
                    },
                ]
            },
            {
                id: 2,
                name: "subsystem 2",
                subdivisions:[
                    {
                        id: 2,
                        name: "subdivision 2",
                        crud: '1111',
                    },
                    {
                        id: 4,
                        name: "subdivision 4",
                        crud: '0100',
                    },
                ]
            },

        ]
    }

getSubsystemPermission(subsystemId) - returns permission (single subdivion) for current user for chosen subsystem.

{
                id: 1,
                name: "subsystem 1",
                subdivisions:[
                    {
                        id: 1,
                        name: "subdivision 1",
                        crud: '0100',
                    },
                    {
                        id: 2,
                        name: "subdivision 2",
                        crud: '1111',
                    },
                ]
            }

getSubsystemCathedraPermission(subsystemId,cathedraId) - returns permission (single cathedra) for current user for chosen subsystem and cathedra.

{
                        id: 1,
                        name: "subdivision 1",
                        crud: '0100',
                    }

getSubsystemCathedraCRUD(subsystemId,cathedraId) - returns CRUD permission for current user for chosen subsystem and cathedra.

 CRUD
'0100'

Add binding to Google

Add binding to Google will add another method of authentication for both students and teachers, which will greatly simplify the process of logging into personal account.

Binding will also help:

  • integrating Google tools to eCampus
  • control the use of the quota on Google products (Google Docs, Google Sheets, etc.) by individual user on eCampus

Автоматизація календарного контролю

Відмітка НА/А має проставлятись автоматично без участі викладача. Викладач виставляє бали в Поточний контроль. Достатньо ввести два параметри Порогових балів (значення порогів задає Викладач) для 1 та 2 атестацій і порівнювати їх із поточним балом студента в час проведення календарного контролю.

Global code improvement

Сode style should be consistent.
Here I suggest using a prettier to maintain code integrity. You should also add a linter, for example, eslint.

Fix React warnings.
Timely correction of React errors will positively affect the performance, visual component of the application, as well as its availability.

Conclusion
Code improvements that I suggest speed up the application, as you can see by checking the audits

BEFORE

BEFORE

AFTER

AFTER

Add login through QR code

Given that phones are more frequently used than PCs, it would be very convenient (from the user experience point of view) to add authorization using Campus for Android/Campus for iOS

This function can be used in both straight and reverse directions:

  • user is authorized in the Campus for Android/Campus for iOS -> just scan login QR code in web or desktop version of Campus to login (on web/desktop)
  • user is authorized in the web or desktop version of Campus -> just scan login QR code in mobile app of Campus to login (on mobile)

QR code login - is fast and easy secure login feature
Also, I created simple mock-up:
image

User receive message about API unavailability instead of invalid credentials error

When the user enters an invalid password, he always receives the message about API unavailability.

To Reproduce
Steps to reproduce the behavior:

  1. Go to login page when API is online.
  2. Try to login with wrong credentials.
  3. See error message.

Expected behavior
If API is available and the user enters the wrong credentials, then a message about invalid credentials should be shown.

Use controllerAs syntax

Rewrite controllers with controllerAs syntax to use this. bindings in controllers.
As you can see in this example, variables in controller constructor created directly on "this", not on the $scope

Implement a new design that meets brand book requirements

This task involves implement a new design that aligns with brand book standards. It includes understanding and applying the brand's color scheme, typography, imagery, and overall aesthetic to ensure consistency and brand identity across all materials.

Messaging improvements

Feature request imported from private chat

Открытый сервис службы каталогов, например, LDAP, в котором отразить организационную структуру университета, в т.ч. даные для аутентификации.
Об этот сервис опереть авторизацию для всех служб кампуса.
Предоставить доступ к единой службе каталогов подразделениям, в том числе для авторизации на местных ресурсах и определения прав доступа к ним, например:
На стороннем веб-сайте, например, веб-страничке преподавателя определенный ресурс отдавать только пользователям, авторизованным, как члены группы/кафедры/факультета.
Авторизация в домены подразделений.
Служба сообщений кампуса должна быть совмещена с функциями электронной почты, включая стандартные протоколы доступа сторонними клиентами, фильтры с серверной стороны и отдельный веб-интерфейс.
Нужны групповые алиасы на подразделения, такие, как группа, кафедра, студенты, преподаватели.
Для электронной почты желательны читаемые логины, типа и.о.фамилия@. Двойников можно избегать дополнительным доменом подразделения/группы.

Show information about API unavailability

Due to the problem with electricity and while backend of campus has not been moved yet to AWS, UI-part should show the message on ecampus.api.ua about the problems with connection to API.

Please add check for API avaiablity and show the message on UI if Ui can't reach API.

modify stat.main.css styles

@MizovOO
Some styles from this file define a lot of basic Bootstrap elements.
For example,
.panel .active { color: black; cursor: pointer; transition: ease 0.3s; }.
I don't want to apply this styles for panel component on my View. For example, you can add some class in HTML and rewrite CSS using this new class in the end of selector. Like this:
.panel .active .some_class{ color: black; cursor: pointer; transition: ease 0.3s; }.
Also I had problems with radio button elements, while I used radio button element on my page it doesn't displayed, but whet I disabled stat.main.css file, it work properly.

Implement login form for external application

For providing the ability for users to auth in to external applications by using an ecampus account we need to create a special login form.

This form should support the redirect back to the external application page and pass the authorisation code.

Route for login form: https://ecampus.kpi.ua/login/external

Query parameters which should handle form:

  • redirect_uri
  • appId

For auth user form should make POST request on endpoint: https://ecampus.kpi.ua/oauth/app/authorize
Structure of POST request:

public record ExternalApplicationAuthorizationRequest
{
    [Required] 
    public string Username { get; set; }

    [Required] 
    public string Password { get; set; }
    
    [Required] 
    public string AppId { get; set; }
    
    [Required] 
    public Uri RedirectUrl { get; set; }
}

Screenshot 2021-11-21 at 15 51 15

If form received OK (200) response code from API, then it should redirect user back to external app and pass received authorisation code, form should be closed. In case of Forbid (403) response code – error message should be displayed for user.

This task should be implemented together with https://github.com/kpi-ua/api.campus.kpi.ua/issues/23

problem with project build

As @KovalenkoStas reported:

You used new ECMAscript 6 syntax for default function parameters, but it don't work in our project because we used older ECMAscript version.
See MDN docs.
Also after grunt build appear the next error:
JS_Parse_Error { message: 'Unexpected token operator «=», expected punc «,»', filename: '../../.tmp/concat/scripts/scripts.js', line: 583, col: 50, pos: 17027, stack: 'Error\n at new JS_Parse_Error (/Users//Documents/WebStormProjects/ecampus.kpi.ua/node_modules/uglify-js/lib/parse.js:196:18)\n at js_error (/Users//Documents/WebStormProjects/ecampus.kpi.ua/node_modules/uglify-js/lib/parse.js:204:11)\n at croak (/Users//Documents/WebStormProjects/ecampus.kpi.ua/node_modules/uglify-js/lib/parse.js:680:9)\n at token_error (/Users//Documents/WebStormProjects/ecampus.kpi.ua/node_modules/uglify-js/lib/parse.js:688:9)\n at expect_token (/Users//Documents/WebStormProjects/ecampus.kpi.ua/node_modules/uglify-js/lib/parse.js:701:9)\n at expect (/Users//Documents/WebStormProjects/ecampus.kpi.ua/node_modules/uglify-js/lib/parse.js:704:36)\n at /Users//Documents/WebStormProjects/ecampus.kpi.ua/node_modules/uglify-js/lib/parse.js:969:52\n at function_ (/Users//Documents/WebStormProjects/ecampus.kpi.ua/node_modules/uglify-js/lib/parse.js:974:15)\n at /Users//Documents/WebStormProjects/ecampus.kpi.ua/node_modules/uglify-js/lib/parse.js:815:24\n at /Users//Documents/WebStormProjects/ecampus.kpi.ua/node_modules/uglify-js/lib/parse.js:727:24' }

You forget define CatalogueOkrCtrl and StudyGroupMainCtrl.

Also some of this controllers is not defined catalogue-specialization, catalogue-okr, catalogue-form-education, catalogue-subdivision, atalogue-discipline,
catalogue-selective-discipline.

Convert UpperCamelCase to lowerCamelCase

I've fixed it in a few places but not everywhere.
In JavaScript we have following best practice:

  • UpperCamelCase for classes and prototype constructors
  • lowerCamelCase for everything else

Implement Home module

This module should be accessible after user authorization.
Visible links depends from assigned rights for user:

  • messages
  • statistic
  • personal account details
  • old campus app personal area

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.