diff --git a/api/src/controllers/items.ts b/api/src/controllers/items.ts index 3dbaa1aa6e..9dc11f8596 100644 --- a/api/src/controllers/items.ts +++ b/api/src/controllers/items.ts @@ -79,7 +79,9 @@ router.patch( return res.json({ data: item || null }); } - throw new RouteNotFoundException(req.path); + const primaryKeys = await service.update(req.body); + const result = await service.readByKey(primaryKeys, req.sanitizedQuery); + return res.json({ data: result || null }); }) ); @@ -96,7 +98,6 @@ router.patch( const primaryKey = req.params.pk.includes(',') ? req.params.pk.split(',') : req.params.pk; const updatedPrimaryKey = await service.update(req.body, primaryKey as any); - const result = await service.readByKey(updatedPrimaryKey, req.sanitizedQuery); res.json({ data: result || null }); diff --git a/api/src/database/seeds/system.yaml b/api/src/database/seeds/system.yaml index 8e6742b438..7f7b76ed90 100644 --- a/api/src/database/seeds/system.yaml +++ b/api/src/database/seeds/system.yaml @@ -22,6 +22,9 @@ tables: display_template: type: string length: 255 + sort_field: + type: string + length: 64 directus_roles: id: @@ -84,6 +87,8 @@ tables: type: text tags: type: json + avatar: + type: uuid timezone: type: string length: 255 @@ -115,8 +120,6 @@ tables: length: 255 last_login: type: timestamp - avatar: - type: uuid last_page: type: string length: 255 @@ -628,6 +631,8 @@ rows: - collection: directus_roles field: name interface: text-input + options: + placeholder: The unique name for this role... locked: true sort: 1 width: half diff --git a/app/src/components/v-icon/custom-icons/directus.vue b/app/src/components/v-icon/custom-icons/directus.vue new file mode 100644 index 0000000000..94de11345a --- /dev/null +++ b/app/src/components/v-icon/custom-icons/directus.vue @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/app/src/components/v-icon/v-icon.vue b/app/src/components/v-icon/v-icon.vue index 4220d4d0f9..276c700152 100644 --- a/app/src/components/v-icon/v-icon.vue +++ b/app/src/components/v-icon/v-icon.vue @@ -15,6 +15,7 @@ import { defineComponent, computed } from '@vue/composition-api'; import useSizeClass, { sizeProps } from '@/composables/size-class'; +import CustomIconDirectus from './custom-icons/directus.vue'; import CustomIconBox from './custom-icons/box.vue'; import CustomIconCommitNode from './custom-icons/commit_node.vue'; import CustomIconGrid1 from './custom-icons/grid_1.vue'; @@ -31,6 +32,7 @@ import CustomIconFlipVertical from './custom-icons/flip_vertical.vue'; import CustomIconFolderMove from './custom-icons/folder_move.vue'; const customIcons: string[] = [ + 'directus', 'box', 'commit_node', 'grid_1', @@ -49,6 +51,7 @@ const customIcons: string[] = [ export default defineComponent({ components: { + CustomIconDirectus, CustomIconBox, CustomIconCommitNode, CustomIconGrid1, diff --git a/app/src/components/v-progress/linear/v-progress-linear.vue b/app/src/components/v-progress/linear/v-progress-linear.vue index d8da5159f1..22799c2433 100644 --- a/app/src/components/v-progress/linear/v-progress-linear.vue +++ b/app/src/components/v-progress/linear/v-progress-linear.vue @@ -120,10 +120,14 @@ body { @keyframes indeterminate { 0% { transform: scaleX(0); + } + + 10% { + transform: scaleX(0); animation-timing-function: cubic-bezier(0.1, 0.6, 0.9, 0.5); } - 50% { + 60% { transform: scaleX(1) translateX(25%); animation-timing-function: cubic-bezier(0.4, 0.1, 0.2, 0.9); } diff --git a/app/src/composables/use-collection/use-collection.ts b/app/src/composables/use-collection/use-collection.ts index 3c3089a4cf..99c371f2a6 100644 --- a/app/src/composables/use-collection/use-collection.ts +++ b/app/src/composables/use-collection/use-collection.ts @@ -33,7 +33,7 @@ export function useCollection(collectionKey: string | Ref) { }); const sortField = computed(() => { - return fields.value?.find((field) => field.meta?.special === 'sort') || null; + return info.value?.meta?.sort_field || null; }); type Status = { diff --git a/app/src/hydrate.ts b/app/src/hydrate.ts index 6bc5bf829a..48392050d6 100644 --- a/app/src/hydrate.ts +++ b/app/src/hydrate.ts @@ -8,6 +8,7 @@ import { useSettingsStore, useLatencyStore, useRelationsStore, + usePermissionsStore, } from '@/stores'; import { setLanguage, Language } from '@/lang'; @@ -30,6 +31,7 @@ export function useStores( useSettingsStore, useLatencyStore, useRelationsStore, + usePermissionsStore, ] ) { return stores.map((useStore) => useStore()) as GenericStore[]; diff --git a/app/src/interfaces/index.ts b/app/src/interfaces/index.ts index 0355b990b6..6857980bd1 100644 --- a/app/src/interfaces/index.ts +++ b/app/src/interfaces/index.ts @@ -13,6 +13,7 @@ import InterfaceIcon from './icon'; import InterfaceImage from './image'; import InterfaceManyToMany from './many-to-many'; import InterfaceManyToOne from './many-to-one'; +import InterfaceMarkdown from './markdown'; import InterfaceNotice from './notice'; import InterfaceNumeric from './numeric/'; import InterfaceOneToMany from './one-to-many'; @@ -45,6 +46,7 @@ export const interfaces = [ InterfaceImage, InterfaceManyToMany, InterfaceManyToOne, + InterfaceMarkdown, InterfaceNotice, InterfaceNumeric, InterfaceOneToMany, diff --git a/app/src/interfaces/markdown/demo.md b/app/src/interfaces/markdown/demo.md new file mode 100644 index 0000000000..af45f9d930 --- /dev/null +++ b/app/src/interfaces/markdown/demo.md @@ -0,0 +1,132 @@ +# h1 Heading +## h2 Heading +### h3 Heading +#### h4 Heading +##### h5 Heading +###### h6 Heading + + +## Horizontal Rules + +___ + +--- + +*** + + +## Emphasis + +**This is bold text** + +__This is bold text__ + +*This is italic text* + +_This is italic text_ + +~~Strikethrough~~ + + +## Blockquotes + + +> Blockquotes can also be nested... +>> ...by using additional greater-than signs right next to each other... +> > > ...or with spaces between arrows. + + +## Lists + +Unordered + ++ Create a list by starting a line with `+`, `-`, or `*` ++ Sub-lists are made by indenting 2 spaces: + - Marker character change forces new list start: + * Ac tristique libero volutpat at + + Facilisis in pretium nisl aliquet + - Nulla volutpat aliquam velit ++ Very easy! + +Ordered + +1. Lorem ipsum dolor sit amet +2. Consectetur adipiscing elit +3. Integer molestie lorem at massa + + +1. You can use sequential numbers... +1. ...or keep all the numbers as `1.` + +Start numbering with offset: + +57. foo +1. bar + + +## Code + +Inline `code` + +Indented code + + // Some comments + line 1 of code + line 2 of code + line 3 of code + + +Block code "fences" + +``` +Sample text here... +``` + +Syntax highlighting + +``` js +var foo = function (bar) { + return bar++; +}; + +console.log(foo(5)); +``` + +## Tables + +| Option | Description | +| ------ | ----------- | +| data | path to data files to supply the data that will be passed into templates. | +| engine | engine to be used for processing templates. Handlebars is the default. | +| ext | extension to be used for dest files. | + +Right aligned columns + +| Option | Description | +| ------:| -----------:| +| data | path to data files to supply the data that will be passed into templates. | +| engine | engine to be used for processing templates. Handlebars is the default. | +| ext | extension to be used for dest files. | + + +## Links + +[link text](http://dev.nodeca.com) + +[link with title](http://nodeca.github.io/pica/demo/ "title text!") + +Autoconverted link https://github.com/nodeca/pica (enable linkify to see) + + +## Images + +![Minion](https://octodex.github.com/images/minion.png) +![Stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat") + +Like links, Images also have a footnote style syntax + +![Alt text][id] + +With a reference later in the document defining the URL location: + +[id]: https://octodex.github.com/images/dojocat.jpg "The Dojocat" diff --git a/app/src/interfaces/markdown/index.ts b/app/src/interfaces/markdown/index.ts new file mode 100644 index 0000000000..8746bf648f --- /dev/null +++ b/app/src/interfaces/markdown/index.ts @@ -0,0 +1,30 @@ +import InterfaceMarkdown from './markdown.vue'; +import { defineInterface } from '@/interfaces/define'; + +export default defineInterface(({ i18n }) => ({ + id: 'markdown', + name: i18n.t('markdown'), + icon: 'text_fields', + component: InterfaceMarkdown, + types: ['text'], + options: [ + { + field: 'placeholder', + name: i18n.t('placeholder'), + type: 'string', + meta: { + width: 'half', + interface: 'text-input', + }, + }, + { + field: 'tabbed', + name: i18n.t('tabbed'), + type: 'boolean', + meta: { + width: 'half', + interface: 'toggle', + }, + }, + ], +})); diff --git a/app/src/interfaces/markdown/markdown.story.ts b/app/src/interfaces/markdown/markdown.story.ts new file mode 100644 index 0000000000..889813b0cf --- /dev/null +++ b/app/src/interfaces/markdown/markdown.story.ts @@ -0,0 +1,51 @@ +import { withKnobs, boolean, text, optionsKnob } from '@storybook/addon-knobs'; +import { action } from '@storybook/addon-actions'; +import Vue from 'vue'; +import InterfaceMarkdown from './markdown.vue'; +import markdown from './readme.md'; +import withPadding from '../../../.storybook/decorators/with-padding'; +import { defineComponent, ref } from '@vue/composition-api'; +import RawValue from '../../../.storybook/raw-value.vue'; +import i18n from '@/lang'; + +Vue.component('interface-markdown', InterfaceMarkdown); + +export default { + title: 'Interfaces / Markdown', + decorators: [withKnobs, withPadding], + parameters: { + notes: markdown, + }, +}; + +export const basic = () => + defineComponent({ + components: { RawValue }, + i18n, + props: { + disabled: { + default: boolean('Disabled', false, 'Options'), + }, + placeholder: { + default: text('Placeholder', 'Enter a value...', 'Options'), + }, + tabbed: { + default: boolean('Tabbed', false, 'Options'), + }, + }, + setup() { + const value = ref(''); + const onInput = action('input'); + return { onInput, value }; + }, + template: ` +
+ + {{ value }} +
+ `, + }); diff --git a/app/src/interfaces/markdown/markdown.test.ts b/app/src/interfaces/markdown/markdown.test.ts new file mode 100644 index 0000000000..1b1fdabab9 --- /dev/null +++ b/app/src/interfaces/markdown/markdown.test.ts @@ -0,0 +1,24 @@ +import VueCompositionAPI from '@vue/composition-api'; +import { shallowMount, createLocalVue } from '@vue/test-utils'; +import InterfaceMarkdown from './markdown.vue'; + +import VTextarea from '@/components/v-textarea'; + +const localVue = createLocalVue(); +localVue.use(VueCompositionAPI); +localVue.component('v-textarea', VTextarea); + +describe('Interfaces / Markdown', () => { + it('Renders a v-markdown', () => { + const component = shallowMount(InterfaceMarkdown, { + localVue, + propsData: { + placeholder: 'Enter value...', + }, + listeners: { + input: () => {}, + }, + }); + expect(component.find(VTextarea).exists()).toBe(true); + }); +}); diff --git a/app/src/interfaces/markdown/markdown.vue b/app/src/interfaces/markdown/markdown.vue new file mode 100644 index 0000000000..244522851a --- /dev/null +++ b/app/src/interfaces/markdown/markdown.vue @@ -0,0 +1,340 @@ + + + + + diff --git a/app/src/interfaces/markdown/readme.md b/app/src/interfaces/markdown/readme.md new file mode 100644 index 0000000000..063ce0d860 --- /dev/null +++ b/app/src/interfaces/markdown/readme.md @@ -0,0 +1,9 @@ +# Markdown + +## Options + +| Option | Description | Default | +| ------------- | ------------------------------------------------------------------- | ------------ | +| `placeholder` | Text to show when no input is entered | `null` | +| `tabbed` | If the view should be tabbed | `false` | +| `disabled` | Disables the input | `false` | diff --git a/app/src/lang/en-US/index.json b/app/src/lang/en-US/index.json index 08f7143352..f7889a6f80 100644 --- a/app/src/lang/en-US/index.json +++ b/app/src/lang/en-US/index.json @@ -18,6 +18,9 @@ "nested_files_folders_will_be_moved": "Nested files and folders will be moved one level up.", + "markdown": "Markdown", + "tabbed": "Tabbed", + "revision_post_update": "Here is what this item looked like after the update...", "changes_made": "These are the specific changes that were made...", "no_relational_data": "Keep in mind that this does not include relational data.", @@ -455,8 +458,8 @@ "presets": "Presets", - "unexpected_error": "An unexpected error occured", - "unexpected_error_copy": "Something went wrong.. Please try again later.", + "unexpected_error": "Unexpected Error", + "unexpected_error_copy": "An unexpected error has occured. Please try again later.", "copy_details": "Copy Details", "no_app_access": "No App Access", @@ -760,19 +763,19 @@ "keep_editing": "Keep Editing", "page_help_collections_overview": "**Collections Overview** — Lists of all collections you have access to.", - "page_help_collections_browse": "**Browse Items** — Lists all {collection} items you have access to. Customize layout, filters, and sorting to tailor your view, and even save bookmarks of these different configurations for quick access.

Learn More", + "page_help_collections_browse": "**Browse Items** — Lists all {collection} items you have access to. Customize layout, filters, and sorting to tailor your view, and even save bookmarks of these different configurations for quick access.", "page_help_collections_detail": "**Item Detail** — A form for viewing and managing this item. This sidebar also contains a full history of revisions, and embedded comments.", "page_help_activity_browse": "**Browse Activity** — A comprehensive listing of all your user's system and content activity.", "page_help_activity_detail": "**Activity Detail** — Shows accountability info, revision data, and the update message for this activity record.", "page_help_files_browse": "**File Library** — Lists all file assets uploaded to this project. Customize layout, filters, and sorting to tailor your view, and even save bookmarks of these different configurations for quick access.", "page_help_files_detail": "**File Detail** — A form for managing file metadata, editing the original asset, and updating access settings.", - "page_help_settings_project": "**Project Settings** — Your project's global configuration options.

Learn More", + "page_help_settings_project": "**Project Settings** — Your project's global configuration options.", "page_help_settings_datamodel_collections": "**Data Model: Collections** — Lists all collections available. This includes visible, hidden, and system collections, as well as unmanaged database tables that can be added.", "page_help_settings_datamodel_fields": "**Data Model: Collection** — A form for managing this collection and its fields.", "page_help_settings_roles_browse": "**Browse Roles** — Lists the Admin, Public and custom User Roles.", "page_help_settings_roles_detail": "**Role Detail** — Manage a role's permissions and other settings.", "page_help_settings_presets_browse": "**Browse Presets** — Lists all presets in the project, including: user, role, and global bookmarks, as well as default views.", - "page_help_settings_presets_detail": "**Preset Detail** — A form for managing bookmarks and default collection presets.

To create a default preset, choose a role... TK TK", + "page_help_settings_presets_detail": "**Preset Detail** — A form for managing bookmarks and default collection presets.", "page_help_settings_webhooks_browse": "**Browse Webhooks** — Lists all webhooks within the project.", "page_help_settings_webhooks_detail": "**Webhook Detail** — A form for creating and managing project webhooks.", "page_help_users_browse": "**User Directory** — Lists all system users within this project.", @@ -912,7 +915,7 @@ "connection": "Connection", "contains": "Contains", "continue": "Continue", - "continue_as": "{name} is already authenticated for this project. If you recognize this account, please press continue.", + "continue_as": "{name} is already authenticated. If you recognize this account, press continue.", "creating_item": "Creating Item", "creating_item_page_title": "Creating Item: {collection}", "creating_role": "Creating Role", @@ -964,6 +967,12 @@ "dialog_beginning": "Beginning of dialog window.", "display_name": "Display Name", "directus_version": "Directus Version", + "server_stack": "Server Stack", + "operating_system": "Operating System", + "installed_on": "Installed On", + "database_client": "Database Client", + "database_host": "Database Host", + "database_port": "Database Port", "done": "Done", "dont_manage": "Don't Manage", "dont_manage_copy": "Privileges, preferences, and settings for this collection will be permanently removed from the system! Are you sure?", @@ -1102,6 +1111,7 @@ "no_items_selected": "No items selected", "no_related_entries": "Has no related entries", "not_authenticated": "Not Authenticated", + "authenticated": "Authenticated", "not_between": "Not between", "not_contains": "Doesn't contain", "not_empty": "Is not empty", diff --git a/app/src/layouts/tabular/tabular.vue b/app/src/layouts/tabular/tabular.vue index 5abcaf8495..b4e8a41f9b 100644 --- a/app/src/layouts/tabular/tabular.vue +++ b/app/src/layouts/tabular/tabular.vue @@ -78,7 +78,7 @@ :server-sort="itemCount === limit || totalPages > 1" :item-key="primaryKeyField.field" :show-manual-sort="_filters && _filters.length === 0 && sortField !== null" - :manual-sort-key="sortField && sortField.field" + :manual-sort-key="sortField" selection-use-keys @click:row="onRowClick" @update:sort="onSortChange" @@ -343,7 +343,7 @@ export default defineComponent({ _viewQuery.value?.fields || availableFields.value .filter((field: Field) => { - return field.schema?.is_primary_key === false && field.meta.special !== 'sort'; + return field.schema?.is_primary_key === false; }) .slice(0, 4) .map(({ field }) => field); diff --git a/app/src/modules/activity/routes/browse/browse.vue b/app/src/modules/activity/routes/browse/browse.vue index 78d4e8bdac..a8b3df8a7f 100644 --- a/app/src/modules/activity/routes/browse/browse.vue +++ b/app/src/modules/activity/routes/browse/browse.vue @@ -34,13 +34,10 @@ diff --git a/app/src/modules/collections/routes/browse/browse.vue b/app/src/modules/collections/routes/browse/browse.vue index 54cb654692..4f055ecb7c 100644 --- a/app/src/modules/collections/routes/browse/browse.vue +++ b/app/src/modules/collections/routes/browse/browse.vue @@ -138,13 +138,8 @@ diff --git a/app/src/modules/collections/routes/detail/detail.vue b/app/src/modules/collections/routes/detail/detail.vue index 155f80896f..e05259d068 100644 --- a/app/src/modules/collections/routes/detail/detail.vue +++ b/app/src/modules/collections/routes/detail/detail.vue @@ -152,7 +152,7 @@ diff --git a/app/src/modules/collections/routes/overview/overview.vue b/app/src/modules/collections/routes/overview/overview.vue index 5266054267..3c334926a3 100644 --- a/app/src/modules/collections/routes/overview/overview.vue +++ b/app/src/modules/collections/routes/overview/overview.vue @@ -30,10 +30,7 @@ diff --git a/app/src/modules/files/routes/browse/browse.vue b/app/src/modules/files/routes/browse/browse.vue index 63816541d9..b6c4cac3ff 100644 --- a/app/src/modules/files/routes/browse/browse.vue +++ b/app/src/modules/files/routes/browse/browse.vue @@ -128,13 +128,10 @@ diff --git a/app/src/modules/files/routes/detail/components/file-info-drawer-detail.vue b/app/src/modules/files/routes/detail/components/file-info-drawer-detail.vue index df22ccc877..e4a11cce6f 100644 --- a/app/src/modules/files/routes/detail/components/file-info-drawer-detail.vue +++ b/app/src/modules/files/routes/detail/components/file-info-drawer-detail.vue @@ -42,7 +42,7 @@
-
{{ $t('uploaded_by') }}
+
{{ $t('owner') }}
{{ user.name }} @@ -86,6 +86,11 @@
+ + + +
+ @@ -94,6 +99,7 @@ import { defineComponent, computed, ref, watch } from '@vue/composition-api'; import readableMimeType from '@/utils/readable-mime-type'; import bytes from 'bytes'; import i18n from '@/lang'; +import marked from 'marked'; import localizedFormat from '@/utils/localized-format'; import api from '@/api'; @@ -122,7 +128,7 @@ export default defineComponent({ const { user } = useUser(); const { folder } = useFolder(); - return { readableMimeType, size, creationDate, user, folder }; + return { readableMimeType, size, creationDate, user, folder, marked }; function useCreationDate() { const creationDate = ref(null); diff --git a/app/src/modules/files/routes/detail/detail.vue b/app/src/modules/files/routes/detail/detail.vue index 4360c39bc5..10a4cca7df 100644 --- a/app/src/modules/files/routes/detail/detail.vue +++ b/app/src/modules/files/routes/detail/detail.vue @@ -163,9 +163,6 @@ collection="directus_files" :primary-key="primaryKey" /> - -
- @@ -186,7 +183,6 @@ import FileLightbox from '@/views/private/components/file-lightbox'; import { useFieldsStore } from '@/stores/'; import { Field } from '@/types'; import FileInfoDrawerDetail from './components/file-info-drawer-detail.vue'; -import marked from 'marked'; import useFormFields from '@/composables/use-form-fields'; import FolderPicker from '../../components/folder-picker'; import api from '@/api'; @@ -315,7 +311,6 @@ export default defineComponent({ previewActive, revisionsDrawerDetail, formFields, - marked, confirmLeave, leaveTo, discardAndLeave, diff --git a/app/src/modules/settings/components/navigation/navigation.vue b/app/src/modules/settings/components/navigation/navigation.vue index bb82e23686..fb881eceba 100644 --- a/app/src/modules/settings/components/navigation/navigation.vue +++ b/app/src/modules/settings/components/navigation/navigation.vue @@ -15,12 +15,21 @@ {{ item.name }} + + + + + Directus {{ version }} + + + + + diff --git a/app/src/modules/settings/routes/data-model/collections/collections.vue b/app/src/modules/settings/routes/data-model/collections/collections.vue index 951c89afc5..61a4ba2aa4 100644 --- a/app/src/modules/settings/routes/data-model/collections/collections.vue +++ b/app/src/modules/settings/routes/data-model/collections/collections.vue @@ -77,12 +77,9 @@ diff --git a/app/src/modules/settings/routes/data-model/fields/fields.vue b/app/src/modules/settings/routes/data-model/fields/fields.vue index b9bf9f0c0d..d16cdc134f 100644 --- a/app/src/modules/settings/routes/data-model/fields/fields.vue +++ b/app/src/modules/settings/routes/data-model/fields/fields.vue @@ -75,10 +75,7 @@ diff --git a/app/src/modules/settings/routes/data-model/new-collection/new-collection.vue b/app/src/modules/settings/routes/data-model/new-collection/new-collection.vue index ca1a209398..1cec54cdca 100644 --- a/app/src/modules/settings/routes/data-model/new-collection/new-collection.vue +++ b/app/src/modules/settings/routes/data-model/new-collection/new-collection.vue @@ -64,15 +64,15 @@

{{ $t('creating_collection_system') }}

-
-
{{ $t(field.label) }}
- +
+
{{ $t(info.label) }}
+
@@ -108,7 +108,7 @@ import notify from '@/utils/notify'; import router from '@/router'; export default defineComponent({ - setup(props) { + setup() { const collectionsStore = useCollectionsStore(); const fieldsStore = useFieldsStore(); @@ -118,51 +118,51 @@ export default defineComponent({ const primaryKeyFieldName = ref('id'); const primaryKeyFieldType = ref<'auto_int' | 'uuid' | 'manual'>('auto_int'); - const systemFields = reactive([ - { - id: 'status', + const sortField = ref(); + + const systemFields = reactive({ + status: { enabled: false, name: 'status', label: 'status', icon: 'flag', }, - { - id: 'sort', + sort: { enabled: false, name: 'sort', label: 'sort', icon: 'low_priority', }, - /** @TODO re-enable these when the api supports the special types for created/modified by/on */ - // { - // id: 'owner', - // enabled: false, - // name: 'created_by', - // label: 'created_by_owner', - // icon: 'account_circle', - // }, - // { - // id: 'created_on', - // enabled: false, - // name: 'created_on', - // label: 'created_on', - // icon: 'access_time', - // }, - // { - // id: 'modified_by', - // enabled: false, - // name: 'modified_by', - // label: 'modified_by', - // icon: 'account_circle', - // }, - // { - // id: 'modified_on', - // enabled: false, - // name: 'modified_on', - // label: 'modified_on', - // icon: 'access_time', - // }, - ]); + }); + + /** @TODO re-enable these when the api supports the special types for created/modified by/on */ + // { + // id: 'owner', + // enabled: false, + // name: 'created_by', + // label: 'created_by_owner', + // icon: 'account_circle', + // }, + // { + // id: 'created_on', + // enabled: false, + // name: 'created_on', + // label: 'created_on', + // icon: 'access_time', + // }, + // { + // id: 'modified_by', + // enabled: false, + // name: 'modified_by', + // label: 'modified_by', + // icon: 'account_circle', + // }, + // { + // id: 'modified_on', + // enabled: false, + // name: 'modified_on', + // label: 'modified_on', + // icon: 'access_time', const saving = ref(false); const saveError = ref(null); @@ -185,6 +185,7 @@ export default defineComponent({ await api.post(`/collections`, { collection: collectionName.value, fields: [getPrimaryKeyField(), ...getSystemFields()], + sort_field: sortField.value, }); await collectionsStore.hydrate(); @@ -259,9 +260,10 @@ export default defineComponent({ function getSystemFields() { const fields: DeepPartial[] = []; - if (systemFields[0].enabled === true) { + // Status + if (systemFields.status.enabled === true) { fields.push({ - field: systemFields[0].name, + field: systemFields.status.name, type: 'string', meta: { width: 'full', @@ -294,18 +296,19 @@ export default defineComponent({ }); } - if (systemFields[1].enabled === true) { + // Sort + if (systemFields.sort.enabled === true) { fields.push({ - field: systemFields[1].name, + field: systemFields.sort.name, type: 'integer', meta: { interface: 'sort', hidden: true, - width: 'full', - special: 'sort', }, schema: {}, }); + + sortField.value = systemFields.sort.name; } // if (systemFields[2].enabled === true) { diff --git a/app/src/modules/settings/routes/presets/browse/browse.vue b/app/src/modules/settings/routes/presets/browse/browse.vue index 914d1dbd25..f8643a1a94 100644 --- a/app/src/modules/settings/routes/presets/browse/browse.vue +++ b/app/src/modules/settings/routes/presets/browse/browse.vue @@ -86,9 +86,6 @@ @@ -105,7 +102,6 @@ import layouts from '@/layouts'; import { TranslateResult } from 'vue-i18n'; import router from '@/router'; import ValueNull from '@/views/private/components/value-null'; -import marked from 'marked'; import PresetsInfoDrawerDetail from './components/presets-info-drawer-detail.vue'; type PresetRaw = { @@ -152,7 +148,6 @@ export default defineComponent({ confirmDelete, deleting, deleteSelection, - marked, }; function useLinks() { diff --git a/app/src/modules/settings/routes/presets/browse/components/presets-info-drawer-detail.vue b/app/src/modules/settings/routes/presets/browse/components/presets-info-drawer-detail.vue index bc68bf1134..b47d0861d6 100644 --- a/app/src/modules/settings/routes/presets/browse/components/presets-info-drawer-detail.vue +++ b/app/src/modules/settings/routes/presets/browse/components/presets-info-drawer-detail.vue @@ -10,12 +10,18 @@
{{ presetsCount }}
+ + + +
+ + + diff --git a/app/src/modules/settings/routes/presets/detail/detail.vue b/app/src/modules/settings/routes/presets/detail/detail.vue index 8072c0e19c..24ddf68dd8 100644 --- a/app/src/modules/settings/routes/presets/detail/detail.vue +++ b/app/src/modules/settings/routes/presets/detail/detail.vue @@ -77,16 +77,12 @@ diff --git a/app/src/modules/settings/routes/project/components/project-info-drawer-detail.vue b/app/src/modules/settings/routes/project/components/project-info-drawer-detail.vue index 49f3e0acc7..a6c3300f99 100644 --- a/app/src/modules/settings/routes/project/components/project-info-drawer-detail.vue +++ b/app/src/modules/settings/routes/project/components/project-info-drawer-detail.vue @@ -1,13 +1,47 @@ + + diff --git a/app/src/modules/settings/routes/project/project.vue b/app/src/modules/settings/routes/project/project.vue index 11c5e47413..fbb1c1ceae 100644 --- a/app/src/modules/settings/routes/project/project.vue +++ b/app/src/modules/settings/routes/project/project.vue @@ -23,9 +23,6 @@ @@ -35,7 +32,6 @@ import { defineComponent, ref, computed } from '@vue/composition-api'; import SettingsNavigation from '../../components/navigation/'; import useCollection from '@/composables/use-collection'; import { useSettingsStore } from '@/stores'; -import marked from 'marked'; import ProjectInfoDrawerDetail from './components/project-info-drawer-detail.vue'; import { clone } from 'lodash'; @@ -54,7 +50,7 @@ export default defineComponent({ const saving = ref(false); - return { fields, initialValues, edits, noEdits, saving, save, marked }; + return { fields, initialValues, edits, noEdits, saving, save }; async function save() { if (edits.value === null) return; diff --git a/app/src/modules/settings/routes/roles/browse/browse.vue b/app/src/modules/settings/routes/roles/browse/browse.vue index 6ae5ed3828..83c48504a9 100644 --- a/app/src/modules/settings/routes/roles/browse/browse.vue +++ b/app/src/modules/settings/routes/roles/browse/browse.vue @@ -20,11 +20,7 @@ @@ -159,11 +155,6 @@ export default defineComponent({ --v-button-background-color-disabled: var(--warning-25); } -.subdued { - color: var(--foreground-subdued); - font-style: italic; -} - .roles { padding: var(--content-padding); padding-bottom: var(--content-padding-bottom); diff --git a/app/src/modules/settings/routes/roles/detail/components/role-info-drawer-detail/role-info-drawer-detail.vue b/app/src/modules/settings/routes/roles/detail/components/role-info-drawer-detail/role-info-drawer-detail.vue index 0485d71a40..3c79d73e31 100644 --- a/app/src/modules/settings/routes/roles/detail/components/role-info-drawer-detail/role-info-drawer-detail.vue +++ b/app/src/modules/settings/routes/roles/detail/components/role-info-drawer-detail/role-info-drawer-detail.vue @@ -6,11 +6,16 @@
{{ role.id }}
+ + + +
+ + diff --git a/app/src/modules/settings/routes/roles/detail/detail.vue b/app/src/modules/settings/routes/roles/detail/detail.vue index 57f91802cf..b4c2e4a081 100644 --- a/app/src/modules/settings/routes/roles/detail/detail.vue +++ b/app/src/modules/settings/routes/roles/detail/detail.vue @@ -91,9 +91,6 @@ @@ -106,7 +103,6 @@ import router from '@/router'; import RevisionsDrawerDetail from '@/views/private/components/revisions-drawer-detail'; import useItem from '@/composables/use-item'; import SaveOptions from '@/views/private/components/save-options'; -import marked from 'marked'; import { useUserStore } from '@/stores/'; import RoleInfoDrawerDetail from './components/role-info-drawer-detail'; @@ -153,7 +149,6 @@ export default defineComponent({ saveAndAddNew, saveAsCopyAndNavigate, isBatch, - marked, }; /** diff --git a/app/src/modules/settings/routes/webhooks/browse/browse.vue b/app/src/modules/settings/routes/webhooks/browse/browse.vue index 73df829924..e33a20856b 100644 --- a/app/src/modules/settings/routes/webhooks/browse/browse.vue +++ b/app/src/modules/settings/routes/webhooks/browse/browse.vue @@ -61,13 +61,10 @@ diff --git a/app/src/modules/settings/routes/webhooks/detail/detail.vue b/app/src/modules/settings/routes/webhooks/detail/detail.vue index 6d418737e6..4274fc31fc 100644 --- a/app/src/modules/settings/routes/webhooks/detail/detail.vue +++ b/app/src/modules/settings/routes/webhooks/detail/detail.vue @@ -59,12 +59,9 @@ diff --git a/app/src/modules/users/routes/browse/browse.vue b/app/src/modules/users/routes/browse/browse.vue index f8838d0b3e..54b170f636 100644 --- a/app/src/modules/users/routes/browse/browse.vue +++ b/app/src/modules/users/routes/browse/browse.vue @@ -93,13 +93,10 @@ diff --git a/app/src/modules/users/routes/detail/components/user-info-drawer-detail.vue b/app/src/modules/users/routes/detail/components/user-info-drawer-detail.vue index 8b9980bed8..936ce695ca 100644 --- a/app/src/modules/users/routes/detail/components/user-info-drawer-detail.vue +++ b/app/src/modules/users/routes/detail/components/user-info-drawer-detail.vue @@ -29,14 +29,15 @@
- + + +
+ + diff --git a/app/src/modules/users/routes/detail/detail.vue b/app/src/modules/users/routes/detail/detail.vue index 14af76209a..bd4ac89ad9 100644 --- a/app/src/modules/users/routes/detail/detail.vue +++ b/app/src/modules/users/routes/detail/detail.vue @@ -121,9 +121,6 @@ collection="directus_users" :primary-key="primaryKey" /> - -
- @@ -138,7 +135,6 @@ import RevisionsDrawerDetail from '@/views/private/components/revisions-drawer-d import CommentsDrawerDetail from '@/views/private/components/comments-drawer-detail'; import useItem from '@/composables/use-item'; import SaveOptions from '@/views/private/components/save-options'; -import marked from 'marked'; import api from '@/api'; import { useFieldsStore } from '@/stores/'; import useFormFields from '@/composables/use-form-fields'; @@ -258,7 +254,6 @@ export default defineComponent({ saveAsCopyAndNavigate, isBatch, revisionsDrawerDetail, - marked, previewLoading, avatarSrc, roleName, diff --git a/app/src/routes/login/components/continue-as/continue-as.vue b/app/src/routes/login/components/continue-as/continue-as.vue index af44aefce7..f5f47b5e9e 100644 --- a/app/src/routes/login/components/continue-as/continue-as.vue +++ b/app/src/routes/login/components/continue-as/continue-as.vue @@ -66,7 +66,7 @@ export default defineComponent({ ::v-deep { // In the translated string for continue as, there's a B element to emphasize the users name b { - font-weight: 500; + font-weight: 600; } } diff --git a/app/src/routes/login/login.vue b/app/src/routes/login/login.vue index 48ff9faa00..ffa8c3f7cf 100644 --- a/app/src/routes/login/login.vue +++ b/app/src/routes/login/login.vue @@ -6,7 +6,11 @@ -