Skip to content

Commit

Permalink
Rename (#202)
Browse files Browse the repository at this point in the history
## Изменения
<!-- Опишите здесь на языке, понятном каждому, изменения, сделанные в
исходном коде по пунктам. -->

## Детали реализации
<!-- Здесь можно описать технические детали по пунктам. -->

## Check-List
<!-- После сохранения у следующих полей появятся галочки, которые нужно
проставить мышкой -->
- [ ] Вы проверили свой код перед отправкой запроса?
- [ ] Вы написали тесты к реализованным функциям?
- [ ] Вы не забыли применить форматирование `black` и `isort` для
_Back-End_ или `Prettier` для _Front-End_?

Co-authored-by: Artem Netsvetaev <physphile@vk.com>
  • Loading branch information
physphile and fizfakovets authored Mar 5, 2024
1 parent 487dc2e commit 75af80b
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 84 deletions.
Binary file modified bun.lockb
Binary file not shown.
122 changes: 61 additions & 61 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
{
"name": "tvoi-ff",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build:development": "vite build --mode development",
"build:testing": "vite build --mode testing",
"preview": "vite preview",
"test": "vitest",
"lint": "eslint --ext .ts,.vue .",
"lint:fix": "eslint --ext .ts,.vue . --fix",
"prettier": "prettier . --check",
"prettier:write": "prettier . --write",
"stylelint": "stylelint \"**/*.{vue,css}\"",
"stylelint:fix": "stylelint \"**/*.{vue,css}\" --fix",
"format": "bun run lint:fix && bun run prettier:write && bun run stylelint:fix",
"check": "bun run lint && bun run prettier && bun run stylelint"
},
"dependencies": {
"axios": "^1.6.7",
"markdown-it": "^14.0.0",
"pinia": "^2.1.7",
"query-string": "^9.0.0",
"ua-parser-js": "^1.0.37",
"vue": "^3.4.21",
"vue-material-design-icons": "^5.3.0",
"vue-router": "^4.3.0",
"vuetify": "^3.5.7",
"workbox-window": "^7.0.0"
},
"devDependencies": {
"@types/markdown-it": "^13.0.7",
"@types/node": "^20.11.24",
"@types/ua-parser-js": "^0.7.39",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@vitejs/plugin-basic-ssl": "^1.1.0",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/eslint-config-typescript": "^12.0.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vue": "^9.22.0",
"postcss": "^8.4.35",
"postcss-html": "^1.6.0",
"postcss-preset-env": "^9.4.0",
"prettier": "^3.2.5",
"stylelint": "^16.2.1",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard": "^36.0.0",
"typescript": "5.3.3",
"vite": "^5.1.4",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-pwa": "^0.19.2",
"vite-plugin-stylelint": "^5.3.1",
"vite-plugin-vuetify": "^2.0.2",
"vitest": "^1.3.1",
"vue-tsc": "^2.0.2"
}
"name": "tvoi-ff",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build:development": "vite build --mode development",
"build:testing": "vite build --mode testing",
"preview": "vite preview --port 443",
"test": "vitest",
"lint": "eslint --ext .ts,.vue .",
"lint:fix": "eslint --ext .ts,.vue . --fix",
"prettier": "prettier . --check",
"prettier:write": "prettier . --write",
"stylelint": "stylelint \"**/*.{vue,css}\"",
"stylelint:fix": "stylelint \"**/*.{vue,css}\" --fix",
"format": "bun run lint:fix && bun run prettier:write && bun run stylelint:fix",
"check": "vue-tsc && bun run lint && bun run prettier && bun run stylelint"
},
"dependencies": {
"axios": "^1.6.7",
"markdown-it": "^14.0.0",
"pinia": "^2.1.7",
"query-string": "^9.0.0",
"ua-parser-js": "^1.0.37",
"vue": "^3.4.21",
"vue-material-design-icons": "^5.3.0",
"vue-router": "^4.3.0",
"vuetify": "^3.5.7",
"workbox-window": "^7.0.0"
},
"devDependencies": {
"@types/markdown-it": "^13.0.7",
"@types/node": "^20.11.24",
"@types/ua-parser-js": "^0.7.39",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@vitejs/plugin-basic-ssl": "^1.1.0",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/eslint-config-typescript": "^12.0.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vue": "^9.22.0",
"postcss": "^8.4.35",
"postcss-html": "^1.6.0",
"postcss-preset-env": "^9.4.0",
"prettier": "^3.2.5",
"stylelint": "^16.2.1",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard": "^36.0.0",
"typescript": "5.3.3",
"vite": "^5.1.4",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-pwa": "^0.19.2",
"vite-plugin-stylelint": "^5.3.1",
"vite-plugin-vuetify": "^2.0.2",
"vitest": "^1.3.1",
"vue-tsc": "^2.0.2"
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/IrdomAuthButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const clickHandler = async () => {
await props.button.api.unregister();
location.reload(); // TODO: придумать нормальное решение
} else if (authUrl.value) {
window.open(authUrl.value, '_blank');
window.open(authUrl.value, '_self');
}
};
</script>
Expand Down
14 changes: 7 additions & 7 deletions src/views/admin/AdminView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import AccessAllowed from '@/components/AccessAllowed.vue';
import AccessRestricted from '@/components/AccessRestricted.vue';
import IrdomLayout from '@/components/IrdomLayout.vue';
import { scopename } from '@/models/ScopeName';
import { useProfileStore } from '@/store/profile';
Expand All @@ -25,17 +25,17 @@ const copyToken = () => {
</div>
<RouterLink to="/admin/groups" class="link">Группы пользователей</RouterLink>

<AccessAllowed :scope="scopename.auth.scope.read" no-fallback>
<AccessRestricted :scope="scopename.auth.scope.read" no-fallback>
<RouterLink to="/admin/scopes" class="link"> Права доступа </RouterLink>
</AccessAllowed>
</AccessRestricted>

<AccessAllowed :scope="scopename.auth.user.read" no-fallback>
<AccessRestricted :scope="scopename.auth.user.read" no-fallback>
<RouterLink to="/admin/users" class="link">Пользователи</RouterLink>
</AccessAllowed>
</AccessRestricted>

<AccessAllowed :scope="scopename.achievements.achievement.create" no-fallback>
<AccessRestricted :scope="scopename.achievements.achievement.create" no-fallback>
<RouterLink to="/admin/achievement" class="link">Достижения</RouterLink>
</AccessAllowed>
</AccessRestricted>
</IrdomLayout>
</template>

Expand Down
6 changes: 3 additions & 3 deletions src/views/admin/achievement/AchievementListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { achievementApi, AchievementGet } from '@/api/achievement';
import { onMounted, ref, Ref } from 'vue';
import achievementRow from './AchievementRow.vue';
import AccessAllowed from '@/components/AccessAllowed.vue';
import AccessRestricted from '@/components/AccessRestricted.vue';
import IrdomLayout from '@/components/IrdomLayout.vue';
import { scopename } from '@/models/ScopeName';
Expand Down Expand Up @@ -39,7 +39,7 @@ const back = history.state.back?.startsWith('/admin') ? history.state.back : '/a

<template>
<IrdomLayout title="Управление достижениями" backable :back="back">
<AccessAllowed :scope="scopename.achievements.achievement.create">
<AccessRestricted :scope="scopename.achievements.achievement.create">
<v-row class="row" align-content="stretch">
<v-card
title="Создание новой ачивки"
Expand Down Expand Up @@ -115,7 +115,7 @@ const back = history.state.back?.startsWith('/admin') ? history.state.back : '/a
</tbody>
</v-table>
</v-row>
</AccessAllowed>
</AccessRestricted>
</IrdomLayout>
</template>

Expand Down
6 changes: 3 additions & 3 deletions src/views/admin/achievement/AchievementRecieversView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { achievementApi, AchievementGet } from '@/api/achievement';
import { computed, onMounted, ref, Ref } from 'vue';
import { useRoute } from 'vue-router';
import AccessAllowed from '@/components/AccessAllowed.vue';
import AccessRestricted from '@/components/AccessRestricted.vue';
import IrdomLayout from '@/components/IrdomLayout.vue';
import { scopename } from '@/models/ScopeName';
Expand Down Expand Up @@ -36,7 +36,7 @@ const give = (user_id: number | undefined) => {

<template>
<IrdomLayout title="Управление достижениями" backable :back="back">
<AccessAllowed :scope="scopename.achievements.achievement.create">
<AccessRestricted :scope="scopename.achievements.achievement.create">
<v-row class="row" align-content="stretch">
<v-card>
<img :src="achievementApi.getPictureUrl(achievement?.picture)" width="100" height="100" />
Expand Down Expand Up @@ -72,7 +72,7 @@ const give = (user_id: number | undefined) => {
</tbody>
</v-table>
</v-row>
</AccessAllowed>
</AccessRestricted>
</IrdomLayout>
</template>
Expand Down
6 changes: 3 additions & 3 deletions src/views/admin/group/AdminGroupView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ScopesTable from '../ScopesTable.vue';
import { onMounted, computed } from 'vue';
import { useRoute } from 'vue-router';
import { AuthApi } from '@/api';
import AccessAllowed from '@/components/AccessAllowed.vue';
import AccessRestricted from '@/components/AccessRestricted.vue';
import IrdomLayout from '@/components/IrdomLayout.vue';
import { scopename } from '@/models/ScopeName';
import { useAuthStore } from '@/store/auth';
Expand Down Expand Up @@ -63,15 +63,15 @@ const addScope = async (e: Event) => {

<template>
<IrdomLayout title="Группа" backable :back="back">
<AccessAllowed :scope="scopename.auth.scope.read" no-fallback>
<AccessRestricted :scope="scopename.auth.scope.read" no-fallback>
<h2>{{ group?.name }}</h2>
<ScopesTable
:scopes="group?.scopes.values() ?? []"
style="margin-left: 16px; width: calc(100% - 16px)"
delete-icon="delete"
@delete="deleteScope"
/>
</AccessAllowed>
</AccessRestricted>

<form
v-if="hasTokenAccess(scopename.auth.group.update)"
Expand Down
6 changes: 3 additions & 3 deletions src/views/admin/scopes/AdminScopesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { onMounted, computed } from 'vue';
import { AuthApi } from '@/api';
import IrdomLayout from '@/components/IrdomLayout.vue';
import { scopename } from '@/models/ScopeName';
import AccessAllowed from '@/components/AccessAllowed.vue';
import AccessRestricted from '@/components/AccessRestricted.vue';
import { useAuthStore } from '@/store/auth';
import { useProfileStore } from '@/store/profile';
Expand Down Expand Up @@ -47,7 +47,7 @@ const createScope = async (e: Event) => {

<template>
<IrdomLayout title="Права доступа" backable back="/admin">
<AccessAllowed :scope="scopename.auth.scope.read">
<AccessRestricted :scope="scopename.auth.scope.read">
<ScopesTable
:scopes="authStore.scopes.values()"
delete-icon="delete_forever"
Expand All @@ -61,7 +61,7 @@ const createScope = async (e: Event) => {

<v-btn type="submit" icon="md:done" />
</v-form>
</AccessAllowed>
</AccessRestricted>
</IrdomLayout>
</template>

Expand Down
6 changes: 3 additions & 3 deletions src/views/admin/users/AdminUsersView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { AuthApi } from '@/api';
import { onMounted } from 'vue';
import UsersTable from '../UsersTable.vue';
import AccessAllowed from '@/components/AccessAllowed.vue';
import AccessRestricted from '@/components/AccessRestricted.vue';
import IrdomLayout from '@/components/IrdomLayout.vue';
import { scopename } from '@/models/ScopeName';
import { useAuthStore } from '@/store/auth';
Expand All @@ -18,8 +18,8 @@ const back = history.state.back?.startsWith('/admin') ? history.state.back : '/a

<template>
<IrdomLayout title="Пользователи" backable :back="back">
<AccessAllowed :scope="scopename.auth.user.read">
<AccessRestricted :scope="scopename.auth.user.read">
<UsersTable :users="authStore.users.values()" delete-icon="delete_forever" />
</AccessAllowed>
</AccessRestricted>
</IrdomLayout>
</template>

0 comments on commit 75af80b

Please sign in to comment.