Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@
"CdxMenuButton",
"useResizeObserver",
"CdxMessage",
"CdxToggleSwitch"
"CdxToggleSwitch",
"CdxMenu"
],
"packageFiles": [
"resources/ext.neowiki/dist/neowiki.js",
Expand Down Expand Up @@ -256,7 +257,8 @@
"neowiki-edit-summary-help-text-schema",
"neowiki-subject-editor-title",
"neowiki-subject-editor-save",
"neowiki-schema-editor-new-property"
"neowiki-schema-editor-new-property",
"neowiki-schema-editor-optional"
],
"@group:": "TODO: Load code separately while in development. Remove later.",
"group": "ext.neowiki"
Expand Down
3 changes: 2 additions & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,6 @@
"neowiki-subject-editor-title": "Editing $1",
"neowiki-subject-editor-save": "Save changes",

"neowiki-schema-editor-new-property": "Add new property"
"neowiki-schema-editor-new-property": "Add new property",
"neowiki-schema-editor-optional": "Optional"
}
87 changes: 0 additions & 87 deletions resources/ext.neowiki/src/assets/scss/global.scss
Original file line number Diff line number Diff line change
@@ -1,43 +1,5 @@
@use '@wikimedia/codex-design-tokens/theme-wikimedia-ui.scss' as *;

.neo-cdx-field-inline {
display: grid;
grid-template-columns: auto 1fr;
grid-column-gap: $spacing-75;

.cdx-label {
width: $size-1600;
}

.cdx-field__control {
grid-column: 2 / 3;
grid-row: 1 / 2;

.cdx-select-vue {
display: block;
}
}

.cdx-label__description {
margin-top: $spacing-25;
}

.cdx-field__help-text {
grid-column: 2 / 3;
grid-row: 3 / 4;
margin-top: 0;
display: block;
}

:has( .cdx-label__description:empty ) .cdx-field__control {
margin-bottom: $spacing-35;
}

:has( .cdx-field__help-text:empty ) {
grid-template-rows: auto auto;
}
}

input[ type='number' ] {
-moz-appearance: textfield;

Expand All @@ -57,15 +19,6 @@ input[ type='number' ] {
}
}

.cdx-field {
&__validation-message {
svg {
height: $size-icon-small !important;
width: $size-icon-small !important;
}
}
}

.cdx-message__content {
font-size: $font-size-x-small !important;
margin-left: $spacing-25 !important;
Expand All @@ -90,46 +43,6 @@ input[ type='number' ] {
float: right;
}

.cdx-text-input {
&--status-default {
input {
border: $border-width-base solid rgba( $border-color-disabled, 0.55 ) !important;
}
}

&__end-icon {
svg {
color: $color-success !important;
}
}
}

.cdx-checkbox {
cursor: pointer !important;
padding: 5px;

small {
cursor: pointer !important;
font-size: $font-size-small !important;
}
}

$background-color-backdrop-light: #6c757dbf;

.cdx-dialog-backdrop {
background-color: $background-color-backdrop-light !important;
}

.cdx-dialog {
border-radius: 10px !important;
}

.cdx-select-vue--enabled .cdx-select-vue__handle {
border-radius: 5px !important;
background-color: #fff !important;
border: $border-width-base solid rgba( $border-color-disabled, 0.55 ) !important;
}

.neo-button {
border-radius: 3px !important;
padding: $spacing-50 $spacing-100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,16 @@
:initial-schema="initialSchema as Schema"
/>

<CdxTextArea />

<CdxButton
action="progressive"
weight="primary"
@click="saveSchema"
>
<CdxIcon :icon="cdxIconCheck" />
{{ $i18n( 'neowiki-save-schema' ).text() }}
</CdxButton>
<EditSummary
:save-button-label="$i18n( 'neowiki-save-schema' ).text()"
@save="saveSchema"
/>
</div>
</template>

<script setup lang="ts">
import SchemaEditor, { SchemaEditorExposes } from '@/components/SchemaEditor/SchemaEditor.vue';
import { CdxButton, CdxIcon, CdxTextArea } from '@wikimedia/codex';
import { cdxIconCheck } from '@wikimedia/codex-icons';
import EditSummary from '@/components/common/EditSummary.vue';
import { Schema } from '@neo/domain/Schema.ts';
import { ref } from 'vue';
import { NeoWikiServices } from '@/NeoWikiServices.ts';
Expand Down Expand Up @@ -55,3 +48,21 @@ const saveSchema = async (): Promise<void> => {
}
};
</script>

<style lang="scss">
@use '@wikimedia/codex-design-tokens/theme-wikimedia-ui.scss' as *;

.ext-neowiki-edit-schema-action {
border: $border-base;
border-radius: $border-radius-base;

.ext-neowiki-edit-summary {
border-block-start: $border-subtle;
padding: $spacing-100;

@media ( min-width: $min-width-breakpoint-desktop ) {
padding: $spacing-150;
}
}
}
</style>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div class="number-attributes">
<!-- cdx-field class is used for spacing -->
<div class="number-attributes cdx-field">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's just a margin, can't we rather add a custom common class like attributes-editor? Or maybe even add it once in PropertyDefinitionEditor. It feels like a hack to repurpose a class meant for something else.

<CdxField>
<template #label>
{{ $i18n( 'neowiki-property-editor-minimum' ).text() }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
<template>
<div class="text-attributes">
<CdxCheckbox
:model-value="property.multiple"
:label="$i18n( 'neowiki-property-editor-multiple' ).text()"
@update:model-value="updateMultiple"
>
<small>{{ $i18n( 'neowiki-property-editor-multiple' ).text() }}</small>
</CdxCheckbox>
<!-- cdx-field class is used for spacing -->
<div class="text-attributes cdx-field">
<CdxField :hide-label="true">
<CdxToggleSwitch
:model-value="property.multiple"
:align-switch="true"
:label="$i18n( 'neowiki-property-editor-multiple' ).text()"
@update:model-value="updateMultiple"
>
{{ $i18n( 'neowiki-property-editor-multiple' ).text() }}
</CdxToggleSwitch>
</CdxField>

<CdxCheckbox
<CdxField
v-if="property.multiple"
:model-value="property.uniqueItems"
:label="$i18n( 'neowiki-property-editor-unique-items' ).text()"
@update:model-value="updateUniqueItems"
:hide-label="true"
>
<small>{{ $i18n( 'neowiki-property-editor-unique-items' ).text() }}</small>
</CdxCheckbox>
<CdxToggleSwitch
:model-value="property.uniqueItems"
:align-switch="true"
:label="$i18n( 'neowiki-property-editor-unique-items' ).text()"
@update:model-value="updateUniqueItems"
>
{{ $i18n( 'neowiki-property-editor-unique-items' ).text() }}
</CdxToggleSwitch>
</CdxField>
</div>
</template>

<script setup lang="ts">
import { MultiStringProperty } from '@neo/domain/PropertyDefinition.ts';
import { AttributesEditorEmits, AttributesEditorProps } from '@/components/SchemaEditor/Property/AttributesEditorContract.ts';
import { CdxCheckbox } from '@wikimedia/codex';
import { CdxToggleSwitch, CdxField } from '@wikimedia/codex';

defineProps<AttributesEditorProps<MultiStringProperty>>();
const emit = defineEmits<AttributesEditorEmits<MultiStringProperty>>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
/>
</CdxField>

<CdxField>
<CdxField :hide-label="true">
<CdxToggleSwitch
v-model="localProperty.required">
v-model="localProperty.required"
:align-switch="true"
>
{{ $i18n( 'neowiki-property-editor-required' ).text() }}
</CdxToggleSwitch>
</CdxField>
Expand Down
Loading